From 0407eef7839f9dd701bdd06ea646dfe962d3ab77 Mon Sep 17 00:00:00 2001 From: Vee Zhang Date: Thu, 9 Dec 2021 17:42:59 +0800 Subject: [PATCH] add cloud core basic framework --- ccore/go.mod | 5 + ccore/go.sum | 2 + ccore/nebula/alias.go | 18 + ccore/nebula/client.go | 70 + ccore/nebula/client_graph.go | 46 + ccore/nebula/client_meta.go | 28 + ccore/nebula/client_storage_admin.go | 28 + ccore/nebula/driver.go | 178 + ccore/nebula/error.go | 1 + ccore/nebula/errors/error_code.go | 147 + ccore/nebula/errors/errors.go | 9 + ccore/nebula/examples/main.go | 57 + ccore/nebula/internal/driver/v2_0_0/driver.go | 30 + ccore/nebula/internal/driver/v2_0_0/graph.go | 86 + ccore/nebula/internal/driver/v2_0_0/meta.go | 36 + .../internal/driver/v2_0_0/storage_admin.go | 36 + ccore/nebula/internal/driver/v2_5_0/driver.go | 30 + ccore/nebula/internal/driver/v2_5_0/graph.go | 86 + ccore/nebula/internal/driver/v2_5_0/meta.go | 36 + .../internal/driver/v2_5_0/storage_admin.go | 36 + ccore/nebula/internal/driver/v2_5_1/driver.go | 30 + ccore/nebula/internal/driver/v2_5_1/graph.go | 86 + ccore/nebula/internal/driver/v2_5_1/meta.go | 36 + .../internal/driver/v2_5_1/storage_admin.go | 36 + ccore/nebula/internal/driver/v2_6_0/driver.go | 30 + ccore/nebula/internal/driver/v2_6_0/graph.go | 86 + ccore/nebula/internal/driver/v2_6_0/meta.go | 36 + .../internal/driver/v2_6_0/storage_admin.go | 36 + .../internal/thrift/v2_0_0/constants.go | 23 + .../internal/thrift/v2_0_0/graph/constants.go | 26 + .../graph_service-remote.go | 186 + .../thrift/v2_0_0/graph/graphservice.go | 1561 + .../internal/thrift/v2_0_0/graph/ttypes.go | 1654 + .../internal/thrift/v2_0_0/meta/constants.go | 26 + .../meta_service-remote.go | 2256 ++ .../thrift/v2_0_0/meta/metaservice.go | 32095 ++++++++++++++++ .../internal/thrift/v2_0_0/meta/ttypes.go | 23143 +++++++++++ .../thrift/v2_0_0/storage/constants.go | 28 + .../general_storage_service-remote.go | 202 + .../v2_0_0/storage/generalstorageservice.go | 1287 + .../graph_storage_service-remote.go | 488 + .../v2_0_0/storage/graphstorageservice.go | 5577 +++ .../storage_admin_service-remote.go | 514 + .../v2_0_0/storage/storageadminservice.go | 5967 +++ .../internal/thrift/v2_0_0/storage/ttypes.go | 12101 ++++++ ccore/nebula/internal/thrift/v2_0_0/ttypes.go | 3365 ++ .../internal/thrift/v2_5_0/constants.go | 25 + .../internal/thrift/v2_5_0/graph/constants.go | 28 + .../graph_service-remote.go | 186 + .../thrift/v2_5_0/graph/graphservice.go | 1328 + .../internal/thrift/v2_5_0/graph/ttypes.go | 1724 + .../internal/thrift/v2_5_0/meta/constants.go | 29 + .../meta_service-remote.go | 2412 ++ .../thrift/v2_5_0/meta/metaservice.go | 27604 +++++++++++++ .../internal/thrift/v2_5_0/meta/ttypes.go | 29680 ++++++++++++++ .../thrift/v2_5_0/storage/constants.go | 30 + .../general_storage_service-remote.go | 202 + .../v2_5_0/storage/generalstorageservice.go | 1086 + .../graph_storage_service-remote.go | 488 + .../v2_5_0/storage/graphstorageservice.go | 4518 +++ .../storage_admin_service-remote.go | 540 + .../v2_5_0/storage/storageadminservice.go | 5142 +++ .../internal/thrift/v2_5_0/storage/ttypes.go | 12495 ++++++ ccore/nebula/internal/thrift/v2_5_0/ttypes.go | 4579 +++ .../internal/thrift/v2_5_1/constants.go | 25 + .../internal/thrift/v2_5_1/graph/constants.go | 28 + .../graph_service-remote.go | 186 + .../thrift/v2_5_1/graph/graphservice.go | 1328 + .../internal/thrift/v2_5_1/graph/ttypes.go | 1724 + .../internal/thrift/v2_5_1/meta/constants.go | 29 + .../meta_service-remote.go | 2412 ++ .../thrift/v2_5_1/meta/metaservice.go | 27604 +++++++++++++ .../internal/thrift/v2_5_1/meta/ttypes.go | 29680 ++++++++++++++ .../thrift/v2_5_1/storage/constants.go | 30 + .../general_storage_service-remote.go | 202 + .../v2_5_1/storage/generalstorageservice.go | 1086 + .../graph_storage_service-remote.go | 488 + .../v2_5_1/storage/graphstorageservice.go | 4518 +++ .../storage_admin_service-remote.go | 540 + .../v2_5_1/storage/storageadminservice.go | 5142 +++ .../internal/thrift/v2_5_1/storage/ttypes.go | 12495 ++++++ ccore/nebula/internal/thrift/v2_5_1/ttypes.go | 4579 +++ .../internal/thrift/v2_6_0/constants.go | 26 + .../internal/thrift/v2_6_0/graph/constants.go | 28 + .../graph_service-remote.go | 212 + .../thrift/v2_6_0/graph/graphservice.go | 1640 + .../internal/thrift/v2_6_0/graph/ttypes.go | 1945 + .../internal/thrift/v2_6_0/meta/constants.go | 29 + .../meta_service-remote.go | 2464 ++ .../thrift/v2_6_0/meta/metaservice.go | 28228 ++++++++++++++ .../internal/thrift/v2_6_0/meta/ttypes.go | 27225 +++++++++++++ .../thrift/v2_6_0/storage/constants.go | 30 + .../general_storage_service-remote.go | 202 + .../v2_6_0/storage/generalstorageservice.go | 1086 + .../graph_storage_service-remote.go | 540 + .../v2_6_0/storage/graphstorageservice.go | 5142 +++ .../storage_admin_service-remote.go | 540 + .../v2_6_0/storage/storageadminservice.go | 5142 +++ .../internal/thrift/v2_6_0/storage/ttypes.go | 14095 +++++++ ccore/nebula/internal/thrift/v2_6_0/ttypes.go | 5480 +++ ccore/nebula/logger.go | 30 + ccore/nebula/options.go | 194 + ccore/nebula/types/driver.go | 82 + ccore/nebula/types/types.go | 1 + ccore/nebula/types/version.go | 10 + 105 files changed, 370403 insertions(+) create mode 100644 ccore/go.mod create mode 100644 ccore/go.sum create mode 100644 ccore/nebula/alias.go create mode 100644 ccore/nebula/client.go create mode 100644 ccore/nebula/client_graph.go create mode 100644 ccore/nebula/client_meta.go create mode 100644 ccore/nebula/client_storage_admin.go create mode 100644 ccore/nebula/driver.go create mode 100644 ccore/nebula/error.go create mode 100644 ccore/nebula/errors/error_code.go create mode 100644 ccore/nebula/errors/errors.go create mode 100644 ccore/nebula/examples/main.go create mode 100644 ccore/nebula/internal/driver/v2_0_0/driver.go create mode 100644 ccore/nebula/internal/driver/v2_0_0/graph.go create mode 100644 ccore/nebula/internal/driver/v2_0_0/meta.go create mode 100644 ccore/nebula/internal/driver/v2_0_0/storage_admin.go create mode 100644 ccore/nebula/internal/driver/v2_5_0/driver.go create mode 100644 ccore/nebula/internal/driver/v2_5_0/graph.go create mode 100644 ccore/nebula/internal/driver/v2_5_0/meta.go create mode 100644 ccore/nebula/internal/driver/v2_5_0/storage_admin.go create mode 100644 ccore/nebula/internal/driver/v2_5_1/driver.go create mode 100644 ccore/nebula/internal/driver/v2_5_1/graph.go create mode 100644 ccore/nebula/internal/driver/v2_5_1/meta.go create mode 100644 ccore/nebula/internal/driver/v2_5_1/storage_admin.go create mode 100644 ccore/nebula/internal/driver/v2_6_0/driver.go create mode 100644 ccore/nebula/internal/driver/v2_6_0/graph.go create mode 100644 ccore/nebula/internal/driver/v2_6_0/meta.go create mode 100644 ccore/nebula/internal/driver/v2_6_0/storage_admin.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/constants.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/graph/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_0_0/graph/graph_service-remote/graph_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/graph/graphservice.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/graph/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/meta/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_0_0/meta/meta_service-remote/meta_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/meta/metaservice.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/meta/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/storage/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_0_0/storage/general_storage_service-remote/general_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/storage/generalstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_0_0/storage/graph_storage_service-remote/graph_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/storage/graphstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_0_0/storage/storage_admin_service-remote/storage_admin_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/storage/storageadminservice.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/storage/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_0_0/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/constants.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/graph/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_0/graph/graph_service-remote/graph_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/graph/graphservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/graph/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/meta/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_0/meta/meta_service-remote/meta_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/meta/metaservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/meta/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/storage/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_0/storage/general_storage_service-remote/general_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/storage/generalstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_5_0/storage/graph_storage_service-remote/graph_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/storage/graphstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_5_0/storage/storage_admin_service-remote/storage_admin_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/storage/storageadminservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/storage/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_0/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/constants.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/graph/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_1/graph/graph_service-remote/graph_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/graph/graphservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/graph/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/meta/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_1/meta/meta_service-remote/meta_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/meta/metaservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/meta/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/storage/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_5_1/storage/general_storage_service-remote/general_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/storage/generalstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_5_1/storage/graph_storage_service-remote/graph_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/storage/graphstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_5_1/storage/storage_admin_service-remote/storage_admin_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/storage/storageadminservice.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/storage/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_5_1/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/constants.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/graph/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_6_0/graph/graph_service-remote/graph_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/graph/graphservice.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/graph/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/meta/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_6_0/meta/meta_service-remote/meta_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/meta/metaservice.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/meta/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/storage/constants.go create mode 100755 ccore/nebula/internal/thrift/v2_6_0/storage/general_storage_service-remote/general_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/storage/generalstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_6_0/storage/graph_storage_service-remote/graph_storage_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/storage/graphstorageservice.go create mode 100755 ccore/nebula/internal/thrift/v2_6_0/storage/storage_admin_service-remote/storage_admin_service-remote.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/storage/storageadminservice.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/storage/ttypes.go create mode 100644 ccore/nebula/internal/thrift/v2_6_0/ttypes.go create mode 100644 ccore/nebula/logger.go create mode 100644 ccore/nebula/options.go create mode 100644 ccore/nebula/types/driver.go create mode 100644 ccore/nebula/types/types.go create mode 100644 ccore/nebula/types/version.go diff --git a/ccore/go.mod b/ccore/go.mod new file mode 100644 index 0000000..6ba48ad --- /dev/null +++ b/ccore/go.mod @@ -0,0 +1,5 @@ +module github.com/vesoft-inc/nebula-http-gateway/ccore + +go 1.16 + +require github.com/facebook/fbthrift v0.31.1-0.20210223140454-614a73a42488 diff --git a/ccore/go.sum b/ccore/go.sum new file mode 100644 index 0000000..3c01dcb --- /dev/null +++ b/ccore/go.sum @@ -0,0 +1,2 @@ +github.com/facebook/fbthrift v0.31.1-0.20210223140454-614a73a42488 h1:A4KCT0mvTBkvb93gGN+efLPkrgTqmqMeaLDG51KVhMM= +github.com/facebook/fbthrift v0.31.1-0.20210223140454-614a73a42488/go.mod h1:2tncLx5rmw69e5kMBv/yJneERbzrr1yr5fdlnTbu8lU= diff --git a/ccore/nebula/alias.go b/ccore/nebula/alias.go new file mode 100644 index 0000000..8ad4f6e --- /dev/null +++ b/ccore/nebula/alias.go @@ -0,0 +1,18 @@ +package nebula + +import ( + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +type ( + Version = types.Version + AuthResponse = types.AuthResponse + ExecutionResponse = types.ExecutionResponse +) + +var ( + V2_0_0 = types.V2_0_0 + V2_5_0 = types.V2_5_0 + V2_5_1 = types.V2_5_1 + V2_6_0 = types.V2_6_0 +) diff --git a/ccore/nebula/client.go b/ccore/nebula/client.go new file mode 100644 index 0000000..e67049b --- /dev/null +++ b/ccore/nebula/client.go @@ -0,0 +1,70 @@ +package nebula + +import "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" + +type ( + // TODO: add client pool management + // TODO: add version auto recognize + + Client interface { + Graph() GraphClient + Meta() MetaClient + StorageAdmin() StorageAdminClient + } + + ConnectionInfo struct { + GraphEndpoints []string + MetaEndpoints []string + StorageAdminEndpoints []string + GraphAccount Account + } + + Account struct { + Username string + Password string + } + + defaultClient struct { + o Options + driver types.Driver + graph *driverGraph + meta *driverMeta + storageAdmin *driverStorageAdmin + } +) + +func NewClient(info ConnectionInfo, opts ...Option) (Client, error) { + o := defaultOptions() + for _, opt := range opts { + opt(&o) + } + o.complete() + if err := o.validate(); err != nil { + return nil, err + } + + driver, err := types.GetDriver(o.version) + if err != nil { + return nil, err + } + + return &defaultClient{ + o: o, + driver: driver, + graph: newDriverGraph(info.GraphEndpoints, info.GraphAccount.Username, info.GraphAccount.Password, &o.graph), + meta: newDriverMeta(info.MetaEndpoints, &o.meta), + storageAdmin: newDriverStorageAdmin(info.StorageAdminEndpoints, &o.storageAdmin), + }, nil +} + +func (c *defaultClient) Graph() GraphClient { + return (*defaultGraphClient)(c) +} + +func (c *defaultClient) Meta() MetaClient { + return (*defaultMetaClient)(c) +} + +func (c *defaultClient) StorageAdmin() StorageAdminClient { + return (*defaultStorageAdminClient)(c) +} diff --git a/ccore/nebula/client_graph.go b/ccore/nebula/client_graph.go new file mode 100644 index 0000000..b7ed9df --- /dev/null +++ b/ccore/nebula/client_graph.go @@ -0,0 +1,46 @@ +package nebula + +type ( + GraphClient interface { + Open() error + Execute(stmt []byte) (ExecutionResponse, error) + ExecuteJson(stmt []byte) ([]byte, error) + Close() error + } + + defaultGraphClient defaultClient +) + +func NewGraphClient(endpoints []string, username, password string, opts ...Option) (GraphClient, error) { + c, err := NewClient(ConnectionInfo{ + GraphEndpoints: endpoints, + GraphAccount: Account{ + Username: username, + Password: password, + }, + }, opts...) + if err != nil { + return nil, err + } + return c.Graph(), nil +} + +func (c *defaultGraphClient) Open() error { + return c.graph.open(c.driver) +} + +func (c *defaultGraphClient) Execute(stmt []byte) (ExecutionResponse, error) { + return c.graph.Execute(c.graph.sessionId, stmt) +} + +func (c *defaultGraphClient) ExecuteJson(stmt []byte) ([]byte, error) { + if err := c.graph.open(c.driver); err != nil { + return nil, err + } + + return c.graph.ExecuteJson(c.graph.sessionId, stmt) +} + +func (c *defaultGraphClient) Close() error { + return c.graph.close() +} diff --git a/ccore/nebula/client_meta.go b/ccore/nebula/client_meta.go new file mode 100644 index 0000000..a116e86 --- /dev/null +++ b/ccore/nebula/client_meta.go @@ -0,0 +1,28 @@ +package nebula + +type ( + MetaClient interface { + Open() error + Close() error + } + + defaultMetaClient defaultClient +) + +func NewMetaClient(endpoints []string, opts ...Option) (MetaClient, error) { + c, err := NewClient(ConnectionInfo{ + MetaEndpoints: endpoints, + }, opts...) + if err != nil { + return nil, err + } + return c.Meta(), nil +} + +func (c *defaultMetaClient) Open() error { + return c.meta.close() +} + +func (c *defaultMetaClient) Close() error { + return c.meta.open(c.driver) +} diff --git a/ccore/nebula/client_storage_admin.go b/ccore/nebula/client_storage_admin.go new file mode 100644 index 0000000..3e59654 --- /dev/null +++ b/ccore/nebula/client_storage_admin.go @@ -0,0 +1,28 @@ +package nebula + +type ( + StorageAdminClient interface { + Open() error + Close() error + } + + defaultStorageAdminClient defaultClient +) + +func NewStorageAdminClient(endpoints []string, opts ...Option) (StorageAdminClient, error) { + c, err := NewClient(ConnectionInfo{ + StorageAdminEndpoints: endpoints, + }, opts...) + if err != nil { + return nil, err + } + return c.StorageAdmin(), nil +} + +func (c *defaultStorageAdminClient) Open() error { + return c.storageAdmin.open(c.driver) +} + +func (c *defaultStorageAdminClient) Close() error { + return c.storageAdmin.close() +} diff --git a/ccore/nebula/driver.go b/ccore/nebula/driver.go new file mode 100644 index 0000000..414b6da --- /dev/null +++ b/ccore/nebula/driver.go @@ -0,0 +1,178 @@ +package nebula + +import ( + "sync" + + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" + _ "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/driver/v2_0_0" + _ "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/driver/v2_5_0" + _ "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/driver/v2_5_1" + _ "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/driver/v2_6_0" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +type ( + driverGraph struct { + types.GraphClientDriver + connection *connectionMu + username string + password string + sessionId int64 + } + + driverMeta struct { + types.MetaClientDriver + connection *connectionMu + } + + driverStorageAdmin struct { + types.StorageAdminClientDriver + connection *connectionMu + } + + connectionMu struct { + o *socketOptions + mu sync.Mutex + endpoints []string + } +) + +func newDriverGraph(endpoints []string, username, password string, o *socketOptions) *driverGraph { + return &driverGraph{ + connection: newConnectionMu(endpoints, o), + username: username, + password: password, + } +} + +func newDriverMeta(endpoints []string, o *socketOptions) *driverMeta { + return &driverMeta{ + connection: newConnectionMu(endpoints, o), + } +} + +func newDriverStorageAdmin(endpoints []string, o *socketOptions) *driverStorageAdmin { + return &driverStorageAdmin{ + connection: newConnectionMu(endpoints, o), + } +} + +func newConnectionMu(endpoints []string, o *socketOptions) *connectionMu { + return &connectionMu{ + o: o, + endpoints: endpoints, + } +} + +func (d *driverGraph) open(driver types.Driver) error { + if d.GraphClientDriver != nil { + return nil + } + + transport, pf, err := d.connection.connect() + if err != nil { + return err + } + + d.GraphClientDriver = driver.NewGraphClientDriver(transport, pf) + + if err = d.GraphClientDriver.Open(); err != nil { + return err + } + + resp, err := d.GraphClientDriver.Authenticate(d.username, d.password) + if err != nil { + return err + } + if errorCode := resp.ErrorCode(); errorCode != nerrors.ErrorCode_SUCCEEDED { + return nerrors.NewCodeError(errorCode, resp.ErrorMsg()) + } + sessionId := resp.SessionID() + if sessionId == nil { + panic("sessionId can not be nil after authenticate") + } + d.sessionId = *sessionId + return nil +} + +func (d *driverGraph) close() error { + if d.GraphClientDriver != nil { + if err := d.GraphClientDriver.Close(); err != nil { + return err + } + } + return nil +} + +func (d *driverMeta) open(driver types.Driver) error { + if d.MetaClientDriver != nil { + return nil + } + + transport, pf, err := d.connection.connect() + if err != nil { + return err + } + + d.MetaClientDriver = driver.NewMetaClientDriver(transport, pf) + return nil +} + +func (d *driverMeta) close() error { + if d.MetaClientDriver != nil { + if err := d.MetaClientDriver.Close(); err != nil { + return err + } + } + return nil +} + +func (d *driverStorageAdmin) open(driver types.Driver) error { + if d.StorageAdminClientDriver != nil { + return nil + } + + transport, pf, err := d.connection.connect() + if err != nil { + return err + } + + d.StorageAdminClientDriver = driver.NewStorageClientDriver(transport, pf) + return nil +} + +func (d *driverStorageAdmin) close() error { + if d.StorageAdminClientDriver != nil { + if err := d.StorageAdminClientDriver.Close(); err != nil { + return err + } + } + return nil +} + +func (c *connectionMu) connect() (thrift.Transport, thrift.ProtocolFactory, error) { + // TODO: automatically open until success, only the first endpoints is supported now. + if len(c.endpoints) == 0 { + return nil, nil, nerrors.ErrNoEndpoints + } + return c.buildThriftTransport(c.endpoints[0]) +} + +func (c *connectionMu) buildThriftTransport(endpoint string) (thrift.Transport, thrift.ProtocolFactory, error) { + transport, err := func() (thrift.Transport, error) { + if c.o.tlsConfig == nil { + return thrift.NewSocket(thrift.SocketTimeout(c.o.timeout), thrift.SocketAddr(endpoint)) + } + return thrift.NewSSLSocketTimeout(endpoint, c.o.tlsConfig, c.o.timeout) + }() + if err != nil { + return nil, nil, err + } + + bufferedTranFactory := thrift.NewBufferedTransportFactory(c.o.bufferSize) + transport = thrift.NewFramedTransportMaxLength(bufferedTranFactory.GetTransport(transport), c.o.frameMaxLength) + pf := thrift.NewBinaryProtocolFactoryDefault() + + return transport, pf, nil +} diff --git a/ccore/nebula/error.go b/ccore/nebula/error.go new file mode 100644 index 0000000..2808317 --- /dev/null +++ b/ccore/nebula/error.go @@ -0,0 +1 @@ +package nebula diff --git a/ccore/nebula/errors/error_code.go b/ccore/nebula/errors/error_code.go new file mode 100644 index 0000000..0007a84 --- /dev/null +++ b/ccore/nebula/errors/error_code.go @@ -0,0 +1,147 @@ +package errors + +import "fmt" + +type ( + ErrorCode int64 + + ecError struct { + errorCode ErrorCode + errorMsg string + } +) + +func NewCodeError(errorCode ErrorCode, errorMsg string) error { + return &ecError{ + errorCode: errorCode, + errorMsg: errorMsg, + } +} + +func (e *ecError) Error() string { + return fmt.Sprintf("%d:%s", int64(e.errorCode), e.errorMsg) +} + +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -4 + ErrorCode_E_SPACE_NOT_FOUND ErrorCode = -5 + ErrorCode_E_TAG_NOT_FOUND ErrorCode = -6 + ErrorCode_E_EDGE_NOT_FOUND ErrorCode = -7 + ErrorCode_E_INDEX_NOT_FOUND ErrorCode = -8 + ErrorCode_E_EDGE_PROP_NOT_FOUND ErrorCode = -9 + ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -10 + ErrorCode_E_ROLE_NOT_FOUND ErrorCode = -11 + ErrorCode_E_CONFIG_NOT_FOUND ErrorCode = -12 + ErrorCode_E_GROUP_NOT_FOUND ErrorCode = -13 + ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 + ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 + ErrorCode_E_STATS_NOT_FOUND ErrorCode = -19 + ErrorCode_E_BACKUP_FAILED ErrorCode = -24 + ErrorCode_E_BACKUP_EMPTY_TABLE ErrorCode = -25 + ErrorCode_E_BACKUP_TABLE_FAILED ErrorCode = -26 + ErrorCode_E_PARTIAL_RESULT ErrorCode = -27 + ErrorCode_E_REBUILD_INDEX_FAILED ErrorCode = -28 + ErrorCode_E_INVALID_PASSWORD ErrorCode = -29 + ErrorCode_E_FAILED_GET_ABS_PATH ErrorCode = -30 + ErrorCode_E_BAD_USERNAME_PASSWORD ErrorCode = -1001 + ErrorCode_E_SESSION_INVALID ErrorCode = -1002 + ErrorCode_E_SESSION_TIMEOUT ErrorCode = -1003 + ErrorCode_E_SYNTAX_ERROR ErrorCode = -1004 + ErrorCode_E_EXECUTION_ERROR ErrorCode = -1005 + ErrorCode_E_STATEMENT_EMPTY ErrorCode = -1006 + ErrorCode_E_BAD_PERMISSION ErrorCode = -1008 + ErrorCode_E_SEMANTIC_ERROR ErrorCode = -1009 + ErrorCode_E_TOO_MANY_CONNECTIONS ErrorCode = -1010 + ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = -1011 + ErrorCode_E_NO_HOSTS ErrorCode = -2001 + ErrorCode_E_EXISTED ErrorCode = -2002 + ErrorCode_E_INVALID_HOST ErrorCode = -2003 + ErrorCode_E_UNSUPPORTED ErrorCode = -2004 + ErrorCode_E_NOT_DROP ErrorCode = -2005 + ErrorCode_E_BALANCER_RUNNING ErrorCode = -2006 + ErrorCode_E_CONFIG_IMMUTABLE ErrorCode = -2007 + ErrorCode_E_CONFLICT ErrorCode = -2008 + ErrorCode_E_INVALID_PARM ErrorCode = -2009 + ErrorCode_E_WRONGCLUSTER ErrorCode = -2010 + ErrorCode_E_STORE_FAILURE ErrorCode = -2021 + ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 + ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 + ErrorCode_E_BALANCED ErrorCode = -2024 + ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -2025 + ErrorCode_E_NO_VALID_HOST ErrorCode = -2026 + ErrorCode_E_CORRUPTTED_BALANCE_PLAN ErrorCode = -2027 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -2028 + ErrorCode_E_IMPROPER_ROLE ErrorCode = -2030 + ErrorCode_E_INVALID_PARTITION_NUM ErrorCode = -2031 + ErrorCode_E_INVALID_REPLICA_FACTOR ErrorCode = -2032 + ErrorCode_E_INVALID_CHARSET ErrorCode = -2033 + ErrorCode_E_INVALID_COLLATE ErrorCode = -2034 + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH ErrorCode = -2035 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -2040 + ErrorCode_E_BLOCK_WRITE_FAILURE ErrorCode = -2041 + ErrorCode_E_REBUILD_INDEX_FAILURE ErrorCode = -2042 + ErrorCode_E_INDEX_WITH_TTL ErrorCode = -2043 + ErrorCode_E_ADD_JOB_FAILURE ErrorCode = -2044 + ErrorCode_E_STOP_JOB_FAILURE ErrorCode = -2045 + ErrorCode_E_SAVE_JOB_FAILURE ErrorCode = -2046 + ErrorCode_E_BALANCER_FAILURE ErrorCode = -2047 + ErrorCode_E_JOB_NOT_FINISHED ErrorCode = -2048 + ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -2049 + ErrorCode_E_JOB_NOT_IN_SPACE ErrorCode = -2050 + ErrorCode_E_INVALID_JOB ErrorCode = -2065 + ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 + ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 + ErrorCode_E_RESTORE_FAILURE ErrorCode = -2068 + ErrorCode_E_SESSION_NOT_FOUND ErrorCode = -2069 + ErrorCode_E_LIST_CLUSTER_FAILURE ErrorCode = -2070 + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE ErrorCode = -2071 + ErrorCode_E_GET_META_DIR_FAILURE ErrorCode = -2072 + ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 + ErrorCode_E_CONSENSUS_ERROR ErrorCode = -3001 + ErrorCode_E_KEY_HAS_EXISTS ErrorCode = -3002 + ErrorCode_E_DATA_TYPE_MISMATCH ErrorCode = -3003 + ErrorCode_E_INVALID_FIELD_VALUE ErrorCode = -3004 + ErrorCode_E_INVALID_OPERATION ErrorCode = -3005 + ErrorCode_E_NOT_NULLABLE ErrorCode = -3006 + ErrorCode_E_FIELD_UNSET ErrorCode = -3007 + ErrorCode_E_OUT_OF_RANGE ErrorCode = -3008 + ErrorCode_E_ATOMIC_OP_FAILED ErrorCode = -3009 + ErrorCode_E_DATA_CONFLICT_ERROR ErrorCode = -3010 + ErrorCode_E_WRITE_STALLED ErrorCode = -3011 + ErrorCode_E_IMPROPER_DATA_TYPE ErrorCode = -3021 + ErrorCode_E_INVALID_SPACEVIDLEN ErrorCode = -3022 + ErrorCode_E_INVALID_FILTER ErrorCode = -3031 + ErrorCode_E_INVALID_UPDATER ErrorCode = -3032 + ErrorCode_E_INVALID_STORE ErrorCode = -3033 + ErrorCode_E_INVALID_PEER ErrorCode = -3034 + ErrorCode_E_RETRY_EXHAUSTED ErrorCode = -3035 + ErrorCode_E_TRANSFER_LEADER_FAILED ErrorCode = -3036 + ErrorCode_E_INVALID_STAT_TYPE ErrorCode = -3037 + ErrorCode_E_INVALID_VID ErrorCode = -3038 + ErrorCode_E_NO_TRANSFORMED ErrorCode = -3039 + ErrorCode_E_LOAD_META_FAILED ErrorCode = -3040 + ErrorCode_E_FAILED_TO_CHECKPOINT ErrorCode = -3041 + ErrorCode_E_CHECKPOINT_BLOCKED ErrorCode = -3042 + ErrorCode_E_FILTER_OUT ErrorCode = -3043 + ErrorCode_E_INVALID_DATA ErrorCode = -3044 + ErrorCode_E_MUTATE_EDGE_CONFLICT ErrorCode = -3045 + ErrorCode_E_MUTATE_TAG_CONFLICT ErrorCode = -3046 + ErrorCode_E_OUTDATED_LOCK ErrorCode = -3047 + ErrorCode_E_INVALID_TASK_PARA ErrorCode = -3051 + ErrorCode_E_USER_CANCEL ErrorCode = -3052 + ErrorCode_E_TASK_EXECUTION_FAILED ErrorCode = -3053 + ErrorCode_E_PLAN_IS_KILLED ErrorCode = -3060 + ErrorCode_E_NO_TERM ErrorCode = -3070 + ErrorCode_E_OUTDATED_TERM ErrorCode = -3071 + ErrorCode_E_OUTDATED_EDGE ErrorCode = -3072 + ErrorCode_E_WRITE_WRITE_CONFLICT ErrorCode = -3073 + ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE ErrorCode = -3061 + ErrorCode_E_UNKNOWN ErrorCode = -8000 +) diff --git a/ccore/nebula/errors/errors.go b/ccore/nebula/errors/errors.go new file mode 100644 index 0000000..aaf64be --- /dev/null +++ b/ccore/nebula/errors/errors.go @@ -0,0 +1,9 @@ +package errors + +import "errors" + +var ( + ErrUnsupportedVersion = errors.New("unsupported version") + ErrUnsupported = errors.New("unsupported") + ErrNoEndpoints = errors.New("no endpoints") +) diff --git a/ccore/nebula/examples/main.go b/ccore/nebula/examples/main.go new file mode 100644 index 0000000..f47f458 --- /dev/null +++ b/ccore/nebula/examples/main.go @@ -0,0 +1,57 @@ +package main + +import ( + "fmt" + + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula" +) + +func main() { + for _, version := range []nebula.Version{ + nebula.V2_0_0, + nebula.V2_5_0, + nebula.V2_5_1, + nebula.V2_6_0, + } { + { // use nebula.NewClient + c, err := nebula.NewClient(nebula.ConnectionInfo{ + GraphEndpoints: []string{"192.168.8.169:9669"}, + GraphAccount: nebula.Account{ + Username: "root", + Password: "123", + }, + }, nebula.WithVersion(version)) + if err != nil { + panic(fmt.Sprintf("%s %+v", version, err)) + } + if err := c.Graph().Open(); err != nil { + panic(err) + } + resp, err := c.Graph().Execute([]byte("show users;")) + if err != nil { + panic(err) + } + fmt.Printf("%+v\n", resp) + if err := c.Graph().Close(); err != nil { + panic(err) + } + } + { // use nebula.NewClient + c, err := nebula.NewGraphClient([]string{"192.168.8.169:9669"}, "root", "123", nebula.WithVersion(version)) + if err != nil { + panic(fmt.Sprintf("%s %+v", version, err)) + } + if err := c.Open(); err != nil { + panic(err) + } + resp, err := c.Execute([]byte("show users;")) + if err != nil { + panic(err) + } + fmt.Printf("%+v\n", resp) + if err := c.Close(); err != nil { + panic(err) + } + } + } +} diff --git a/ccore/nebula/internal/driver/v2_0_0/driver.go b/ccore/nebula/internal/driver/v2_0_0/driver.go new file mode 100644 index 0000000..37959dd --- /dev/null +++ b/ccore/nebula/internal/driver/v2_0_0/driver.go @@ -0,0 +1,30 @@ +package v2_0_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.Driver = (*defaultDriver)(nil) +) + +type ( + defaultDriver struct {} +) + +func init(){ + types.Register(types.V2_0_0, &defaultDriver{}) +} + +func (d *defaultDriver) NewGraphClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return newGraphClient(transport, pf) +} + +func (d *defaultDriver) NewMetaClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return newMetaClient(transport, pf) +} + +func (d *defaultDriver) NewStorageClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return newStorageAdminClient(transport, pf) +} diff --git a/ccore/nebula/internal/driver/v2_0_0/graph.go b/ccore/nebula/internal/driver/v2_0_0/graph.go new file mode 100644 index 0000000..4b8bc03 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_0_0/graph.go @@ -0,0 +1,86 @@ +package v2_0_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" + graph2_0_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/graph" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.GraphClientDriver = (*defaultGraphClient)(nil) +) + +type ( + defaultGraphClient struct { + graph *graph2_0_0.GraphServiceClient + } + + authResponse struct { + *graph2_0_0.AuthResponse + } + + executionResponse struct { + *graph2_0_0.ExecutionResponse + } +) + +func newGraphClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return &defaultGraphClient{ + graph: graph2_0_0.NewGraphServiceClientFactory(transport, pf), + } +} + +func (c *defaultGraphClient) Open() error { + return c.graph.Transport.Open() +} + +func (c *defaultGraphClient) Authenticate(username, password string) (types.AuthResponse, error) { + resp, err := c.graph.Authenticate([]byte(username), []byte(password)) + if err != nil { + return nil, err + } + return &authResponse{AuthResponse: resp}, nil +} + +func (c *defaultGraphClient) Signout(sessionId int64) (err error) { + return c.graph.Signout(sessionId) +} + +func (c *defaultGraphClient) Execute(sessionId int64, stmt []byte) (types.ExecutionResponse, error) { + resp, err := c.graph.Execute(sessionId, stmt) + if err != nil { + return nil, err + } + + return &executionResponse{ExecutionResponse: resp}, nil +} + +func (c *defaultGraphClient) ExecuteJson(sessionId int64, stmt []byte) ([]byte, error) { + return c.graph.ExecuteJson(sessionId, stmt) +} + +func (c *defaultGraphClient) Close() error { + if c.graph != nil { + if err := c.graph.Close(); err != nil { + return err + } + } + return nil +} + +func (r *authResponse) ErrorCode() nerrors.ErrorCode { + return nerrors.ErrorCode(r.AuthResponse.ErrorCode) +} + +func (r *authResponse) ErrorMsg() string { + return string(r.AuthResponse.ErrorMsg) +} + +func (r *authResponse) SessionID() *int64 { + return r.AuthResponse.SessionID +} + +func (r *executionResponse) TODO() { + // TODO: the others +} diff --git a/ccore/nebula/internal/driver/v2_0_0/meta.go b/ccore/nebula/internal/driver/v2_0_0/meta.go new file mode 100644 index 0000000..c3855f0 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_0_0/meta.go @@ -0,0 +1,36 @@ +package v2_0_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + meta2_0_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.MetaClientDriver = (*defaultMetaClient)(nil) +) + +type ( + defaultMetaClient struct { + meta *meta2_0_0.MetaServiceClient + } +) + +func newMetaClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return &defaultMetaClient{ + meta: meta2_0_0.NewMetaServiceClientFactory(transport, pf), + } +} + +func (c *defaultMetaClient) Open() error { + return c.meta.Transport.Open() +} + +func (c *defaultMetaClient) Close() error{ + if c.meta != nil { + if err := c.meta.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_0_0/storage_admin.go b/ccore/nebula/internal/driver/v2_0_0/storage_admin.go new file mode 100644 index 0000000..5ec75e5 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_0_0/storage_admin.go @@ -0,0 +1,36 @@ +package v2_0_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + storage2_0_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/storage" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.StorageAdminClientDriver = (*defaultStorageAdminClient)(nil) +) + +type ( + defaultStorageAdminClient struct { + storageAdmin *storage2_0_0.StorageAdminServiceClient + } +) + +func newStorageAdminClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return &defaultStorageAdminClient{ + storageAdmin: storage2_0_0.NewStorageAdminServiceClientFactory(transport, pf), + } +} + +func (c *defaultStorageAdminClient) Open() error { + return c.storageAdmin.Transport.Open() +} + +func (c *defaultStorageAdminClient) Close() error{ + if c.storageAdmin != nil { + if err := c.storageAdmin.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_5_0/driver.go b/ccore/nebula/internal/driver/v2_5_0/driver.go new file mode 100644 index 0000000..7cbe0ee --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_0/driver.go @@ -0,0 +1,30 @@ +package v2_5_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.Driver = (*defaultDriver)(nil) +) + +type ( + defaultDriver struct {} +) + +func init(){ + types.Register(types.V2_5_0, &defaultDriver{}) +} + +func (d *defaultDriver) NewGraphClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return newGraphClient(transport, pf) +} + +func (d *defaultDriver) NewMetaClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return newMetaClient(transport, pf) +} + +func (d *defaultDriver) NewStorageClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return newStorageAdminClient(transport, pf) +} diff --git a/ccore/nebula/internal/driver/v2_5_0/graph.go b/ccore/nebula/internal/driver/v2_5_0/graph.go new file mode 100644 index 0000000..61f4fb1 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_0/graph.go @@ -0,0 +1,86 @@ +package v2_5_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" + graph2_5_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/graph" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.GraphClientDriver = (*defaultGraphClient)(nil) +) + +type ( + defaultGraphClient struct { + graph *graph2_5_0.GraphServiceClient + } + + authResponse struct { + *graph2_5_0.AuthResponse + } + + executionResponse struct { + *graph2_5_0.ExecutionResponse + } +) + +func newGraphClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return &defaultGraphClient{ + graph: graph2_5_0.NewGraphServiceClientFactory(transport, pf), + } +} + +func (c *defaultGraphClient) Open() error { + return c.graph.Open() +} + +func (c *defaultGraphClient) Authenticate(username, password string) (types.AuthResponse, error) { + resp, err := c.graph.Authenticate([]byte(username), []byte(password)) + if err != nil { + return nil, err + } + return &authResponse{AuthResponse: resp}, nil +} + +func (c *defaultGraphClient) Signout(sessionId int64) (err error) { + return c.graph.Signout(sessionId) +} + +func (c *defaultGraphClient) Execute(sessionId int64, stmt []byte) (types.ExecutionResponse, error) { + resp, err := c.graph.Execute(sessionId, stmt) + if err != nil { + return nil, err + } + + return &executionResponse{ExecutionResponse: resp}, nil +} + +func (c *defaultGraphClient) ExecuteJson(sessionId int64, stmt []byte) ([]byte, error) { + return c.graph.ExecuteJson(sessionId, stmt) +} + +func (c *defaultGraphClient) Close() error { + if c.graph != nil { + if err := c.graph.Close(); err != nil { + return err + } + } + return nil +} + +func (r *authResponse) ErrorCode() nerrors.ErrorCode { + return nerrors.ErrorCode(r.AuthResponse.ErrorCode) +} + +func (r *authResponse) ErrorMsg() string { + return string(r.AuthResponse.ErrorMsg) +} + +func (r *authResponse) SessionID() *int64 { + return r.AuthResponse.SessionID +} + +func (r *executionResponse) TODO() { + // TODO: the others +} diff --git a/ccore/nebula/internal/driver/v2_5_0/meta.go b/ccore/nebula/internal/driver/v2_5_0/meta.go new file mode 100644 index 0000000..f8abbb1 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_0/meta.go @@ -0,0 +1,36 @@ +package v2_5_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + meta2_5_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.MetaClientDriver = (*defaultMetaClient)(nil) +) + +type ( + defaultMetaClient struct { + meta *meta2_5_0.MetaServiceClient + } +) + +func newMetaClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return &defaultMetaClient{ + meta: meta2_5_0.NewMetaServiceClientFactory(transport, pf), + } +} + +func (c *defaultMetaClient) Open() error { + return c.meta.Open() +} + +func (c *defaultMetaClient) Close() error{ + if c.meta != nil { + if err := c.meta.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_5_0/storage_admin.go b/ccore/nebula/internal/driver/v2_5_0/storage_admin.go new file mode 100644 index 0000000..db77b01 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_0/storage_admin.go @@ -0,0 +1,36 @@ +package v2_5_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + storage2_5_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/storage" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.StorageAdminClientDriver = (*defaultStorageAdminClient)(nil) +) + +type ( + defaultStorageAdminClient struct { + storageAdmin *storage2_5_0.StorageAdminServiceClient + } +) + +func newStorageAdminClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return &defaultStorageAdminClient{ + storageAdmin: storage2_5_0.NewStorageAdminServiceClientFactory(transport, pf), + } +} + +func (c *defaultStorageAdminClient) Open() error { + return c.storageAdmin.Open() +} + +func (c *defaultStorageAdminClient) Close() error{ + if c.storageAdmin != nil { + if err := c.storageAdmin.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_5_1/driver.go b/ccore/nebula/internal/driver/v2_5_1/driver.go new file mode 100644 index 0000000..8d6749e --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_1/driver.go @@ -0,0 +1,30 @@ +package v2_5_1 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.Driver = (*defaultDriver)(nil) +) + +type ( + defaultDriver struct {} +) + +func init(){ + types.Register(types.V2_5_1, &defaultDriver{}) +} + +func (d *defaultDriver) NewGraphClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return newGraphClient(transport, pf) +} + +func (d *defaultDriver) NewMetaClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return newMetaClient(transport, pf) +} + +func (d *defaultDriver) NewStorageClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return newStorageAdminClient(transport, pf) +} diff --git a/ccore/nebula/internal/driver/v2_5_1/graph.go b/ccore/nebula/internal/driver/v2_5_1/graph.go new file mode 100644 index 0000000..32793b3 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_1/graph.go @@ -0,0 +1,86 @@ +package v2_5_1 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" + graph2_5_1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/graph" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.GraphClientDriver = (*defaultGraphClient)(nil) +) + +type ( + defaultGraphClient struct { + graph *graph2_5_1.GraphServiceClient + } + + authResponse struct { + *graph2_5_1.AuthResponse + } + + executionResponse struct { + *graph2_5_1.ExecutionResponse + } +) + +func newGraphClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return &defaultGraphClient{ + graph: graph2_5_1.NewGraphServiceClientFactory(transport, pf), + } +} + +func (c *defaultGraphClient) Open() error { + return c.graph.Open() +} + +func (c *defaultGraphClient) Authenticate(username, password string) (types.AuthResponse, error) { + resp, err := c.graph.Authenticate([]byte(username), []byte(password)) + if err != nil { + return nil, err + } + return &authResponse{AuthResponse: resp}, nil +} + +func (c *defaultGraphClient) Signout(sessionId int64) (err error) { + return c.graph.Signout(sessionId) +} + +func (c *defaultGraphClient) Execute(sessionId int64, stmt []byte) (types.ExecutionResponse, error) { + resp, err := c.graph.Execute(sessionId, stmt) + if err != nil { + return nil, err + } + + return &executionResponse{ExecutionResponse: resp}, nil +} + +func (c *defaultGraphClient) ExecuteJson(sessionId int64, stmt []byte) ([]byte, error) { + return c.graph.ExecuteJson(sessionId, stmt) +} + +func (c *defaultGraphClient) Close() error { + if c.graph != nil { + if err := c.graph.Close(); err != nil { + return err + } + } + return nil +} + +func (r *authResponse) ErrorCode() nerrors.ErrorCode { + return nerrors.ErrorCode(r.AuthResponse.ErrorCode) +} + +func (r *authResponse) ErrorMsg() string { + return string(r.AuthResponse.ErrorMsg) +} + +func (r *authResponse) SessionID() *int64 { + return r.AuthResponse.SessionID +} + +func (r *executionResponse) TODO() { + // TODO: the others +} diff --git a/ccore/nebula/internal/driver/v2_5_1/meta.go b/ccore/nebula/internal/driver/v2_5_1/meta.go new file mode 100644 index 0000000..39080b9 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_1/meta.go @@ -0,0 +1,36 @@ +package v2_5_1 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + meta2_5_1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.MetaClientDriver = (*defaultMetaClient)(nil) +) + +type ( + defaultMetaClient struct { + meta *meta2_5_1.MetaServiceClient + } +) + +func newMetaClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return &defaultMetaClient{ + meta: meta2_5_1.NewMetaServiceClientFactory(transport, pf), + } +} + +func (c *defaultMetaClient) Open() error { + return c.meta.Open() +} + +func (c *defaultMetaClient) Close() error{ + if c.meta != nil { + if err := c.meta.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_5_1/storage_admin.go b/ccore/nebula/internal/driver/v2_5_1/storage_admin.go new file mode 100644 index 0000000..2993dca --- /dev/null +++ b/ccore/nebula/internal/driver/v2_5_1/storage_admin.go @@ -0,0 +1,36 @@ +package v2_5_1 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + storage2_5_1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/storage" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.StorageAdminClientDriver = (*defaultStorageAdminClient)(nil) +) + +type ( + defaultStorageAdminClient struct { + storageAdmin *storage2_5_1.StorageAdminServiceClient + } +) + +func newStorageAdminClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return &defaultStorageAdminClient{ + storageAdmin: storage2_5_1.NewStorageAdminServiceClientFactory(transport, pf), + } +} + +func (c *defaultStorageAdminClient) Open() error { + return c.storageAdmin.Open() +} + +func (c *defaultStorageAdminClient) Close() error{ + if c.storageAdmin != nil { + if err := c.storageAdmin.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_6_0/driver.go b/ccore/nebula/internal/driver/v2_6_0/driver.go new file mode 100644 index 0000000..8772f2a --- /dev/null +++ b/ccore/nebula/internal/driver/v2_6_0/driver.go @@ -0,0 +1,30 @@ +package v2_6_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.Driver = (*defaultDriver)(nil) +) + +type ( + defaultDriver struct {} +) + +func init(){ + types.Register(types.V2_6_0, &defaultDriver{}) +} + +func (d *defaultDriver) NewGraphClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return newGraphClient(transport, pf) +} + +func (d *defaultDriver) NewMetaClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return newMetaClient(transport, pf) +} + +func (d *defaultDriver) NewStorageClientDriver(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return newStorageAdminClient(transport, pf) +} diff --git a/ccore/nebula/internal/driver/v2_6_0/graph.go b/ccore/nebula/internal/driver/v2_6_0/graph.go new file mode 100644 index 0000000..46440a7 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_6_0/graph.go @@ -0,0 +1,86 @@ +package v2_6_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" + graph2_6_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/graph" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.GraphClientDriver = (*defaultGraphClient)(nil) +) + +type ( + defaultGraphClient struct { + graph *graph2_6_0.GraphServiceClient + } + + authResponse struct { + *graph2_6_0.AuthResponse + } + + executionResponse struct { + *graph2_6_0.ExecutionResponse + } +) + +func newGraphClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.GraphClientDriver { + return &defaultGraphClient{ + graph: graph2_6_0.NewGraphServiceClientFactory(transport, pf), + } +} + +func (c *defaultGraphClient) Open() error { + return c.graph.Open() +} + +func (c *defaultGraphClient) Authenticate(username, password string) (types.AuthResponse, error) { + resp, err := c.graph.Authenticate([]byte(username), []byte(password)) + if err != nil { + return nil, err + } + return &authResponse{AuthResponse: resp}, nil +} + +func (c *defaultGraphClient) Signout(sessionId int64) (err error) { + return c.graph.Signout(sessionId) +} + +func (c *defaultGraphClient) Execute(sessionId int64, stmt []byte) (types.ExecutionResponse, error) { + resp, err := c.graph.Execute(sessionId, stmt) + if err != nil { + return nil, err + } + + return &executionResponse{ExecutionResponse: resp}, nil +} + +func (c *defaultGraphClient) ExecuteJson(sessionId int64, stmt []byte) ([]byte, error) { + return c.graph.ExecuteJson(sessionId, stmt) +} + +func (c *defaultGraphClient) Close() error{ + if c.graph != nil { + if err := c.graph.Close(); err != nil { + return err + } + } + return nil +} + +func (r *authResponse) ErrorCode() nerrors.ErrorCode { + return nerrors.ErrorCode(r.AuthResponse.ErrorCode) +} + +func (r *authResponse) ErrorMsg() string { + return string(r.AuthResponse.ErrorMsg) +} + +func (r *authResponse) SessionID() *int64 { + return r.AuthResponse.SessionID +} + +func (r *executionResponse) TODO() { + // TODO: the others +} diff --git a/ccore/nebula/internal/driver/v2_6_0/meta.go b/ccore/nebula/internal/driver/v2_6_0/meta.go new file mode 100644 index 0000000..e0c019f --- /dev/null +++ b/ccore/nebula/internal/driver/v2_6_0/meta.go @@ -0,0 +1,36 @@ +package v2_6_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + meta2_6_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.MetaClientDriver = (*defaultMetaClient)(nil) +) + +type ( + defaultMetaClient struct { + meta *meta2_6_0.MetaServiceClient + } +) + +func newMetaClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.MetaClientDriver { + return &defaultMetaClient{ + meta: meta2_6_0.NewMetaServiceClientFactory(transport, pf), + } +} + +func (c *defaultMetaClient) Open() error { + return c.meta.Open() +} + +func (c *defaultMetaClient) Close() error{ + if c.meta != nil { + if err := c.meta.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/driver/v2_6_0/storage_admin.go b/ccore/nebula/internal/driver/v2_6_0/storage_admin.go new file mode 100644 index 0000000..6b512b6 --- /dev/null +++ b/ccore/nebula/internal/driver/v2_6_0/storage_admin.go @@ -0,0 +1,36 @@ +package v2_6_0 + +import ( + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + storage2_6_0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/storage" + "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/types" +) + +var ( + _ types.StorageAdminClientDriver = (*defaultStorageAdminClient)(nil) +) + +type ( + defaultStorageAdminClient struct { + storageAdmin *storage2_6_0.StorageAdminServiceClient + } +) + +func newStorageAdminClient(transport thrift.Transport, pf thrift.ProtocolFactory) types.StorageAdminClientDriver { + return &defaultStorageAdminClient{ + storageAdmin: storage2_6_0.NewStorageAdminServiceClientFactory(transport, pf), + } +} + +func (c *defaultStorageAdminClient) Open() error { + return c.storageAdmin.Open() +} + +func (c *defaultStorageAdminClient) Close() error{ + if c.storageAdmin != nil { + if err := c.storageAdmin.Close(); err != nil { + return err + } + } + return nil +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/constants.go b/ccore/nebula/internal/thrift/v2_0_0/constants.go new file mode 100644 index 0000000..1e3bf0d --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/constants.go @@ -0,0 +1,23 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/graph/constants.go b/ccore/nebula/internal/thrift/v2_0_0/graph/constants.go new file mode 100644 index 0000000..2fc9bd8 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/graph/constants.go @@ -0,0 +1,26 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/graph/graph_service-remote/graph_service-remote.go b/ccore/nebula/internal/thrift/v2_0_0/graph/graph_service-remote/graph_service-remote.go new file mode 100755 index 0000000..f22e6e8 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/graph/graph_service-remote/graph_service-remote.go @@ -0,0 +1,186 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/graph" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AuthResponse authenticate(string username, string password)") + fmt.Fprintln(os.Stderr, " void signout(i64 sessionId)") + fmt.Fprintln(os.Stderr, " ExecutionResponse execute(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " string executeJson(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := graph.NewGraphServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "authenticate": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Authenticate requires 2 args") + flag.Usage() + } + argvalue0 := []byte(flag.Arg(1)) + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Authenticate(value0, value1)) + fmt.Print("\n") + break + case "signout": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Signout requires 1 args") + flag.Usage() + } + argvalue0, err25 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err25 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Signout(value0)) + fmt.Print("\n") + break + case "execute": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Execute requires 2 args") + flag.Usage() + } + argvalue0, err26 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err26 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Execute(value0, value1)) + fmt.Print("\n") + break + case "executeJson": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "ExecuteJson requires 2 args") + flag.Usage() + } + argvalue0, err28 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err28 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.ExecuteJson(value0, value1)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/graph/graphservice.go b/ccore/nebula/internal/thrift/v2_0_0/graph/graphservice.go new file mode 100644 index 0000000..a984ab5 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/graph/graphservice.go @@ -0,0 +1,1561 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +type GraphService interface { + // Parameters: + // - Username + // - Password + Authenticate(username []byte, password []byte) (r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(sessionId int64, stmt []byte) (r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(sessionId int64, stmt []byte) (r []byte, err error) +} + +type GraphServiceClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 +} + +func (client *GraphServiceClient) Close() error { + return client.Transport.Close() +} + +func NewGraphServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceClient { + return &GraphServiceClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGraphServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceClient { + return &GraphServiceClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceClient) Authenticate(username []byte, password []byte) (r *AuthResponse, err error) { + if err = p.sendAuthenticate(username, password); err != nil { return } + return p.recvAuthenticate() +} + +func (p *GraphServiceClient) sendAuthenticate(username []byte, password []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("authenticate", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceClient) recvAuthenticate() (value *AuthResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "authenticate" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "authenticate failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "authenticate failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error9 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error10 error + error10, err = error9.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error10 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "authenticate failed: invalid message type") + return + } + result := GraphServiceAuthenticateResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - SessionId +func (p *GraphServiceClient) Signout(sessionId int64) (err error) { + if err = p.sendSignout(sessionId); err != nil { return } + return +} + +func (p *GraphServiceClient) sendSignout(sessionId int64)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signout", thrift.ONEWAY, p.SeqId); err != nil { + return + } + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) Execute(sessionId int64, stmt []byte) (r *ExecutionResponse, err error) { + if err = p.sendExecute(sessionId, stmt); err != nil { return } + return p.recvExecute() +} + +func (p *GraphServiceClient) sendExecute(sessionId int64, stmt []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("execute", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceClient) recvExecute() (value *ExecutionResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "execute" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "execute failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "execute failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error11 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error12 error + error12, err = error11.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error12 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "execute failed: invalid message type") + return + } + result := GraphServiceExecuteResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) ExecuteJson(sessionId int64, stmt []byte) (r []byte, err error) { + if err = p.sendExecuteJson(sessionId, stmt); err != nil { return } + return p.recvExecuteJson() +} + +func (p *GraphServiceClient) sendExecuteJson(sessionId int64, stmt []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("executeJson", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceClient) recvExecuteJson() (value []byte, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "executeJson" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "executeJson failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "executeJson failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error13 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error14 error + error14, err = error13.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error14 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "executeJson failed: invalid message type") + return + } + result := GraphServiceExecuteJsonResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GraphServiceThreadsafeClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 + Mu sync.Mutex +} + +func NewGraphServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGraphServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +func (p *GraphServiceThreadsafeClient) Threadsafe() {} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceThreadsafeClient) Authenticate(username []byte, password []byte) (r *AuthResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAuthenticate(username, password); err != nil { return } + return p.recvAuthenticate() +} + +func (p *GraphServiceThreadsafeClient) sendAuthenticate(username []byte, password []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("authenticate", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceThreadsafeClient) recvAuthenticate() (value *AuthResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "authenticate" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "authenticate failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "authenticate failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error15 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error16 error + error16, err = error15.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error16 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "authenticate failed: invalid message type") + return + } + result := GraphServiceAuthenticateResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - SessionId +func (p *GraphServiceThreadsafeClient) Signout(sessionId int64) (err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendSignout(sessionId); err != nil { return } + return +} + +func (p *GraphServiceThreadsafeClient) sendSignout(sessionId int64)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signout", thrift.ONEWAY, p.SeqId); err != nil { + return + } + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) Execute(sessionId int64, stmt []byte) (r *ExecutionResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendExecute(sessionId, stmt); err != nil { return } + return p.recvExecute() +} + +func (p *GraphServiceThreadsafeClient) sendExecute(sessionId int64, stmt []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("execute", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceThreadsafeClient) recvExecute() (value *ExecutionResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "execute" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "execute failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "execute failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error17 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error18 error + error18, err = error17.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error18 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "execute failed: invalid message type") + return + } + result := GraphServiceExecuteResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) ExecuteJson(sessionId int64, stmt []byte) (r []byte, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendExecuteJson(sessionId, stmt); err != nil { return } + return p.recvExecuteJson() +} + +func (p *GraphServiceThreadsafeClient) sendExecuteJson(sessionId int64, stmt []byte)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("executeJson", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphServiceThreadsafeClient) recvExecuteJson() (value []byte, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "executeJson" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "executeJson failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "executeJson failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error19 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error20 error + error20, err = error19.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error20 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "executeJson failed: invalid message type") + return + } + result := GraphServiceExecuteJsonResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GraphServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunction + handler GraphService +} + +func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *GraphServiceProcessor) GetProcessorFunction(key string) (processor thrift.ProcessorFunction, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunction { + return p.processorMap +} + +func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { + self21 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunction)} + self21.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} + self21.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} + self21.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} + self21.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} + return self21 +} + +type graphServiceProcessorAuthenticate struct { + handler GraphService +} + +func (p *graphServiceProcessorAuthenticate) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceAuthenticateArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorAuthenticate) 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("authenticate", 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 *graphServiceProcessorAuthenticate) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceAuthenticateArgs) + var result GraphServiceAuthenticateResult + if retval, err := p.handler.Authenticate(args.Username, args.Password); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing authenticate: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorSignout struct { + handler GraphService +} + +func (p *graphServiceProcessorSignout) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceSignoutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorSignout) 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("signout", 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 *graphServiceProcessorSignout) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceSignoutArgs) + if err := p.handler.Signout(args.SessionId); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signout: " + err.Error()) + return x, x + } + } + return nil, nil +} + +type graphServiceProcessorExecute struct { + handler GraphService +} + +func (p *graphServiceProcessorExecute) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecute) 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("execute", 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 *graphServiceProcessorExecute) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteArgs) + var result GraphServiceExecuteResult + if retval, err := p.handler.Execute(args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing execute: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorExecuteJson struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJson) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteJsonArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecuteJson) 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("executeJson", 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 *graphServiceProcessorExecuteJson) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteJsonArgs) + var result GraphServiceExecuteJsonResult + if retval, err := p.handler.ExecuteJson(args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJson: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Username +// - Password +type GraphServiceAuthenticateArgs struct { + Username []byte `thrift:"username,1" db:"username" json:"username"` + Password []byte `thrift:"password,2" db:"password" json:"password"` +} + +func NewGraphServiceAuthenticateArgs() *GraphServiceAuthenticateArgs { + return &GraphServiceAuthenticateArgs{} +} + + +func (p *GraphServiceAuthenticateArgs) GetUsername() []byte { + return p.Username +} + +func (p *GraphServiceAuthenticateArgs) GetPassword() []byte { + return p.Password +} +func (p *GraphServiceAuthenticateArgs) 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 *GraphServiceAuthenticateArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Username = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Password = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 := 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 *GraphServiceAuthenticateArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("username", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:username: ", p), err) } + if err := oprot.WriteBinary(p.Username); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:username: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("password", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:password: ", p), err) } + if err := oprot.WriteBinary(p.Password); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:password: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceAuthenticateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceAuthenticateResult struct { + Success *AuthResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceAuthenticateResult() *GraphServiceAuthenticateResult { + return &GraphServiceAuthenticateResult{} +} + +var GraphServiceAuthenticateResult_Success_DEFAULT *AuthResponse +func (p *GraphServiceAuthenticateResult) GetSuccess() *AuthResponse { + if !p.IsSetSuccess() { + return GraphServiceAuthenticateResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceAuthenticateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAuthResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceAuthenticateResult(%+v)", *p) +} + +// Attributes: +// - SessionId +type GraphServiceSignoutArgs struct { + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` +} + +func NewGraphServiceSignoutArgs() *GraphServiceSignoutArgs { + return &GraphServiceSignoutArgs{} +} + + +func (p *GraphServiceSignoutArgs) GetSessionId() int64 { + return p.SessionId +} +func (p *GraphServiceSignoutArgs) 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 *GraphServiceSignoutArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceSignoutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signout_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 *GraphServiceSignoutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceSignoutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceSignoutArgs(%+v)", *p) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteArgs struct { + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteArgs() *GraphServiceExecuteArgs { + return &GraphServiceExecuteArgs{} +} + + +func (p *GraphServiceExecuteArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteArgs) 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 *GraphServiceExecuteArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 := 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 *GraphServiceExecuteArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceExecuteResult struct { + Success *ExecutionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteResult() *GraphServiceExecuteResult { + return &GraphServiceExecuteResult{} +} + +var GraphServiceExecuteResult_Success_DEFAULT *ExecutionResponse +func (p *GraphServiceExecuteResult) GetSuccess() *ExecutionResponse { + if !p.IsSetSuccess() { + return GraphServiceExecuteResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceExecuteResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecutionResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteResult(%+v)", *p) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteJsonArgs struct { + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteJsonArgs() *GraphServiceExecuteJsonArgs { + return &GraphServiceExecuteJsonArgs{} +} + + +func (p *GraphServiceExecuteJsonArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteJsonArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteJsonArgs) 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 *GraphServiceExecuteJsonArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 := 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 *GraphServiceExecuteJsonArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteJsonArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceExecuteJsonResult struct { + Success []byte `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteJsonResult() *GraphServiceExecuteJsonResult { + return &GraphServiceExecuteJsonResult{} +} + +var GraphServiceExecuteJsonResult_Success_DEFAULT []byte + +func (p *GraphServiceExecuteJsonResult) GetSuccess() []byte { + return p.Success +} +func (p *GraphServiceExecuteJsonResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphServiceExecuteJsonResult) 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 *GraphServiceExecuteJsonResult) ReadField0(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 *GraphServiceExecuteJsonResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteJsonResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteJsonResult(%+v)", *p) +} + + diff --git a/ccore/nebula/internal/thrift/v2_0_0/graph/ttypes.go b/ccore/nebula/internal/thrift/v2_0_0/graph/ttypes.go new file mode 100644 index 0000000..56a6c1c --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/graph/ttypes.go @@ -0,0 +1,1654 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_BAD_USERNAME_PASSWORD ErrorCode = -4 + ErrorCode_E_SESSION_INVALID ErrorCode = -5 + ErrorCode_E_SESSION_TIMEOUT ErrorCode = -6 + ErrorCode_E_SYNTAX_ERROR ErrorCode = -7 + ErrorCode_E_EXECUTION_ERROR ErrorCode = -8 + ErrorCode_E_STATEMENT_EMPTY ErrorCode = -9 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -10 + ErrorCode_E_BAD_PERMISSION ErrorCode = -11 + ErrorCode_E_SEMANTIC_ERROR ErrorCode = -12 + ErrorCode_E_TOO_MANY_CONNECTIONS ErrorCode = -13 + ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = -14 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAIL_TO_CONNECT: "E_FAIL_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_BAD_USERNAME_PASSWORD: "E_BAD_USERNAME_PASSWORD", + ErrorCode_E_SESSION_INVALID: "E_SESSION_INVALID", + ErrorCode_E_SESSION_TIMEOUT: "E_SESSION_TIMEOUT", + ErrorCode_E_SYNTAX_ERROR: "E_SYNTAX_ERROR", + ErrorCode_E_EXECUTION_ERROR: "E_EXECUTION_ERROR", + ErrorCode_E_STATEMENT_EMPTY: "E_STATEMENT_EMPTY", + ErrorCode_E_USER_NOT_FOUND: "E_USER_NOT_FOUND", + ErrorCode_E_BAD_PERMISSION: "E_BAD_PERMISSION", + ErrorCode_E_SEMANTIC_ERROR: "E_SEMANTIC_ERROR", + ErrorCode_E_TOO_MANY_CONNECTIONS: "E_TOO_MANY_CONNECTIONS", + ErrorCode_E_PARTIAL_SUCCEEDED: "E_PARTIAL_SUCCEEDED", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAIL_TO_CONNECT": ErrorCode_E_FAIL_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_BAD_USERNAME_PASSWORD": ErrorCode_E_BAD_USERNAME_PASSWORD, + "E_SESSION_INVALID": ErrorCode_E_SESSION_INVALID, + "E_SESSION_TIMEOUT": ErrorCode_E_SESSION_TIMEOUT, + "E_SYNTAX_ERROR": ErrorCode_E_SYNTAX_ERROR, + "E_EXECUTION_ERROR": ErrorCode_E_EXECUTION_ERROR, + "E_STATEMENT_EMPTY": ErrorCode_E_STATEMENT_EMPTY, + "E_USER_NOT_FOUND": ErrorCode_E_USER_NOT_FOUND, + "E_BAD_PERMISSION": ErrorCode_E_BAD_PERMISSION, + "E_SEMANTIC_ERROR": ErrorCode_E_SEMANTIC_ERROR, + "E_TOO_MANY_CONNECTIONS": ErrorCode_E_TOO_MANY_CONNECTIONS, + "E_PARTIAL_SUCCEEDED": ErrorCode_E_PARTIAL_SUCCEEDED, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +// Attributes: +// - Rows +// - ExecDurationInUs +// - TotalDurationInUs +// - OtherStats +type ProfilingStats struct { + Rows int64 `thrift:"rows,1,required" db:"rows" json:"rows"` + ExecDurationInUs int64 `thrift:"exec_duration_in_us,2,required" db:"exec_duration_in_us" json:"exec_duration_in_us"` + TotalDurationInUs int64 `thrift:"total_duration_in_us,3,required" db:"total_duration_in_us" json:"total_duration_in_us"` + OtherStats map[string][]byte `thrift:"other_stats,4" db:"other_stats" json:"other_stats,omitempty"` +} + +func NewProfilingStats() *ProfilingStats { + return &ProfilingStats{} +} + + +func (p *ProfilingStats) GetRows() int64 { + return p.Rows +} + +func (p *ProfilingStats) GetExecDurationInUs() int64 { + return p.ExecDurationInUs +} + +func (p *ProfilingStats) GetTotalDurationInUs() int64 { + return p.TotalDurationInUs +} +var ProfilingStats_OtherStats_DEFAULT map[string][]byte + +func (p *ProfilingStats) GetOtherStats() map[string][]byte { + return p.OtherStats +} +func (p *ProfilingStats) IsSetOtherStats() bool { + return p.OtherStats != nil +} + +func (p *ProfilingStats) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRows bool = false; + var issetExecDurationInUs bool = false; + var issetTotalDurationInUs 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 + } + issetRows = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetExecDurationInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTotalDurationInUs = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRows{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetExecDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExecDurationInUs is not set")); + } + if !issetTotalDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TotalDurationInUs is not set")); + } + return nil +} + +func (p *ProfilingStats) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Rows = v +} + return nil +} + +func (p *ProfilingStats) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExecDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TotalDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.OtherStats = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.OtherStats[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ProfilingStats) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ProfilingStats"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ProfilingStats) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:rows: ", p), err) } + if err := oprot.WriteI64(int64(p.Rows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:rows: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("exec_duration_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:exec_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.ExecDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.exec_duration_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:exec_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("total_duration_in_us", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:total_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.TotalDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_duration_in_us (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:total_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetOtherStats() { + if err := oprot.WriteFieldBegin("other_stats", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:other_stats: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.OtherStats)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.OtherStats { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:other_stats: ", p), err) } + } + return err +} + +func (p *ProfilingStats) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ProfilingStats(%+v)", *p) +} + +// Attributes: +// - IsDoBranch +// - ConditionNodeID +type PlanNodeBranchInfo struct { + IsDoBranch bool `thrift:"is_do_branch,1,required" db:"is_do_branch" json:"is_do_branch"` + ConditionNodeID int64 `thrift:"condition_node_id,2,required" db:"condition_node_id" json:"condition_node_id"` +} + +func NewPlanNodeBranchInfo() *PlanNodeBranchInfo { + return &PlanNodeBranchInfo{} +} + + +func (p *PlanNodeBranchInfo) GetIsDoBranch() bool { + return p.IsDoBranch +} + +func (p *PlanNodeBranchInfo) GetConditionNodeID() int64 { + return p.ConditionNodeID +} +func (p *PlanNodeBranchInfo) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetIsDoBranch bool = false; + var issetConditionNodeID 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 + } + issetIsDoBranch = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetConditionNodeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetIsDoBranch{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsDoBranch is not set")); + } + if !issetConditionNodeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ConditionNodeID is not set")); + } + return nil +} + +func (p *PlanNodeBranchInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.IsDoBranch = v +} + return nil +} + +func (p *PlanNodeBranchInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ConditionNodeID = v +} + return nil +} + +func (p *PlanNodeBranchInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeBranchInfo"); 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 *PlanNodeBranchInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_do_branch", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:is_do_branch: ", p), err) } + if err := oprot.WriteBool(bool(p.IsDoBranch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_do_branch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:is_do_branch: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("condition_node_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:condition_node_id: ", p), err) } + if err := oprot.WriteI64(int64(p.ConditionNodeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition_node_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:condition_node_id: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanNodeBranchInfo(%+v)", *p) +} + +// Attributes: +// - Key +// - Value +type Pair struct { + Key []byte `thrift:"key,1,required" db:"key" json:"key"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewPair() *Pair { + return &Pair{} +} + + +func (p *Pair) GetKey() []byte { + return p.Key +} + +func (p *Pair) GetValue() []byte { + return p.Value +} +func (p *Pair) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKey bool = false; + var issetValue 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 + } + issetKey = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetKey{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *Pair) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *Pair) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *Pair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Pair"); 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 *Pair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *Pair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *Pair) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Pair(%+v)", *p) +} + +// Attributes: +// - Name +// - Id +// - OutputVar +// - Description +// - Profiles +// - BranchInfo +// - Dependencies +type PlanNodeDescription struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Id int64 `thrift:"id,2,required" db:"id" json:"id"` + OutputVar []byte `thrift:"output_var,3,required" db:"output_var" json:"output_var"` + Description []*Pair `thrift:"description,4" db:"description" json:"description,omitempty"` + Profiles []*ProfilingStats `thrift:"profiles,5" db:"profiles" json:"profiles,omitempty"` + BranchInfo *PlanNodeBranchInfo `thrift:"branch_info,6" db:"branch_info" json:"branch_info,omitempty"` + Dependencies []int64 `thrift:"dependencies,7" db:"dependencies" json:"dependencies,omitempty"` +} + +func NewPlanNodeDescription() *PlanNodeDescription { + return &PlanNodeDescription{} +} + + +func (p *PlanNodeDescription) GetName() []byte { + return p.Name +} + +func (p *PlanNodeDescription) GetId() int64 { + return p.Id +} + +func (p *PlanNodeDescription) GetOutputVar() []byte { + return p.OutputVar +} +var PlanNodeDescription_Description_DEFAULT []*Pair + +func (p *PlanNodeDescription) GetDescription() []*Pair { + return p.Description +} +var PlanNodeDescription_Profiles_DEFAULT []*ProfilingStats + +func (p *PlanNodeDescription) GetProfiles() []*ProfilingStats { + return p.Profiles +} +var PlanNodeDescription_BranchInfo_DEFAULT *PlanNodeBranchInfo +func (p *PlanNodeDescription) GetBranchInfo() *PlanNodeBranchInfo { + if !p.IsSetBranchInfo() { + return PlanNodeDescription_BranchInfo_DEFAULT + } +return p.BranchInfo +} +var PlanNodeDescription_Dependencies_DEFAULT []int64 + +func (p *PlanNodeDescription) GetDependencies() []int64 { + return p.Dependencies +} +func (p *PlanNodeDescription) IsSetDescription() bool { + return p.Description != nil +} + +func (p *PlanNodeDescription) IsSetProfiles() bool { + return p.Profiles != nil +} + +func (p *PlanNodeDescription) IsSetBranchInfo() bool { + return p.BranchInfo != nil +} + +func (p *PlanNodeDescription) IsSetDependencies() bool { + return p.Dependencies != nil +} + +func (p *PlanNodeDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetId bool = false; + var issetOutputVar 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetId = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetOutputVar = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetId{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Id is not set")); + } + if !issetOutputVar{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OutputVar is not set")); + } + return nil +} + +func (p *PlanNodeDescription) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OutputVar = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Pair, 0, size) + p.Description = tSlice + for i := 0; i < size; i ++ { + _elem3 := NewPair() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Description = append(p.Description, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ProfilingStats, 0, size) + p.Profiles = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewProfilingStats() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Profiles = append(p.Profiles, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField6(iprot thrift.Protocol) error { + p.BranchInfo = NewPlanNodeBranchInfo() + if err := p.BranchInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BranchInfo), err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Dependencies = tSlice + for i := 0; i < size; i ++ { +var _elem5 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Dependencies = append(p.Dependencies, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeDescription"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeDescription) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("output_var", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:output_var: ", p), err) } + if err := oprot.WriteBinary(p.OutputVar); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.output_var (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:output_var: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetDescription() { + if err := oprot.WriteFieldBegin("description", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:description: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Description)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Description { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:description: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetProfiles() { + if err := oprot.WriteFieldBegin("profiles", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:profiles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Profiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Profiles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:profiles: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetBranchInfo() { + if err := oprot.WriteFieldBegin("branch_info", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:branch_info: ", p), err) } + if err := p.BranchInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BranchInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:branch_info: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetDependencies() { + if err := oprot.WriteFieldBegin("dependencies", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dependencies: ", p), err) } + if err := oprot.WriteListBegin(thrift.I64, len(p.Dependencies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dependencies { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dependencies: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanNodeDescription(%+v)", *p) +} + +// Attributes: +// - PlanNodeDescs +// - NodeIndexMap +// - Format +// - OptimizeTimeInUs +type PlanDescription struct { + PlanNodeDescs []*PlanNodeDescription `thrift:"plan_node_descs,1,required" db:"plan_node_descs" json:"plan_node_descs"` + NodeIndexMap map[int64]int64 `thrift:"node_index_map,2,required" db:"node_index_map" json:"node_index_map"` + Format []byte `thrift:"format,3,required" db:"format" json:"format"` + OptimizeTimeInUs int32 `thrift:"optimize_time_in_us,4,required" db:"optimize_time_in_us" json:"optimize_time_in_us"` +} + +func NewPlanDescription() *PlanDescription { + return &PlanDescription{} +} + + +func (p *PlanDescription) GetPlanNodeDescs() []*PlanNodeDescription { + return p.PlanNodeDescs +} + +func (p *PlanDescription) GetNodeIndexMap() map[int64]int64 { + return p.NodeIndexMap +} + +func (p *PlanDescription) GetFormat() []byte { + return p.Format +} + +func (p *PlanDescription) GetOptimizeTimeInUs() int32 { + return p.OptimizeTimeInUs +} +func (p *PlanDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPlanNodeDescs bool = false; + var issetNodeIndexMap bool = false; + var issetFormat bool = false; + var issetOptimizeTimeInUs 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 + } + issetPlanNodeDescs = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetNodeIndexMap = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetFormat = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetOptimizeTimeInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPlanNodeDescs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PlanNodeDescs is not set")); + } + if !issetNodeIndexMap{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NodeIndexMap is not set")); + } + if !issetFormat{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Format is not set")); + } + if !issetOptimizeTimeInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OptimizeTimeInUs is not set")); + } + return nil +} + +func (p *PlanDescription) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PlanNodeDescription, 0, size) + p.PlanNodeDescs = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewPlanNodeDescription() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.PlanNodeDescs = append(p.PlanNodeDescs, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int64]int64, size) + p.NodeIndexMap = tMap + for i := 0; i < size; i ++ { +var _key7 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} +var _val8 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val8 = v +} + p.NodeIndexMap[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Format = v +} + return nil +} + +func (p *PlanDescription) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OptimizeTimeInUs = v +} + return nil +} + +func (p *PlanDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanDescription"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanDescription) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("plan_node_descs", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:plan_node_descs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PlanNodeDescs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PlanNodeDescs { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:plan_node_descs: ", p), err) } + return err +} + +func (p *PlanDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node_index_map", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node_index_map: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.NodeIndexMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NodeIndexMap { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node_index_map: ", p), err) } + return err +} + +func (p *PlanDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("format", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:format: ", p), err) } + if err := oprot.WriteBinary(p.Format); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.format (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:format: ", p), err) } + return err +} + +func (p *PlanDescription) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("optimize_time_in_us", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:optimize_time_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.OptimizeTimeInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.optimize_time_in_us (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:optimize_time_in_us: ", p), err) } + return err +} + +func (p *PlanDescription) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanDescription(%+v)", *p) +} + +// Attributes: +// - ErrorCode +// - LatencyInUs +// - Data +// - SpaceName +// - ErrorMsg +// - PlanDesc +// - Comment +type ExecutionResponse struct { + ErrorCode ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + Data *nebula0.DataSet `thrift:"data,3" db:"data" json:"data,omitempty"` + SpaceName []byte `thrift:"space_name,4" db:"space_name" json:"space_name,omitempty"` + ErrorMsg []byte `thrift:"error_msg,5" db:"error_msg" json:"error_msg,omitempty"` + PlanDesc *PlanDescription `thrift:"plan_desc,6" db:"plan_desc" json:"plan_desc,omitempty"` + Comment []byte `thrift:"comment,7" db:"comment" json:"comment,omitempty"` +} + +func NewExecutionResponse() *ExecutionResponse { + return &ExecutionResponse{} +} + + +func (p *ExecutionResponse) GetErrorCode() ErrorCode { + return p.ErrorCode +} + +func (p *ExecutionResponse) GetLatencyInUs() int32 { + return p.LatencyInUs +} +var ExecutionResponse_Data_DEFAULT *nebula0.DataSet +func (p *ExecutionResponse) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return ExecutionResponse_Data_DEFAULT + } +return p.Data +} +var ExecutionResponse_SpaceName_DEFAULT []byte + +func (p *ExecutionResponse) GetSpaceName() []byte { + return p.SpaceName +} +var ExecutionResponse_ErrorMsg_DEFAULT []byte + +func (p *ExecutionResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var ExecutionResponse_PlanDesc_DEFAULT *PlanDescription +func (p *ExecutionResponse) GetPlanDesc() *PlanDescription { + if !p.IsSetPlanDesc() { + return ExecutionResponse_PlanDesc_DEFAULT + } +return p.PlanDesc +} +var ExecutionResponse_Comment_DEFAULT []byte + +func (p *ExecutionResponse) GetComment() []byte { + return p.Comment +} +func (p *ExecutionResponse) IsSetData() bool { + return p.Data != nil +} + +func (p *ExecutionResponse) IsSetSpaceName() bool { + return p.SpaceName != nil +} + +func (p *ExecutionResponse) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *ExecutionResponse) IsSetPlanDesc() bool { + return p.PlanDesc != nil +} + +func (p *ExecutionResponse) IsSetComment() bool { + return p.Comment != nil +} + +func (p *ExecutionResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + var issetLatencyInUs 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 + } + issetErrorCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ExecutionResponse) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.ErrorCode = temp +} + return nil +} + +func (p *ExecutionResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ExecutionResponse) ReadField3(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ExecutionResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *ExecutionResponse) ReadField6(iprot thrift.Protocol) error { + p.PlanDesc = NewPlanDescription() + if err := p.PlanDesc.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PlanDesc), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ExecutionResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecutionResponse"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecutionResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceName() { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_name: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_msg: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetPlanDesc() { + if err := oprot.WriteFieldBegin("plan_desc", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:plan_desc: ", p), err) } + if err := p.PlanDesc.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PlanDesc), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:plan_desc: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:comment: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecutionResponse(%+v)", *p) +} + +// Attributes: +// - ErrorCode +// - ErrorMsg +// - SessionID +type AuthResponse struct { + ErrorCode ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + ErrorMsg []byte `thrift:"error_msg,2" db:"error_msg" json:"error_msg,omitempty"` + SessionID *int64 `thrift:"session_id,3" db:"session_id" json:"session_id,omitempty"` +} + +func NewAuthResponse() *AuthResponse { + return &AuthResponse{} +} + + +func (p *AuthResponse) GetErrorCode() ErrorCode { + return p.ErrorCode +} +var AuthResponse_ErrorMsg_DEFAULT []byte + +func (p *AuthResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var AuthResponse_SessionID_DEFAULT int64 +func (p *AuthResponse) GetSessionID() int64 { + if !p.IsSetSessionID() { + return AuthResponse_SessionID_DEFAULT + } +return *p.SessionID +} +func (p *AuthResponse) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *AuthResponse) IsSetSessionID() bool { + return p.SessionID != nil +} + +func (p *AuthResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode 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 + } + issetErrorCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *AuthResponse) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.ErrorCode = temp +} + return nil +} + +func (p *AuthResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *AuthResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SessionID = &v +} + return nil +} + +func (p *AuthResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AuthResponse"); 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 *AuthResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *AuthResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session_id: ", p), err) } + } + return err +} + +func (p *AuthResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuthResponse(%+v)", *p) +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/meta/constants.go b/ccore/nebula/internal/thrift/v2_0_0/meta/constants.go new file mode 100644 index 0000000..0caac21 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/meta/constants.go @@ -0,0 +1,26 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/meta/meta_service-remote/meta_service-remote.go b/ccore/nebula/internal/thrift/v2_0_0/meta/meta_service-remote/meta_service-remote.go new file mode 100755 index 0000000..fda2db0 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/meta/meta_service-remote/meta_service-remote.go @@ -0,0 +1,2256 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResp createSpace(CreateSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSpace(DropSpaceReq req)") + fmt.Fprintln(os.Stderr, " GetSpaceResp getSpace(GetSpaceReq req)") + fmt.Fprintln(os.Stderr, " ListSpacesResp listSpaces(ListSpacesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTag(CreateTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterTag(AlterTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTag(DropTagReq req)") + fmt.Fprintln(os.Stderr, " GetTagResp getTag(GetTagReq req)") + fmt.Fprintln(os.Stderr, " ListTagsResp listTags(ListTagsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdge(CreateEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterEdge(AlterEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdge(DropEdgeReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeResp getEdge(GetEdgeReq req)") + fmt.Fprintln(os.Stderr, " ListEdgesResp listEdges(ListEdgesReq req)") + fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") + fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") + fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp multiPut(MultiPutReq req)") + fmt.Fprintln(os.Stderr, " GetResp get(GetReq req)") + fmt.Fprintln(os.Stderr, " MultiGetResp multiGet(MultiGetReq req)") + fmt.Fprintln(os.Stderr, " ExecResp remove(RemoveReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeRange(RemoveRangeReq req)") + fmt.Fprintln(os.Stderr, " ScanResp scan(ScanReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTagIndex(CreateTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTagIndex(DropTagIndexReq req)") + fmt.Fprintln(os.Stderr, " GetTagIndexResp getTagIndex(GetTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ListTagIndexesResp listTagIndexes(ListTagIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildTagIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listTagIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdgeIndex(CreateEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdgeIndex(DropEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeIndexResp getEdgeIndex(GetEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ListEdgeIndexesResp listEdgeIndexes(ListEdgeIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildEdgeIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listEdgeIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createUser(CreateUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropUser(DropUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterUser(AlterUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp grantRole(GrantRoleReq req)") + fmt.Fprintln(os.Stderr, " ExecResp revokeRole(RevokeRoleReq req)") + fmt.Fprintln(os.Stderr, " ListUsersResp listUsers(ListUsersReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp listRoles(ListRolesReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp getUserRoles(GetUserRolesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp changePassword(ChangePasswordReq req)") + fmt.Fprintln(os.Stderr, " HBResp heartBeat(HBReq req)") + fmt.Fprintln(os.Stderr, " BalanceResp balance(BalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp leaderBalance(LeaderBalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp regConfig(RegConfigReq req)") + fmt.Fprintln(os.Stderr, " GetConfigResp getConfig(GetConfigReq req)") + fmt.Fprintln(os.Stderr, " ExecResp setConfig(SetConfigReq req)") + fmt.Fprintln(os.Stderr, " ListConfigsResp listConfigs(ListConfigsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createSnapshot(CreateSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSnapshot(DropSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ListSnapshotsResp listSnapshots(ListSnapshotsReq req)") + fmt.Fprintln(os.Stderr, " AdminJobResp runAdminJob(AdminJobReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZone(AddZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostIntoZone(AddHostIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHostFromZone(DropHostFromZoneReq req)") + fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") + fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addGroup(AddGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropGroup(DropGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZoneIntoGroup(AddZoneIntoGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZoneFromGroup(DropZoneFromGroupReq req)") + fmt.Fprintln(os.Stderr, " GetGroupResp getGroup(GetGroupReq req)") + fmt.Fprintln(os.Stderr, " ListGroupsResp listGroups(ListGroupsReq req)") + fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp restoreMeta(RestoreMetaReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addListener(AddListenerReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeListener(RemoveListenerReq req)") + fmt.Fprintln(os.Stderr, " ListListenerResp listListener(ListListenerReq req)") + fmt.Fprintln(os.Stderr, " GetStatisResp getStatis(GetStatisReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signInFTService(SignInFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signOutFTService(SignOutFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ListFTClientsResp listFTClients(ListFTClientsReq req)") + fmt.Fprintln(os.Stderr, " CreateSessionResp createSession(CreateSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp updateSessions(UpdateSessionsReq req)") + fmt.Fprintln(os.Stderr, " ListSessionsResp listSessions(ListSessionsReq req)") + fmt.Fprintln(os.Stderr, " GetSessionResp getSession(GetSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeSession(RemoveSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp reportTaskFinish(ReportTaskReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := meta.NewMetaServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "createSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") + flag.Usage() + } + arg407 := flag.Arg(1) + mbTrans408 := thrift.NewMemoryBufferLen(len(arg407)) + defer mbTrans408.Close() + _, err409 := mbTrans408.WriteString(arg407) + if err409 != nil { + Usage() + return + } + factory410 := thrift.NewSimpleJSONProtocolFactory() + jsProt411 := factory410.GetProtocol(mbTrans408) + argvalue0 := meta.NewCreateSpaceReq() + err412 := argvalue0.Read(jsProt411) + if err412 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpace(value0)) + fmt.Print("\n") + break + case "dropSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") + flag.Usage() + } + arg413 := flag.Arg(1) + mbTrans414 := thrift.NewMemoryBufferLen(len(arg413)) + defer mbTrans414.Close() + _, err415 := mbTrans414.WriteString(arg413) + if err415 != nil { + Usage() + return + } + factory416 := thrift.NewSimpleJSONProtocolFactory() + jsProt417 := factory416.GetProtocol(mbTrans414) + argvalue0 := meta.NewDropSpaceReq() + err418 := argvalue0.Read(jsProt417) + if err418 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSpace(value0)) + fmt.Print("\n") + break + case "getSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") + flag.Usage() + } + arg419 := flag.Arg(1) + mbTrans420 := thrift.NewMemoryBufferLen(len(arg419)) + defer mbTrans420.Close() + _, err421 := mbTrans420.WriteString(arg419) + if err421 != nil { + Usage() + return + } + factory422 := thrift.NewSimpleJSONProtocolFactory() + jsProt423 := factory422.GetProtocol(mbTrans420) + argvalue0 := meta.NewGetSpaceReq() + err424 := argvalue0.Read(jsProt423) + if err424 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSpace(value0)) + fmt.Print("\n") + break + case "listSpaces": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") + flag.Usage() + } + arg425 := flag.Arg(1) + mbTrans426 := thrift.NewMemoryBufferLen(len(arg425)) + defer mbTrans426.Close() + _, err427 := mbTrans426.WriteString(arg425) + if err427 != nil { + Usage() + return + } + factory428 := thrift.NewSimpleJSONProtocolFactory() + jsProt429 := factory428.GetProtocol(mbTrans426) + argvalue0 := meta.NewListSpacesReq() + err430 := argvalue0.Read(jsProt429) + if err430 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSpaces(value0)) + fmt.Print("\n") + break + case "createTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") + flag.Usage() + } + arg431 := flag.Arg(1) + mbTrans432 := thrift.NewMemoryBufferLen(len(arg431)) + defer mbTrans432.Close() + _, err433 := mbTrans432.WriteString(arg431) + if err433 != nil { + Usage() + return + } + factory434 := thrift.NewSimpleJSONProtocolFactory() + jsProt435 := factory434.GetProtocol(mbTrans432) + argvalue0 := meta.NewCreateTagReq() + err436 := argvalue0.Read(jsProt435) + if err436 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTag(value0)) + fmt.Print("\n") + break + case "alterTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") + flag.Usage() + } + arg437 := flag.Arg(1) + mbTrans438 := thrift.NewMemoryBufferLen(len(arg437)) + defer mbTrans438.Close() + _, err439 := mbTrans438.WriteString(arg437) + if err439 != nil { + Usage() + return + } + factory440 := thrift.NewSimpleJSONProtocolFactory() + jsProt441 := factory440.GetProtocol(mbTrans438) + argvalue0 := meta.NewAlterTagReq() + err442 := argvalue0.Read(jsProt441) + if err442 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterTag(value0)) + fmt.Print("\n") + break + case "dropTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTag requires 1 args") + flag.Usage() + } + arg443 := flag.Arg(1) + mbTrans444 := thrift.NewMemoryBufferLen(len(arg443)) + defer mbTrans444.Close() + _, err445 := mbTrans444.WriteString(arg443) + if err445 != nil { + Usage() + return + } + factory446 := thrift.NewSimpleJSONProtocolFactory() + jsProt447 := factory446.GetProtocol(mbTrans444) + argvalue0 := meta.NewDropTagReq() + err448 := argvalue0.Read(jsProt447) + if err448 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTag(value0)) + fmt.Print("\n") + break + case "getTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTag requires 1 args") + flag.Usage() + } + arg449 := flag.Arg(1) + mbTrans450 := thrift.NewMemoryBufferLen(len(arg449)) + defer mbTrans450.Close() + _, err451 := mbTrans450.WriteString(arg449) + if err451 != nil { + Usage() + return + } + factory452 := thrift.NewSimpleJSONProtocolFactory() + jsProt453 := factory452.GetProtocol(mbTrans450) + argvalue0 := meta.NewGetTagReq() + err454 := argvalue0.Read(jsProt453) + if err454 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTag(value0)) + fmt.Print("\n") + break + case "listTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTags requires 1 args") + flag.Usage() + } + arg455 := flag.Arg(1) + mbTrans456 := thrift.NewMemoryBufferLen(len(arg455)) + defer mbTrans456.Close() + _, err457 := mbTrans456.WriteString(arg455) + if err457 != nil { + Usage() + return + } + factory458 := thrift.NewSimpleJSONProtocolFactory() + jsProt459 := factory458.GetProtocol(mbTrans456) + argvalue0 := meta.NewListTagsReq() + err460 := argvalue0.Read(jsProt459) + if err460 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTags(value0)) + fmt.Print("\n") + break + case "createEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") + flag.Usage() + } + arg461 := flag.Arg(1) + mbTrans462 := thrift.NewMemoryBufferLen(len(arg461)) + defer mbTrans462.Close() + _, err463 := mbTrans462.WriteString(arg461) + if err463 != nil { + Usage() + return + } + factory464 := thrift.NewSimpleJSONProtocolFactory() + jsProt465 := factory464.GetProtocol(mbTrans462) + argvalue0 := meta.NewCreateEdgeReq() + err466 := argvalue0.Read(jsProt465) + if err466 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdge(value0)) + fmt.Print("\n") + break + case "alterEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") + flag.Usage() + } + arg467 := flag.Arg(1) + mbTrans468 := thrift.NewMemoryBufferLen(len(arg467)) + defer mbTrans468.Close() + _, err469 := mbTrans468.WriteString(arg467) + if err469 != nil { + Usage() + return + } + factory470 := thrift.NewSimpleJSONProtocolFactory() + jsProt471 := factory470.GetProtocol(mbTrans468) + argvalue0 := meta.NewAlterEdgeReq() + err472 := argvalue0.Read(jsProt471) + if err472 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterEdge(value0)) + fmt.Print("\n") + break + case "dropEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") + flag.Usage() + } + arg473 := flag.Arg(1) + mbTrans474 := thrift.NewMemoryBufferLen(len(arg473)) + defer mbTrans474.Close() + _, err475 := mbTrans474.WriteString(arg473) + if err475 != nil { + Usage() + return + } + factory476 := thrift.NewSimpleJSONProtocolFactory() + jsProt477 := factory476.GetProtocol(mbTrans474) + argvalue0 := meta.NewDropEdgeReq() + err478 := argvalue0.Read(jsProt477) + if err478 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdge(value0)) + fmt.Print("\n") + break + case "getEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") + flag.Usage() + } + arg479 := flag.Arg(1) + mbTrans480 := thrift.NewMemoryBufferLen(len(arg479)) + defer mbTrans480.Close() + _, err481 := mbTrans480.WriteString(arg479) + if err481 != nil { + Usage() + return + } + factory482 := thrift.NewSimpleJSONProtocolFactory() + jsProt483 := factory482.GetProtocol(mbTrans480) + argvalue0 := meta.NewGetEdgeReq() + err484 := argvalue0.Read(jsProt483) + if err484 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdge(value0)) + fmt.Print("\n") + break + case "listEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") + flag.Usage() + } + arg485 := flag.Arg(1) + mbTrans486 := thrift.NewMemoryBufferLen(len(arg485)) + defer mbTrans486.Close() + _, err487 := mbTrans486.WriteString(arg485) + if err487 != nil { + Usage() + return + } + factory488 := thrift.NewSimpleJSONProtocolFactory() + jsProt489 := factory488.GetProtocol(mbTrans486) + argvalue0 := meta.NewListEdgesReq() + err490 := argvalue0.Read(jsProt489) + if err490 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdges(value0)) + fmt.Print("\n") + break + case "listHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") + flag.Usage() + } + arg491 := flag.Arg(1) + mbTrans492 := thrift.NewMemoryBufferLen(len(arg491)) + defer mbTrans492.Close() + _, err493 := mbTrans492.WriteString(arg491) + if err493 != nil { + Usage() + return + } + factory494 := thrift.NewSimpleJSONProtocolFactory() + jsProt495 := factory494.GetProtocol(mbTrans492) + argvalue0 := meta.NewListHostsReq() + err496 := argvalue0.Read(jsProt495) + if err496 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListHosts(value0)) + fmt.Print("\n") + break + case "getPartsAlloc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") + flag.Usage() + } + arg497 := flag.Arg(1) + mbTrans498 := thrift.NewMemoryBufferLen(len(arg497)) + defer mbTrans498.Close() + _, err499 := mbTrans498.WriteString(arg497) + if err499 != nil { + Usage() + return + } + factory500 := thrift.NewSimpleJSONProtocolFactory() + jsProt501 := factory500.GetProtocol(mbTrans498) + argvalue0 := meta.NewGetPartsAllocReq() + err502 := argvalue0.Read(jsProt501) + if err502 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPartsAlloc(value0)) + fmt.Print("\n") + break + case "listParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListParts requires 1 args") + flag.Usage() + } + arg503 := flag.Arg(1) + mbTrans504 := thrift.NewMemoryBufferLen(len(arg503)) + defer mbTrans504.Close() + _, err505 := mbTrans504.WriteString(arg503) + if err505 != nil { + Usage() + return + } + factory506 := thrift.NewSimpleJSONProtocolFactory() + jsProt507 := factory506.GetProtocol(mbTrans504) + argvalue0 := meta.NewListPartsReq() + err508 := argvalue0.Read(jsProt507) + if err508 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListParts(value0)) + fmt.Print("\n") + break + case "multiPut": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") + flag.Usage() + } + arg509 := flag.Arg(1) + mbTrans510 := thrift.NewMemoryBufferLen(len(arg509)) + defer mbTrans510.Close() + _, err511 := mbTrans510.WriteString(arg509) + if err511 != nil { + Usage() + return + } + factory512 := thrift.NewSimpleJSONProtocolFactory() + jsProt513 := factory512.GetProtocol(mbTrans510) + argvalue0 := meta.NewMultiPutReq() + err514 := argvalue0.Read(jsProt513) + if err514 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiPut(value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg515 := flag.Arg(1) + mbTrans516 := thrift.NewMemoryBufferLen(len(arg515)) + defer mbTrans516.Close() + _, err517 := mbTrans516.WriteString(arg515) + if err517 != nil { + Usage() + return + } + factory518 := thrift.NewSimpleJSONProtocolFactory() + jsProt519 := factory518.GetProtocol(mbTrans516) + argvalue0 := meta.NewGetReq() + err520 := argvalue0.Read(jsProt519) + if err520 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "multiGet": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") + flag.Usage() + } + arg521 := flag.Arg(1) + mbTrans522 := thrift.NewMemoryBufferLen(len(arg521)) + defer mbTrans522.Close() + _, err523 := mbTrans522.WriteString(arg521) + if err523 != nil { + Usage() + return + } + factory524 := thrift.NewSimpleJSONProtocolFactory() + jsProt525 := factory524.GetProtocol(mbTrans522) + argvalue0 := meta.NewMultiGetReq() + err526 := argvalue0.Read(jsProt525) + if err526 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiGet(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg527 := flag.Arg(1) + mbTrans528 := thrift.NewMemoryBufferLen(len(arg527)) + defer mbTrans528.Close() + _, err529 := mbTrans528.WriteString(arg527) + if err529 != nil { + Usage() + return + } + factory530 := thrift.NewSimpleJSONProtocolFactory() + jsProt531 := factory530.GetProtocol(mbTrans528) + argvalue0 := meta.NewRemoveReq() + err532 := argvalue0.Read(jsProt531) + if err532 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "removeRange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveRange requires 1 args") + flag.Usage() + } + arg533 := flag.Arg(1) + mbTrans534 := thrift.NewMemoryBufferLen(len(arg533)) + defer mbTrans534.Close() + _, err535 := mbTrans534.WriteString(arg533) + if err535 != nil { + Usage() + return + } + factory536 := thrift.NewSimpleJSONProtocolFactory() + jsProt537 := factory536.GetProtocol(mbTrans534) + argvalue0 := meta.NewRemoveRangeReq() + err538 := argvalue0.Read(jsProt537) + if err538 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveRange(value0)) + fmt.Print("\n") + break + case "scan": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Scan requires 1 args") + flag.Usage() + } + arg539 := flag.Arg(1) + mbTrans540 := thrift.NewMemoryBufferLen(len(arg539)) + defer mbTrans540.Close() + _, err541 := mbTrans540.WriteString(arg539) + if err541 != nil { + Usage() + return + } + factory542 := thrift.NewSimpleJSONProtocolFactory() + jsProt543 := factory542.GetProtocol(mbTrans540) + argvalue0 := meta.NewScanReq() + err544 := argvalue0.Read(jsProt543) + if err544 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Scan(value0)) + fmt.Print("\n") + break + case "createTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") + flag.Usage() + } + arg545 := flag.Arg(1) + mbTrans546 := thrift.NewMemoryBufferLen(len(arg545)) + defer mbTrans546.Close() + _, err547 := mbTrans546.WriteString(arg545) + if err547 != nil { + Usage() + return + } + factory548 := thrift.NewSimpleJSONProtocolFactory() + jsProt549 := factory548.GetProtocol(mbTrans546) + argvalue0 := meta.NewCreateTagIndexReq() + err550 := argvalue0.Read(jsProt549) + if err550 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTagIndex(value0)) + fmt.Print("\n") + break + case "dropTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") + flag.Usage() + } + arg551 := flag.Arg(1) + mbTrans552 := thrift.NewMemoryBufferLen(len(arg551)) + defer mbTrans552.Close() + _, err553 := mbTrans552.WriteString(arg551) + if err553 != nil { + Usage() + return + } + factory554 := thrift.NewSimpleJSONProtocolFactory() + jsProt555 := factory554.GetProtocol(mbTrans552) + argvalue0 := meta.NewDropTagIndexReq() + err556 := argvalue0.Read(jsProt555) + if err556 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTagIndex(value0)) + fmt.Print("\n") + break + case "getTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") + flag.Usage() + } + arg557 := flag.Arg(1) + mbTrans558 := thrift.NewMemoryBufferLen(len(arg557)) + defer mbTrans558.Close() + _, err559 := mbTrans558.WriteString(arg557) + if err559 != nil { + Usage() + return + } + factory560 := thrift.NewSimpleJSONProtocolFactory() + jsProt561 := factory560.GetProtocol(mbTrans558) + argvalue0 := meta.NewGetTagIndexReq() + err562 := argvalue0.Read(jsProt561) + if err562 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") + flag.Usage() + } + arg563 := flag.Arg(1) + mbTrans564 := thrift.NewMemoryBufferLen(len(arg563)) + defer mbTrans564.Close() + _, err565 := mbTrans564.WriteString(arg563) + if err565 != nil { + Usage() + return + } + factory566 := thrift.NewSimpleJSONProtocolFactory() + jsProt567 := factory566.GetProtocol(mbTrans564) + argvalue0 := meta.NewListTagIndexesReq() + err568 := argvalue0.Read(jsProt567) + if err568 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexes(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg569 := flag.Arg(1) + mbTrans570 := thrift.NewMemoryBufferLen(len(arg569)) + defer mbTrans570.Close() + _, err571 := mbTrans570.WriteString(arg569) + if err571 != nil { + Usage() + return + } + factory572 := thrift.NewSimpleJSONProtocolFactory() + jsProt573 := factory572.GetProtocol(mbTrans570) + argvalue0 := meta.NewRebuildIndexReq() + err574 := argvalue0.Read(jsProt573) + if err574 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") + flag.Usage() + } + arg575 := flag.Arg(1) + mbTrans576 := thrift.NewMemoryBufferLen(len(arg575)) + defer mbTrans576.Close() + _, err577 := mbTrans576.WriteString(arg575) + if err577 != nil { + Usage() + return + } + factory578 := thrift.NewSimpleJSONProtocolFactory() + jsProt579 := factory578.GetProtocol(mbTrans576) + argvalue0 := meta.NewListIndexStatusReq() + err580 := argvalue0.Read(jsProt579) + if err580 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexStatus(value0)) + fmt.Print("\n") + break + case "createEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") + flag.Usage() + } + arg581 := flag.Arg(1) + mbTrans582 := thrift.NewMemoryBufferLen(len(arg581)) + defer mbTrans582.Close() + _, err583 := mbTrans582.WriteString(arg581) + if err583 != nil { + Usage() + return + } + factory584 := thrift.NewSimpleJSONProtocolFactory() + jsProt585 := factory584.GetProtocol(mbTrans582) + argvalue0 := meta.NewCreateEdgeIndexReq() + err586 := argvalue0.Read(jsProt585) + if err586 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdgeIndex(value0)) + fmt.Print("\n") + break + case "dropEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") + flag.Usage() + } + arg587 := flag.Arg(1) + mbTrans588 := thrift.NewMemoryBufferLen(len(arg587)) + defer mbTrans588.Close() + _, err589 := mbTrans588.WriteString(arg587) + if err589 != nil { + Usage() + return + } + factory590 := thrift.NewSimpleJSONProtocolFactory() + jsProt591 := factory590.GetProtocol(mbTrans588) + argvalue0 := meta.NewDropEdgeIndexReq() + err592 := argvalue0.Read(jsProt591) + if err592 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdgeIndex(value0)) + fmt.Print("\n") + break + case "getEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") + flag.Usage() + } + arg593 := flag.Arg(1) + mbTrans594 := thrift.NewMemoryBufferLen(len(arg593)) + defer mbTrans594.Close() + _, err595 := mbTrans594.WriteString(arg593) + if err595 != nil { + Usage() + return + } + factory596 := thrift.NewSimpleJSONProtocolFactory() + jsProt597 := factory596.GetProtocol(mbTrans594) + argvalue0 := meta.NewGetEdgeIndexReq() + err598 := argvalue0.Read(jsProt597) + if err598 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") + flag.Usage() + } + arg599 := flag.Arg(1) + mbTrans600 := thrift.NewMemoryBufferLen(len(arg599)) + defer mbTrans600.Close() + _, err601 := mbTrans600.WriteString(arg599) + if err601 != nil { + Usage() + return + } + factory602 := thrift.NewSimpleJSONProtocolFactory() + jsProt603 := factory602.GetProtocol(mbTrans600) + argvalue0 := meta.NewListEdgeIndexesReq() + err604 := argvalue0.Read(jsProt603) + if err604 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexes(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg605 := flag.Arg(1) + mbTrans606 := thrift.NewMemoryBufferLen(len(arg605)) + defer mbTrans606.Close() + _, err607 := mbTrans606.WriteString(arg605) + if err607 != nil { + Usage() + return + } + factory608 := thrift.NewSimpleJSONProtocolFactory() + jsProt609 := factory608.GetProtocol(mbTrans606) + argvalue0 := meta.NewRebuildIndexReq() + err610 := argvalue0.Read(jsProt609) + if err610 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") + flag.Usage() + } + arg611 := flag.Arg(1) + mbTrans612 := thrift.NewMemoryBufferLen(len(arg611)) + defer mbTrans612.Close() + _, err613 := mbTrans612.WriteString(arg611) + if err613 != nil { + Usage() + return + } + factory614 := thrift.NewSimpleJSONProtocolFactory() + jsProt615 := factory614.GetProtocol(mbTrans612) + argvalue0 := meta.NewListIndexStatusReq() + err616 := argvalue0.Read(jsProt615) + if err616 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexStatus(value0)) + fmt.Print("\n") + break + case "createUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") + flag.Usage() + } + arg617 := flag.Arg(1) + mbTrans618 := thrift.NewMemoryBufferLen(len(arg617)) + defer mbTrans618.Close() + _, err619 := mbTrans618.WriteString(arg617) + if err619 != nil { + Usage() + return + } + factory620 := thrift.NewSimpleJSONProtocolFactory() + jsProt621 := factory620.GetProtocol(mbTrans618) + argvalue0 := meta.NewCreateUserReq() + err622 := argvalue0.Read(jsProt621) + if err622 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateUser(value0)) + fmt.Print("\n") + break + case "dropUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropUser requires 1 args") + flag.Usage() + } + arg623 := flag.Arg(1) + mbTrans624 := thrift.NewMemoryBufferLen(len(arg623)) + defer mbTrans624.Close() + _, err625 := mbTrans624.WriteString(arg623) + if err625 != nil { + Usage() + return + } + factory626 := thrift.NewSimpleJSONProtocolFactory() + jsProt627 := factory626.GetProtocol(mbTrans624) + argvalue0 := meta.NewDropUserReq() + err628 := argvalue0.Read(jsProt627) + if err628 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropUser(value0)) + fmt.Print("\n") + break + case "alterUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") + flag.Usage() + } + arg629 := flag.Arg(1) + mbTrans630 := thrift.NewMemoryBufferLen(len(arg629)) + defer mbTrans630.Close() + _, err631 := mbTrans630.WriteString(arg629) + if err631 != nil { + Usage() + return + } + factory632 := thrift.NewSimpleJSONProtocolFactory() + jsProt633 := factory632.GetProtocol(mbTrans630) + argvalue0 := meta.NewAlterUserReq() + err634 := argvalue0.Read(jsProt633) + if err634 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterUser(value0)) + fmt.Print("\n") + break + case "grantRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") + flag.Usage() + } + arg635 := flag.Arg(1) + mbTrans636 := thrift.NewMemoryBufferLen(len(arg635)) + defer mbTrans636.Close() + _, err637 := mbTrans636.WriteString(arg635) + if err637 != nil { + Usage() + return + } + factory638 := thrift.NewSimpleJSONProtocolFactory() + jsProt639 := factory638.GetProtocol(mbTrans636) + argvalue0 := meta.NewGrantRoleReq() + err640 := argvalue0.Read(jsProt639) + if err640 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GrantRole(value0)) + fmt.Print("\n") + break + case "revokeRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") + flag.Usage() + } + arg641 := flag.Arg(1) + mbTrans642 := thrift.NewMemoryBufferLen(len(arg641)) + defer mbTrans642.Close() + _, err643 := mbTrans642.WriteString(arg641) + if err643 != nil { + Usage() + return + } + factory644 := thrift.NewSimpleJSONProtocolFactory() + jsProt645 := factory644.GetProtocol(mbTrans642) + argvalue0 := meta.NewRevokeRoleReq() + err646 := argvalue0.Read(jsProt645) + if err646 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RevokeRole(value0)) + fmt.Print("\n") + break + case "listUsers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") + flag.Usage() + } + arg647 := flag.Arg(1) + mbTrans648 := thrift.NewMemoryBufferLen(len(arg647)) + defer mbTrans648.Close() + _, err649 := mbTrans648.WriteString(arg647) + if err649 != nil { + Usage() + return + } + factory650 := thrift.NewSimpleJSONProtocolFactory() + jsProt651 := factory650.GetProtocol(mbTrans648) + argvalue0 := meta.NewListUsersReq() + err652 := argvalue0.Read(jsProt651) + if err652 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListUsers(value0)) + fmt.Print("\n") + break + case "listRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") + flag.Usage() + } + arg653 := flag.Arg(1) + mbTrans654 := thrift.NewMemoryBufferLen(len(arg653)) + defer mbTrans654.Close() + _, err655 := mbTrans654.WriteString(arg653) + if err655 != nil { + Usage() + return + } + factory656 := thrift.NewSimpleJSONProtocolFactory() + jsProt657 := factory656.GetProtocol(mbTrans654) + argvalue0 := meta.NewListRolesReq() + err658 := argvalue0.Read(jsProt657) + if err658 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListRoles(value0)) + fmt.Print("\n") + break + case "getUserRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") + flag.Usage() + } + arg659 := flag.Arg(1) + mbTrans660 := thrift.NewMemoryBufferLen(len(arg659)) + defer mbTrans660.Close() + _, err661 := mbTrans660.WriteString(arg659) + if err661 != nil { + Usage() + return + } + factory662 := thrift.NewSimpleJSONProtocolFactory() + jsProt663 := factory662.GetProtocol(mbTrans660) + argvalue0 := meta.NewGetUserRolesReq() + err664 := argvalue0.Read(jsProt663) + if err664 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUserRoles(value0)) + fmt.Print("\n") + break + case "changePassword": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") + flag.Usage() + } + arg665 := flag.Arg(1) + mbTrans666 := thrift.NewMemoryBufferLen(len(arg665)) + defer mbTrans666.Close() + _, err667 := mbTrans666.WriteString(arg665) + if err667 != nil { + Usage() + return + } + factory668 := thrift.NewSimpleJSONProtocolFactory() + jsProt669 := factory668.GetProtocol(mbTrans666) + argvalue0 := meta.NewChangePasswordReq() + err670 := argvalue0.Read(jsProt669) + if err670 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChangePassword(value0)) + fmt.Print("\n") + break + case "heartBeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") + flag.Usage() + } + arg671 := flag.Arg(1) + mbTrans672 := thrift.NewMemoryBufferLen(len(arg671)) + defer mbTrans672.Close() + _, err673 := mbTrans672.WriteString(arg671) + if err673 != nil { + Usage() + return + } + factory674 := thrift.NewSimpleJSONProtocolFactory() + jsProt675 := factory674.GetProtocol(mbTrans672) + argvalue0 := meta.NewHBReq() + err676 := argvalue0.Read(jsProt675) + if err676 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.HeartBeat(value0)) + fmt.Print("\n") + break + case "balance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Balance requires 1 args") + flag.Usage() + } + arg677 := flag.Arg(1) + mbTrans678 := thrift.NewMemoryBufferLen(len(arg677)) + defer mbTrans678.Close() + _, err679 := mbTrans678.WriteString(arg677) + if err679 != nil { + Usage() + return + } + factory680 := thrift.NewSimpleJSONProtocolFactory() + jsProt681 := factory680.GetProtocol(mbTrans678) + argvalue0 := meta.NewBalanceReq() + err682 := argvalue0.Read(jsProt681) + if err682 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Balance(value0)) + fmt.Print("\n") + break + case "leaderBalance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LeaderBalance requires 1 args") + flag.Usage() + } + arg683 := flag.Arg(1) + mbTrans684 := thrift.NewMemoryBufferLen(len(arg683)) + defer mbTrans684.Close() + _, err685 := mbTrans684.WriteString(arg683) + if err685 != nil { + Usage() + return + } + factory686 := thrift.NewSimpleJSONProtocolFactory() + jsProt687 := factory686.GetProtocol(mbTrans684) + argvalue0 := meta.NewLeaderBalanceReq() + err688 := argvalue0.Read(jsProt687) + if err688 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LeaderBalance(value0)) + fmt.Print("\n") + break + case "regConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") + flag.Usage() + } + arg689 := flag.Arg(1) + mbTrans690 := thrift.NewMemoryBufferLen(len(arg689)) + defer mbTrans690.Close() + _, err691 := mbTrans690.WriteString(arg689) + if err691 != nil { + Usage() + return + } + factory692 := thrift.NewSimpleJSONProtocolFactory() + jsProt693 := factory692.GetProtocol(mbTrans690) + argvalue0 := meta.NewRegConfigReq() + err694 := argvalue0.Read(jsProt693) + if err694 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RegConfig(value0)) + fmt.Print("\n") + break + case "getConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") + flag.Usage() + } + arg695 := flag.Arg(1) + mbTrans696 := thrift.NewMemoryBufferLen(len(arg695)) + defer mbTrans696.Close() + _, err697 := mbTrans696.WriteString(arg695) + if err697 != nil { + Usage() + return + } + factory698 := thrift.NewSimpleJSONProtocolFactory() + jsProt699 := factory698.GetProtocol(mbTrans696) + argvalue0 := meta.NewGetConfigReq() + err700 := argvalue0.Read(jsProt699) + if err700 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetConfig(value0)) + fmt.Print("\n") + break + case "setConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") + flag.Usage() + } + arg701 := flag.Arg(1) + mbTrans702 := thrift.NewMemoryBufferLen(len(arg701)) + defer mbTrans702.Close() + _, err703 := mbTrans702.WriteString(arg701) + if err703 != nil { + Usage() + return + } + factory704 := thrift.NewSimpleJSONProtocolFactory() + jsProt705 := factory704.GetProtocol(mbTrans702) + argvalue0 := meta.NewSetConfigReq() + err706 := argvalue0.Read(jsProt705) + if err706 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetConfig(value0)) + fmt.Print("\n") + break + case "listConfigs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") + flag.Usage() + } + arg707 := flag.Arg(1) + mbTrans708 := thrift.NewMemoryBufferLen(len(arg707)) + defer mbTrans708.Close() + _, err709 := mbTrans708.WriteString(arg707) + if err709 != nil { + Usage() + return + } + factory710 := thrift.NewSimpleJSONProtocolFactory() + jsProt711 := factory710.GetProtocol(mbTrans708) + argvalue0 := meta.NewListConfigsReq() + err712 := argvalue0.Read(jsProt711) + if err712 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListConfigs(value0)) + fmt.Print("\n") + break + case "createSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") + flag.Usage() + } + arg713 := flag.Arg(1) + mbTrans714 := thrift.NewMemoryBufferLen(len(arg713)) + defer mbTrans714.Close() + _, err715 := mbTrans714.WriteString(arg713) + if err715 != nil { + Usage() + return + } + factory716 := thrift.NewSimpleJSONProtocolFactory() + jsProt717 := factory716.GetProtocol(mbTrans714) + argvalue0 := meta.NewCreateSnapshotReq() + err718 := argvalue0.Read(jsProt717) + if err718 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSnapshot(value0)) + fmt.Print("\n") + break + case "dropSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") + flag.Usage() + } + arg719 := flag.Arg(1) + mbTrans720 := thrift.NewMemoryBufferLen(len(arg719)) + defer mbTrans720.Close() + _, err721 := mbTrans720.WriteString(arg719) + if err721 != nil { + Usage() + return + } + factory722 := thrift.NewSimpleJSONProtocolFactory() + jsProt723 := factory722.GetProtocol(mbTrans720) + argvalue0 := meta.NewDropSnapshotReq() + err724 := argvalue0.Read(jsProt723) + if err724 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSnapshot(value0)) + fmt.Print("\n") + break + case "listSnapshots": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") + flag.Usage() + } + arg725 := flag.Arg(1) + mbTrans726 := thrift.NewMemoryBufferLen(len(arg725)) + defer mbTrans726.Close() + _, err727 := mbTrans726.WriteString(arg725) + if err727 != nil { + Usage() + return + } + factory728 := thrift.NewSimpleJSONProtocolFactory() + jsProt729 := factory728.GetProtocol(mbTrans726) + argvalue0 := meta.NewListSnapshotsReq() + err730 := argvalue0.Read(jsProt729) + if err730 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSnapshots(value0)) + fmt.Print("\n") + break + case "runAdminJob": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") + flag.Usage() + } + arg731 := flag.Arg(1) + mbTrans732 := thrift.NewMemoryBufferLen(len(arg731)) + defer mbTrans732.Close() + _, err733 := mbTrans732.WriteString(arg731) + if err733 != nil { + Usage() + return + } + factory734 := thrift.NewSimpleJSONProtocolFactory() + jsProt735 := factory734.GetProtocol(mbTrans732) + argvalue0 := meta.NewAdminJobReq() + err736 := argvalue0.Read(jsProt735) + if err736 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RunAdminJob(value0)) + fmt.Print("\n") + break + case "addZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZone requires 1 args") + flag.Usage() + } + arg737 := flag.Arg(1) + mbTrans738 := thrift.NewMemoryBufferLen(len(arg737)) + defer mbTrans738.Close() + _, err739 := mbTrans738.WriteString(arg737) + if err739 != nil { + Usage() + return + } + factory740 := thrift.NewSimpleJSONProtocolFactory() + jsProt741 := factory740.GetProtocol(mbTrans738) + argvalue0 := meta.NewAddZoneReq() + err742 := argvalue0.Read(jsProt741) + if err742 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZone(value0)) + fmt.Print("\n") + break + case "dropZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZone requires 1 args") + flag.Usage() + } + arg743 := flag.Arg(1) + mbTrans744 := thrift.NewMemoryBufferLen(len(arg743)) + defer mbTrans744.Close() + _, err745 := mbTrans744.WriteString(arg743) + if err745 != nil { + Usage() + return + } + factory746 := thrift.NewSimpleJSONProtocolFactory() + jsProt747 := factory746.GetProtocol(mbTrans744) + argvalue0 := meta.NewDropZoneReq() + err748 := argvalue0.Read(jsProt747) + if err748 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZone(value0)) + fmt.Print("\n") + break + case "addHostIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostIntoZone requires 1 args") + flag.Usage() + } + arg749 := flag.Arg(1) + mbTrans750 := thrift.NewMemoryBufferLen(len(arg749)) + defer mbTrans750.Close() + _, err751 := mbTrans750.WriteString(arg749) + if err751 != nil { + Usage() + return + } + factory752 := thrift.NewSimpleJSONProtocolFactory() + jsProt753 := factory752.GetProtocol(mbTrans750) + argvalue0 := meta.NewAddHostIntoZoneReq() + err754 := argvalue0.Read(jsProt753) + if err754 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostIntoZone(value0)) + fmt.Print("\n") + break + case "dropHostFromZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHostFromZone requires 1 args") + flag.Usage() + } + arg755 := flag.Arg(1) + mbTrans756 := thrift.NewMemoryBufferLen(len(arg755)) + defer mbTrans756.Close() + _, err757 := mbTrans756.WriteString(arg755) + if err757 != nil { + Usage() + return + } + factory758 := thrift.NewSimpleJSONProtocolFactory() + jsProt759 := factory758.GetProtocol(mbTrans756) + argvalue0 := meta.NewDropHostFromZoneReq() + err760 := argvalue0.Read(jsProt759) + if err760 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHostFromZone(value0)) + fmt.Print("\n") + break + case "getZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetZone requires 1 args") + flag.Usage() + } + arg761 := flag.Arg(1) + mbTrans762 := thrift.NewMemoryBufferLen(len(arg761)) + defer mbTrans762.Close() + _, err763 := mbTrans762.WriteString(arg761) + if err763 != nil { + Usage() + return + } + factory764 := thrift.NewSimpleJSONProtocolFactory() + jsProt765 := factory764.GetProtocol(mbTrans762) + argvalue0 := meta.NewGetZoneReq() + err766 := argvalue0.Read(jsProt765) + if err766 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetZone(value0)) + fmt.Print("\n") + break + case "listZones": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListZones requires 1 args") + flag.Usage() + } + arg767 := flag.Arg(1) + mbTrans768 := thrift.NewMemoryBufferLen(len(arg767)) + defer mbTrans768.Close() + _, err769 := mbTrans768.WriteString(arg767) + if err769 != nil { + Usage() + return + } + factory770 := thrift.NewSimpleJSONProtocolFactory() + jsProt771 := factory770.GetProtocol(mbTrans768) + argvalue0 := meta.NewListZonesReq() + err772 := argvalue0.Read(jsProt771) + if err772 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListZones(value0)) + fmt.Print("\n") + break + case "addGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddGroup requires 1 args") + flag.Usage() + } + arg773 := flag.Arg(1) + mbTrans774 := thrift.NewMemoryBufferLen(len(arg773)) + defer mbTrans774.Close() + _, err775 := mbTrans774.WriteString(arg773) + if err775 != nil { + Usage() + return + } + factory776 := thrift.NewSimpleJSONProtocolFactory() + jsProt777 := factory776.GetProtocol(mbTrans774) + argvalue0 := meta.NewAddGroupReq() + err778 := argvalue0.Read(jsProt777) + if err778 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddGroup(value0)) + fmt.Print("\n") + break + case "dropGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropGroup requires 1 args") + flag.Usage() + } + arg779 := flag.Arg(1) + mbTrans780 := thrift.NewMemoryBufferLen(len(arg779)) + defer mbTrans780.Close() + _, err781 := mbTrans780.WriteString(arg779) + if err781 != nil { + Usage() + return + } + factory782 := thrift.NewSimpleJSONProtocolFactory() + jsProt783 := factory782.GetProtocol(mbTrans780) + argvalue0 := meta.NewDropGroupReq() + err784 := argvalue0.Read(jsProt783) + if err784 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropGroup(value0)) + fmt.Print("\n") + break + case "addZoneIntoGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZoneIntoGroup requires 1 args") + flag.Usage() + } + arg785 := flag.Arg(1) + mbTrans786 := thrift.NewMemoryBufferLen(len(arg785)) + defer mbTrans786.Close() + _, err787 := mbTrans786.WriteString(arg785) + if err787 != nil { + Usage() + return + } + factory788 := thrift.NewSimpleJSONProtocolFactory() + jsProt789 := factory788.GetProtocol(mbTrans786) + argvalue0 := meta.NewAddZoneIntoGroupReq() + err790 := argvalue0.Read(jsProt789) + if err790 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZoneIntoGroup(value0)) + fmt.Print("\n") + break + case "dropZoneFromGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZoneFromGroup requires 1 args") + flag.Usage() + } + arg791 := flag.Arg(1) + mbTrans792 := thrift.NewMemoryBufferLen(len(arg791)) + defer mbTrans792.Close() + _, err793 := mbTrans792.WriteString(arg791) + if err793 != nil { + Usage() + return + } + factory794 := thrift.NewSimpleJSONProtocolFactory() + jsProt795 := factory794.GetProtocol(mbTrans792) + argvalue0 := meta.NewDropZoneFromGroupReq() + err796 := argvalue0.Read(jsProt795) + if err796 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZoneFromGroup(value0)) + fmt.Print("\n") + break + case "getGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetGroup requires 1 args") + flag.Usage() + } + arg797 := flag.Arg(1) + mbTrans798 := thrift.NewMemoryBufferLen(len(arg797)) + defer mbTrans798.Close() + _, err799 := mbTrans798.WriteString(arg797) + if err799 != nil { + Usage() + return + } + factory800 := thrift.NewSimpleJSONProtocolFactory() + jsProt801 := factory800.GetProtocol(mbTrans798) + argvalue0 := meta.NewGetGroupReq() + err802 := argvalue0.Read(jsProt801) + if err802 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetGroup(value0)) + fmt.Print("\n") + break + case "listGroups": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListGroups requires 1 args") + flag.Usage() + } + arg803 := flag.Arg(1) + mbTrans804 := thrift.NewMemoryBufferLen(len(arg803)) + defer mbTrans804.Close() + _, err805 := mbTrans804.WriteString(arg803) + if err805 != nil { + Usage() + return + } + factory806 := thrift.NewSimpleJSONProtocolFactory() + jsProt807 := factory806.GetProtocol(mbTrans804) + argvalue0 := meta.NewListGroupsReq() + err808 := argvalue0.Read(jsProt807) + if err808 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListGroups(value0)) + fmt.Print("\n") + break + case "createBackup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") + flag.Usage() + } + arg809 := flag.Arg(1) + mbTrans810 := thrift.NewMemoryBufferLen(len(arg809)) + defer mbTrans810.Close() + _, err811 := mbTrans810.WriteString(arg809) + if err811 != nil { + Usage() + return + } + factory812 := thrift.NewSimpleJSONProtocolFactory() + jsProt813 := factory812.GetProtocol(mbTrans810) + argvalue0 := meta.NewCreateBackupReq() + err814 := argvalue0.Read(jsProt813) + if err814 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateBackup(value0)) + fmt.Print("\n") + break + case "restoreMeta": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") + flag.Usage() + } + arg815 := flag.Arg(1) + mbTrans816 := thrift.NewMemoryBufferLen(len(arg815)) + defer mbTrans816.Close() + _, err817 := mbTrans816.WriteString(arg815) + if err817 != nil { + Usage() + return + } + factory818 := thrift.NewSimpleJSONProtocolFactory() + jsProt819 := factory818.GetProtocol(mbTrans816) + argvalue0 := meta.NewRestoreMetaReq() + err820 := argvalue0.Read(jsProt819) + if err820 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RestoreMeta(value0)) + fmt.Print("\n") + break + case "addListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddListener requires 1 args") + flag.Usage() + } + arg821 := flag.Arg(1) + mbTrans822 := thrift.NewMemoryBufferLen(len(arg821)) + defer mbTrans822.Close() + _, err823 := mbTrans822.WriteString(arg821) + if err823 != nil { + Usage() + return + } + factory824 := thrift.NewSimpleJSONProtocolFactory() + jsProt825 := factory824.GetProtocol(mbTrans822) + argvalue0 := meta.NewAddListenerReq() + err826 := argvalue0.Read(jsProt825) + if err826 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddListener(value0)) + fmt.Print("\n") + break + case "removeListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") + flag.Usage() + } + arg827 := flag.Arg(1) + mbTrans828 := thrift.NewMemoryBufferLen(len(arg827)) + defer mbTrans828.Close() + _, err829 := mbTrans828.WriteString(arg827) + if err829 != nil { + Usage() + return + } + factory830 := thrift.NewSimpleJSONProtocolFactory() + jsProt831 := factory830.GetProtocol(mbTrans828) + argvalue0 := meta.NewRemoveListenerReq() + err832 := argvalue0.Read(jsProt831) + if err832 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveListener(value0)) + fmt.Print("\n") + break + case "listListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListListener requires 1 args") + flag.Usage() + } + arg833 := flag.Arg(1) + mbTrans834 := thrift.NewMemoryBufferLen(len(arg833)) + defer mbTrans834.Close() + _, err835 := mbTrans834.WriteString(arg833) + if err835 != nil { + Usage() + return + } + factory836 := thrift.NewSimpleJSONProtocolFactory() + jsProt837 := factory836.GetProtocol(mbTrans834) + argvalue0 := meta.NewListListenerReq() + err838 := argvalue0.Read(jsProt837) + if err838 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListListener(value0)) + fmt.Print("\n") + break + case "getStatis": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetStatis requires 1 args") + flag.Usage() + } + arg839 := flag.Arg(1) + mbTrans840 := thrift.NewMemoryBufferLen(len(arg839)) + defer mbTrans840.Close() + _, err841 := mbTrans840.WriteString(arg839) + if err841 != nil { + Usage() + return + } + factory842 := thrift.NewSimpleJSONProtocolFactory() + jsProt843 := factory842.GetProtocol(mbTrans840) + argvalue0 := meta.NewGetStatisReq() + err844 := argvalue0.Read(jsProt843) + if err844 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetStatis(value0)) + fmt.Print("\n") + break + case "signInFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignInFTService requires 1 args") + flag.Usage() + } + arg845 := flag.Arg(1) + mbTrans846 := thrift.NewMemoryBufferLen(len(arg845)) + defer mbTrans846.Close() + _, err847 := mbTrans846.WriteString(arg845) + if err847 != nil { + Usage() + return + } + factory848 := thrift.NewSimpleJSONProtocolFactory() + jsProt849 := factory848.GetProtocol(mbTrans846) + argvalue0 := meta.NewSignInFTServiceReq() + err850 := argvalue0.Read(jsProt849) + if err850 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignInFTService(value0)) + fmt.Print("\n") + break + case "signOutFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignOutFTService requires 1 args") + flag.Usage() + } + arg851 := flag.Arg(1) + mbTrans852 := thrift.NewMemoryBufferLen(len(arg851)) + defer mbTrans852.Close() + _, err853 := mbTrans852.WriteString(arg851) + if err853 != nil { + Usage() + return + } + factory854 := thrift.NewSimpleJSONProtocolFactory() + jsProt855 := factory854.GetProtocol(mbTrans852) + argvalue0 := meta.NewSignOutFTServiceReq() + err856 := argvalue0.Read(jsProt855) + if err856 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignOutFTService(value0)) + fmt.Print("\n") + break + case "listFTClients": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTClients requires 1 args") + flag.Usage() + } + arg857 := flag.Arg(1) + mbTrans858 := thrift.NewMemoryBufferLen(len(arg857)) + defer mbTrans858.Close() + _, err859 := mbTrans858.WriteString(arg857) + if err859 != nil { + Usage() + return + } + factory860 := thrift.NewSimpleJSONProtocolFactory() + jsProt861 := factory860.GetProtocol(mbTrans858) + argvalue0 := meta.NewListFTClientsReq() + err862 := argvalue0.Read(jsProt861) + if err862 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTClients(value0)) + fmt.Print("\n") + break + case "createSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") + flag.Usage() + } + arg863 := flag.Arg(1) + mbTrans864 := thrift.NewMemoryBufferLen(len(arg863)) + defer mbTrans864.Close() + _, err865 := mbTrans864.WriteString(arg863) + if err865 != nil { + Usage() + return + } + factory866 := thrift.NewSimpleJSONProtocolFactory() + jsProt867 := factory866.GetProtocol(mbTrans864) + argvalue0 := meta.NewCreateSessionReq() + err868 := argvalue0.Read(jsProt867) + if err868 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSession(value0)) + fmt.Print("\n") + break + case "updateSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") + flag.Usage() + } + arg869 := flag.Arg(1) + mbTrans870 := thrift.NewMemoryBufferLen(len(arg869)) + defer mbTrans870.Close() + _, err871 := mbTrans870.WriteString(arg869) + if err871 != nil { + Usage() + return + } + factory872 := thrift.NewSimpleJSONProtocolFactory() + jsProt873 := factory872.GetProtocol(mbTrans870) + argvalue0 := meta.NewUpdateSessionsReq() + err874 := argvalue0.Read(jsProt873) + if err874 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateSessions(value0)) + fmt.Print("\n") + break + case "listSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") + flag.Usage() + } + arg875 := flag.Arg(1) + mbTrans876 := thrift.NewMemoryBufferLen(len(arg875)) + defer mbTrans876.Close() + _, err877 := mbTrans876.WriteString(arg875) + if err877 != nil { + Usage() + return + } + factory878 := thrift.NewSimpleJSONProtocolFactory() + jsProt879 := factory878.GetProtocol(mbTrans876) + argvalue0 := meta.NewListSessionsReq() + err880 := argvalue0.Read(jsProt879) + if err880 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSessions(value0)) + fmt.Print("\n") + break + case "getSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSession requires 1 args") + flag.Usage() + } + arg881 := flag.Arg(1) + mbTrans882 := thrift.NewMemoryBufferLen(len(arg881)) + defer mbTrans882.Close() + _, err883 := mbTrans882.WriteString(arg881) + if err883 != nil { + Usage() + return + } + factory884 := thrift.NewSimpleJSONProtocolFactory() + jsProt885 := factory884.GetProtocol(mbTrans882) + argvalue0 := meta.NewGetSessionReq() + err886 := argvalue0.Read(jsProt885) + if err886 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSession(value0)) + fmt.Print("\n") + break + case "removeSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") + flag.Usage() + } + arg887 := flag.Arg(1) + mbTrans888 := thrift.NewMemoryBufferLen(len(arg887)) + defer mbTrans888.Close() + _, err889 := mbTrans888.WriteString(arg887) + if err889 != nil { + Usage() + return + } + factory890 := thrift.NewSimpleJSONProtocolFactory() + jsProt891 := factory890.GetProtocol(mbTrans888) + argvalue0 := meta.NewRemoveSessionReq() + err892 := argvalue0.Read(jsProt891) + if err892 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveSession(value0)) + fmt.Print("\n") + break + case "reportTaskFinish": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") + flag.Usage() + } + arg893 := flag.Arg(1) + mbTrans894 := thrift.NewMemoryBufferLen(len(arg893)) + defer mbTrans894.Close() + _, err895 := mbTrans894.WriteString(arg893) + if err895 != nil { + Usage() + return + } + factory896 := thrift.NewSimpleJSONProtocolFactory() + jsProt897 := factory896.GetProtocol(mbTrans894) + argvalue0 := meta.NewReportTaskReq() + err898 := argvalue0.Read(jsProt897) + if err898 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ReportTaskFinish(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/meta/metaservice.go b/ccore/nebula/internal/thrift/v2_0_0/meta/metaservice.go new file mode 100644 index 0000000..9724ca2 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/meta/metaservice.go @@ -0,0 +1,32095 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +type MetaService interface { + // Parameters: + // - Req + CreateSpace(req *CreateSpaceReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(req *DropSpaceReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(req *GetSpaceReq) (r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(req *ListSpacesReq) (r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateTag(req *CreateTagReq) (r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(req *AlterTagReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropTag(req *DropTagReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetTag(req *GetTagReq) (r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(req *ListTagsReq) (r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(req *CreateEdgeReq) (r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(req *AlterEdgeReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(req *DropEdgeReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(req *GetEdgeReq) (r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(req *ListEdgesReq) (r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(req *ListHostsReq) (r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(req *GetPartsAllocReq) (r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(req *ListPartsReq) (r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(req *MultiPutReq) (r *ExecResp, err error) + // Parameters: + // - Req + Get(req *GetReq) (r *GetResp, err error) + // Parameters: + // - Req + MultiGet(req *MultiGetReq) (r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(req *RemoveReq) (r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(req *RemoveRangeReq) (r *ExecResp, err error) + // Parameters: + // - Req + Scan(req *ScanReq) (r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(req *CreateTagIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(req *DropTagIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(req *GetTagIndexReq) (r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(req *ListTagIndexesReq) (r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(req *CreateEdgeIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(req *DropEdgeIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(req *GetEdgeIndexReq) (r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(req *ListEdgeIndexesReq) (r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(req *CreateUserReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropUser(req *DropUserReq) (r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(req *AlterUserReq) (r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(req *GrantRoleReq) (r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(req *RevokeRoleReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(req *ListUsersReq) (r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(req *ListRolesReq) (r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(req *GetUserRolesReq) (r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(req *ChangePasswordReq) (r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(req *HBReq) (r *HBResp, err error) + // Parameters: + // - Req + Balance(req *BalanceReq) (r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(req *LeaderBalanceReq) (r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(req *RegConfigReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(req *GetConfigReq) (r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(req *SetConfigReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(req *ListConfigsReq) (r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(req *CreateSnapshotReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(req *DropSnapshotReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(req *ListSnapshotsReq) (r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(req *AdminJobReq) (r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(req *AddZoneReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropZone(req *DropZoneReq) (r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(req *AddHostIntoZoneReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(req *DropHostFromZoneReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetZone(req *GetZoneReq) (r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(req *ListZonesReq) (r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(req *AddGroupReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(req *DropGroupReq) (r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(req *AddZoneIntoGroupReq) (r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(req *DropZoneFromGroupReq) (r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(req *GetGroupReq) (r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(req *ListGroupsReq) (r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(req *CreateBackupReq) (r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(req *RestoreMetaReq) (r *ExecResp, err error) + // Parameters: + // - Req + AddListener(req *AddListenerReq) (r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(req *RemoveListenerReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListListener(req *ListListenerReq) (r *ListListenerResp, err error) + // Parameters: + // - Req + GetStatis(req *GetStatisReq) (r *GetStatisResp, err error) + // Parameters: + // - Req + SignInFTService(req *SignInFTServiceReq) (r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(req *SignOutFTServiceReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(req *ListFTClientsReq) (r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateSession(req *CreateSessionReq) (r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(req *UpdateSessionsReq) (r *ExecResp, err error) + // Parameters: + // - Req + ListSessions(req *ListSessionsReq) (r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(req *GetSessionReq) (r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(req *RemoveSessionReq) (r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(req *ReportTaskReq) (r *ExecResp, err error) +} + +type MetaServiceClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 +} + +func (client *MetaServiceClient) Close() error { + return client.Transport.Close() +} + +func NewMetaServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceClient { + return &MetaServiceClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewMetaServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceClient { + return &MetaServiceClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpace(req *CreateSpaceReq) (r *ExecResp, err error) { + if err = p.sendCreateSpace(req); err != nil { return } + return p.recvCreateSpace() +} + +func (p *MetaServiceClient) sendCreateSpace(req *CreateSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateSpace() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error77 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error78 error + error78, err = error77.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error78 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSpace failed: invalid message type") + return + } + result := MetaServiceCreateSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSpace(req *DropSpaceReq) (r *ExecResp, err error) { + if err = p.sendDropSpace(req); err != nil { return } + return p.recvDropSpace() +} + +func (p *MetaServiceClient) sendDropSpace(req *DropSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropSpace() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error79 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error80 error + error80, err = error79.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error80 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropSpace failed: invalid message type") + return + } + result := MetaServiceDropSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSpace(req *GetSpaceReq) (r *GetSpaceResp, err error) { + if err = p.sendGetSpace(req); err != nil { return } + return p.recvGetSpace() +} + +func (p *MetaServiceClient) sendGetSpace(req *GetSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetSpace() (value *GetSpaceResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error81 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error82 error + error82, err = error81.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error82 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getSpace failed: invalid message type") + return + } + result := MetaServiceGetSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSpaces(req *ListSpacesReq) (r *ListSpacesResp, err error) { + if err = p.sendListSpaces(req); err != nil { return } + return p.recvListSpaces() +} + +func (p *MetaServiceClient) sendListSpaces(req *ListSpacesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSpaces", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSpacesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListSpaces() (value *ListSpacesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSpaces" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSpaces failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSpaces failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error83 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error84 error + error84, err = error83.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error84 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSpaces failed: invalid message type") + return + } + result := MetaServiceListSpacesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTag(req *CreateTagReq) (r *ExecResp, err error) { + if err = p.sendCreateTag(req); err != nil { return } + return p.recvCreateTag() +} + +func (p *MetaServiceClient) sendCreateTag(req *CreateTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error85 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error86 error + error86, err = error85.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error86 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createTag failed: invalid message type") + return + } + result := MetaServiceCreateTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterTag(req *AlterTagReq) (r *ExecResp, err error) { + if err = p.sendAlterTag(req); err != nil { return } + return p.recvAlterTag() +} + +func (p *MetaServiceClient) sendAlterTag(req *AlterTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAlterTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error87 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error88 error + error88, err = error87.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error88 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterTag failed: invalid message type") + return + } + result := MetaServiceAlterTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTag(req *DropTagReq) (r *ExecResp, err error) { + if err = p.sendDropTag(req); err != nil { return } + return p.recvDropTag() +} + +func (p *MetaServiceClient) sendDropTag(req *DropTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error89 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error90 error + error90, err = error89.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error90 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropTag failed: invalid message type") + return + } + result := MetaServiceDropTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTag(req *GetTagReq) (r *GetTagResp, err error) { + if err = p.sendGetTag(req); err != nil { return } + return p.recvGetTag() +} + +func (p *MetaServiceClient) sendGetTag(req *GetTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetTag() (value *GetTagResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error91 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error92 error + error92, err = error91.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error92 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTag failed: invalid message type") + return + } + result := MetaServiceGetTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTags(req *ListTagsReq) (r *ListTagsResp, err error) { + if err = p.sendListTags(req); err != nil { return } + return p.recvListTags() +} + +func (p *MetaServiceClient) sendListTags(req *ListTagsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTags", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListTags() (value *ListTagsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTags" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTags failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTags failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error93 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error94 error + error94, err = error93.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error94 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTags failed: invalid message type") + return + } + result := MetaServiceListTagsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdge(req *CreateEdgeReq) (r *ExecResp, err error) { + if err = p.sendCreateEdge(req); err != nil { return } + return p.recvCreateEdge() +} + +func (p *MetaServiceClient) sendCreateEdge(req *CreateEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error95 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error96 error + error96, err = error95.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error96 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createEdge failed: invalid message type") + return + } + result := MetaServiceCreateEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterEdge(req *AlterEdgeReq) (r *ExecResp, err error) { + if err = p.sendAlterEdge(req); err != nil { return } + return p.recvAlterEdge() +} + +func (p *MetaServiceClient) sendAlterEdge(req *AlterEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAlterEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error97 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error98 error + error98, err = error97.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error98 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterEdge failed: invalid message type") + return + } + result := MetaServiceAlterEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdge(req *DropEdgeReq) (r *ExecResp, err error) { + if err = p.sendDropEdge(req); err != nil { return } + return p.recvDropEdge() +} + +func (p *MetaServiceClient) sendDropEdge(req *DropEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error99 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error100 error + error100, err = error99.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error100 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropEdge failed: invalid message type") + return + } + result := MetaServiceDropEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdge(req *GetEdgeReq) (r *GetEdgeResp, err error) { + if err = p.sendGetEdge(req); err != nil { return } + return p.recvGetEdge() +} + +func (p *MetaServiceClient) sendGetEdge(req *GetEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetEdge() (value *GetEdgeResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error101 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error102 error + error102, err = error101.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error102 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getEdge failed: invalid message type") + return + } + result := MetaServiceGetEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdges(req *ListEdgesReq) (r *ListEdgesResp, err error) { + if err = p.sendListEdges(req); err != nil { return } + return p.recvListEdges() +} + +func (p *MetaServiceClient) sendListEdges(req *ListEdgesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListEdges() (value *ListEdgesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error103 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error104 error + error104, err = error103.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error104 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdges failed: invalid message type") + return + } + result := MetaServiceListEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (r *ListHostsResp, err error) { + if err = p.sendListHosts(req); err != nil { return } + return p.recvListHosts() +} + +func (p *MetaServiceClient) sendListHosts(req *ListHostsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listHosts", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListHostsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListHosts() (value *ListHostsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listHosts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listHosts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listHosts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error105 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error106 error + error106, err = error105.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error106 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listHosts failed: invalid message type") + return + } + result := MetaServiceListHostsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetPartsAlloc(req *GetPartsAllocReq) (r *GetPartsAllocResp, err error) { + if err = p.sendGetPartsAlloc(req); err != nil { return } + return p.recvGetPartsAlloc() +} + +func (p *MetaServiceClient) sendGetPartsAlloc(req *GetPartsAllocReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getPartsAlloc", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getPartsAlloc" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getPartsAlloc failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getPartsAlloc failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error107 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error108 error + error108, err = error107.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error108 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getPartsAlloc failed: invalid message type") + return + } + result := MetaServiceGetPartsAllocResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListParts(req *ListPartsReq) (r *ListPartsResp, err error) { + if err = p.sendListParts(req); err != nil { return } + return p.recvListParts() +} + +func (p *MetaServiceClient) sendListParts(req *ListPartsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listParts", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListPartsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListParts() (value *ListPartsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listParts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listParts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listParts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error109 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error110 error + error110, err = error109.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error110 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listParts failed: invalid message type") + return + } + result := MetaServiceListPartsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiPut(req *MultiPutReq) (r *ExecResp, err error) { + if err = p.sendMultiPut(req); err != nil { return } + return p.recvMultiPut() +} + +func (p *MetaServiceClient) sendMultiPut(req *MultiPutReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("multiPut", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceMultiPutArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvMultiPut() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "multiPut" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "multiPut failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "multiPut failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error111 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error112 error + error112, err = error111.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error112 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "multiPut failed: invalid message type") + return + } + result := MetaServiceMultiPutResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Get(req *GetReq) (r *GetResp, err error) { + if err = p.sendGet(req); err != nil { return } + return p.recvGet() +} + +func (p *MetaServiceClient) sendGet(req *GetReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("get", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGet() (value *GetResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "get" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "get failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "get failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error113 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error114 error + error114, err = error113.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error114 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "get failed: invalid message type") + return + } + result := MetaServiceGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiGet(req *MultiGetReq) (r *MultiGetResp, err error) { + if err = p.sendMultiGet(req); err != nil { return } + return p.recvMultiGet() +} + +func (p *MetaServiceClient) sendMultiGet(req *MultiGetReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("multiGet", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceMultiGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvMultiGet() (value *MultiGetResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "multiGet" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "multiGet failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "multiGet failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error115 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error116 error + error116, err = error115.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error116 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "multiGet failed: invalid message type") + return + } + result := MetaServiceMultiGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Remove(req *RemoveReq) (r *ExecResp, err error) { + if err = p.sendRemove(req); err != nil { return } + return p.recvRemove() +} + +func (p *MetaServiceClient) sendRemove(req *RemoveReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("remove", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRemove() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "remove" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "remove failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "remove failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error117 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error118 error + error118, err = error117.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error118 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "remove failed: invalid message type") + return + } + result := MetaServiceRemoveResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveRange(req *RemoveRangeReq) (r *ExecResp, err error) { + if err = p.sendRemoveRange(req); err != nil { return } + return p.recvRemoveRange() +} + +func (p *MetaServiceClient) sendRemoveRange(req *RemoveRangeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeRange", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRemoveRange() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeRange" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeRange failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeRange failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error119 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error120 error + error120, err = error119.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error120 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeRange failed: invalid message type") + return + } + result := MetaServiceRemoveRangeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Scan(req *ScanReq) (r *ScanResp, err error) { + if err = p.sendScan(req); err != nil { return } + return p.recvScan() +} + +func (p *MetaServiceClient) sendScan(req *ScanReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scan", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceScanArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvScan() (value *ScanResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scan" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scan failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scan failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error121 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error122 error + error122, err = error121.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error122 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scan failed: invalid message type") + return + } + result := MetaServiceScanResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTagIndex(req *CreateTagIndexReq) (r *ExecResp, err error) { + if err = p.sendCreateTagIndex(req); err != nil { return } + return p.recvCreateTagIndex() +} + +func (p *MetaServiceClient) sendCreateTagIndex(req *CreateTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error123 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error124 error + error124, err = error123.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error124 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createTagIndex failed: invalid message type") + return + } + result := MetaServiceCreateTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTagIndex(req *DropTagIndexReq) (r *ExecResp, err error) { + if err = p.sendDropTagIndex(req); err != nil { return } + return p.recvDropTagIndex() +} + +func (p *MetaServiceClient) sendDropTagIndex(req *DropTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error125 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error126 error + error126, err = error125.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error126 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropTagIndex failed: invalid message type") + return + } + result := MetaServiceDropTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTagIndex(req *GetTagIndexReq) (r *GetTagIndexResp, err error) { + if err = p.sendGetTagIndex(req); err != nil { return } + return p.recvGetTagIndex() +} + +func (p *MetaServiceClient) sendGetTagIndex(req *GetTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error127 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error128 error + error128, err = error127.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error128 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTagIndex failed: invalid message type") + return + } + result := MetaServiceGetTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexes(req *ListTagIndexesReq) (r *ListTagIndexesResp, err error) { + if err = p.sendListTagIndexes(req); err != nil { return } + return p.recvListTagIndexes() +} + +func (p *MetaServiceClient) sendListTagIndexes(req *ListTagIndexesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTagIndexes", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTagIndexes" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTagIndexes failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTagIndexes failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error129 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error130 error + error130, err = error129.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error130 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTagIndexes failed: invalid message type") + return + } + result := MetaServiceListTagIndexesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildTagIndex(req *RebuildIndexReq) (r *ExecResp, err error) { + if err = p.sendRebuildTagIndex(req); err != nil { return } + return p.recvRebuildTagIndex() +} + +func (p *MetaServiceClient) sendRebuildTagIndex(req *RebuildIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRebuildTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error131 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error132 error + error132, err = error131.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error132 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildTagIndex failed: invalid message type") + return + } + result := MetaServiceRebuildTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) { + if err = p.sendListTagIndexStatus(req); err != nil { return } + return p.recvListTagIndexStatus() +} + +func (p *MetaServiceClient) sendListTagIndexStatus(req *ListIndexStatusReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTagIndexStatus", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTagIndexStatus" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTagIndexStatus failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTagIndexStatus failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error133 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error134 error + error134, err = error133.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error134 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTagIndexStatus failed: invalid message type") + return + } + result := MetaServiceListTagIndexStatusResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (r *ExecResp, err error) { + if err = p.sendCreateEdgeIndex(req); err != nil { return } + return p.recvCreateEdgeIndex() +} + +func (p *MetaServiceClient) sendCreateEdgeIndex(req *CreateEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error135 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error136 error + error136, err = error135.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error136 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createEdgeIndex failed: invalid message type") + return + } + result := MetaServiceCreateEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdgeIndex(req *DropEdgeIndexReq) (r *ExecResp, err error) { + if err = p.sendDropEdgeIndex(req); err != nil { return } + return p.recvDropEdgeIndex() +} + +func (p *MetaServiceClient) sendDropEdgeIndex(req *DropEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error137 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error138 error + error138, err = error137.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error138 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropEdgeIndex failed: invalid message type") + return + } + result := MetaServiceDropEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdgeIndex(req *GetEdgeIndexReq) (r *GetEdgeIndexResp, err error) { + if err = p.sendGetEdgeIndex(req); err != nil { return } + return p.recvGetEdgeIndex() +} + +func (p *MetaServiceClient) sendGetEdgeIndex(req *GetEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error139 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error140 error + error140, err = error139.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error140 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getEdgeIndex failed: invalid message type") + return + } + result := MetaServiceGetEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (r *ListEdgeIndexesResp, err error) { + if err = p.sendListEdgeIndexes(req); err != nil { return } + return p.recvListEdgeIndexes() +} + +func (p *MetaServiceClient) sendListEdgeIndexes(req *ListEdgeIndexesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdgeIndexes", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdgeIndexes" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdgeIndexes failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdgeIndexes failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error141 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error142 error + error142, err = error141.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error142 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdgeIndexes failed: invalid message type") + return + } + result := MetaServiceListEdgeIndexesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildEdgeIndex(req *RebuildIndexReq) (r *ExecResp, err error) { + if err = p.sendRebuildEdgeIndex(req); err != nil { return } + return p.recvRebuildEdgeIndex() +} + +func (p *MetaServiceClient) sendRebuildEdgeIndex(req *RebuildIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error143 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error144 error + error144, err = error143.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error144 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildEdgeIndex failed: invalid message type") + return + } + result := MetaServiceRebuildEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) { + if err = p.sendListEdgeIndexStatus(req); err != nil { return } + return p.recvListEdgeIndexStatus() +} + +func (p *MetaServiceClient) sendListEdgeIndexStatus(req *ListIndexStatusReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdgeIndexStatus", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdgeIndexStatus" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdgeIndexStatus failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdgeIndexStatus failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error145 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error146 error + error146, err = error145.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error146 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdgeIndexStatus failed: invalid message type") + return + } + result := MetaServiceListEdgeIndexStatusResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateUser(req *CreateUserReq) (r *ExecResp, err error) { + if err = p.sendCreateUser(req); err != nil { return } + return p.recvCreateUser() +} + +func (p *MetaServiceClient) sendCreateUser(req *CreateUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error147 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error148 error + error148, err = error147.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error148 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createUser failed: invalid message type") + return + } + result := MetaServiceCreateUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropUser(req *DropUserReq) (r *ExecResp, err error) { + if err = p.sendDropUser(req); err != nil { return } + return p.recvDropUser() +} + +func (p *MetaServiceClient) sendDropUser(req *DropUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error149 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error150 error + error150, err = error149.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error150 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropUser failed: invalid message type") + return + } + result := MetaServiceDropUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterUser(req *AlterUserReq) (r *ExecResp, err error) { + if err = p.sendAlterUser(req); err != nil { return } + return p.recvAlterUser() +} + +func (p *MetaServiceClient) sendAlterUser(req *AlterUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAlterUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error151 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error152 error + error152, err = error151.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error152 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterUser failed: invalid message type") + return + } + result := MetaServiceAlterUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GrantRole(req *GrantRoleReq) (r *ExecResp, err error) { + if err = p.sendGrantRole(req); err != nil { return } + return p.recvGrantRole() +} + +func (p *MetaServiceClient) sendGrantRole(req *GrantRoleReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("grantRole", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGrantRoleArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGrantRole() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "grantRole" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "grantRole failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "grantRole failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error153 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error154 error + error154, err = error153.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error154 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "grantRole failed: invalid message type") + return + } + result := MetaServiceGrantRoleResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RevokeRole(req *RevokeRoleReq) (r *ExecResp, err error) { + if err = p.sendRevokeRole(req); err != nil { return } + return p.recvRevokeRole() +} + +func (p *MetaServiceClient) sendRevokeRole(req *RevokeRoleReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("revokeRole", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRevokeRole() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "revokeRole" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "revokeRole failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "revokeRole failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error155 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error156 error + error156, err = error155.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error156 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "revokeRole failed: invalid message type") + return + } + result := MetaServiceRevokeRoleResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListUsers(req *ListUsersReq) (r *ListUsersResp, err error) { + if err = p.sendListUsers(req); err != nil { return } + return p.recvListUsers() +} + +func (p *MetaServiceClient) sendListUsers(req *ListUsersReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listUsers", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListUsersArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListUsers() (value *ListUsersResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listUsers" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listUsers failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listUsers failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error157 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error158 error + error158, err = error157.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error158 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listUsers failed: invalid message type") + return + } + result := MetaServiceListUsersResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListRoles(req *ListRolesReq) (r *ListRolesResp, err error) { + if err = p.sendListRoles(req); err != nil { return } + return p.recvListRoles() +} + +func (p *MetaServiceClient) sendListRoles(req *ListRolesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listRoles", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListRolesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListRoles() (value *ListRolesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listRoles" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listRoles failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listRoles failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error159 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error160 error + error160, err = error159.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error160 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listRoles failed: invalid message type") + return + } + result := MetaServiceListRolesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetUserRoles(req *GetUserRolesReq) (r *ListRolesResp, err error) { + if err = p.sendGetUserRoles(req); err != nil { return } + return p.recvGetUserRoles() +} + +func (p *MetaServiceClient) sendGetUserRoles(req *GetUserRolesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getUserRoles", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetUserRoles() (value *ListRolesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getUserRoles" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getUserRoles failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getUserRoles failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error161 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error162 error + error162, err = error161.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error162 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getUserRoles failed: invalid message type") + return + } + result := MetaServiceGetUserRolesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ChangePassword(req *ChangePasswordReq) (r *ExecResp, err error) { + if err = p.sendChangePassword(req); err != nil { return } + return p.recvChangePassword() +} + +func (p *MetaServiceClient) sendChangePassword(req *ChangePasswordReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("changePassword", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceChangePasswordArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvChangePassword() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "changePassword" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "changePassword failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "changePassword failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error163 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error164 error + error164, err = error163.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error164 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "changePassword failed: invalid message type") + return + } + result := MetaServiceChangePasswordResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) HeartBeat(req *HBReq) (r *HBResp, err error) { + if err = p.sendHeartBeat(req); err != nil { return } + return p.recvHeartBeat() +} + +func (p *MetaServiceClient) sendHeartBeat(req *HBReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("heartBeat", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceHeartBeatArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvHeartBeat() (value *HBResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "heartBeat" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "heartBeat failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "heartBeat failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error165 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error166 error + error166, err = error165.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error166 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "heartBeat failed: invalid message type") + return + } + result := MetaServiceHeartBeatResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Balance(req *BalanceReq) (r *BalanceResp, err error) { + if err = p.sendBalance(req); err != nil { return } + return p.recvBalance() +} + +func (p *MetaServiceClient) sendBalance(req *BalanceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("balance", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceBalanceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvBalance() (value *BalanceResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "balance" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "balance failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "balance failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error167 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error168 error + error168, err = error167.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error168 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "balance failed: invalid message type") + return + } + result := MetaServiceBalanceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) LeaderBalance(req *LeaderBalanceReq) (r *ExecResp, err error) { + if err = p.sendLeaderBalance(req); err != nil { return } + return p.recvLeaderBalance() +} + +func (p *MetaServiceClient) sendLeaderBalance(req *LeaderBalanceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("leaderBalance", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvLeaderBalance() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "leaderBalance" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "leaderBalance failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "leaderBalance failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error169 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error170 error + error170, err = error169.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error170 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "leaderBalance failed: invalid message type") + return + } + result := MetaServiceLeaderBalanceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RegConfig(req *RegConfigReq) (r *ExecResp, err error) { + if err = p.sendRegConfig(req); err != nil { return } + return p.recvRegConfig() +} + +func (p *MetaServiceClient) sendRegConfig(req *RegConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("regConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRegConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRegConfig() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "regConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "regConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "regConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error171 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error172 error + error172, err = error171.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error172 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "regConfig failed: invalid message type") + return + } + result := MetaServiceRegConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetConfig(req *GetConfigReq) (r *GetConfigResp, err error) { + if err = p.sendGetConfig(req); err != nil { return } + return p.recvGetConfig() +} + +func (p *MetaServiceClient) sendGetConfig(req *GetConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetConfig() (value *GetConfigResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error173 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error174 error + error174, err = error173.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error174 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getConfig failed: invalid message type") + return + } + result := MetaServiceGetConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SetConfig(req *SetConfigReq) (r *ExecResp, err error) { + if err = p.sendSetConfig(req); err != nil { return } + return p.recvSetConfig() +} + +func (p *MetaServiceClient) sendSetConfig(req *SetConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("setConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSetConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvSetConfig() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "setConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "setConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "setConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error175 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error176 error + error176, err = error175.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error176 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "setConfig failed: invalid message type") + return + } + result := MetaServiceSetConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListConfigs(req *ListConfigsReq) (r *ListConfigsResp, err error) { + if err = p.sendListConfigs(req); err != nil { return } + return p.recvListConfigs() +} + +func (p *MetaServiceClient) sendListConfigs(req *ListConfigsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listConfigs", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListConfigsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListConfigs() (value *ListConfigsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listConfigs" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listConfigs failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listConfigs failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error177 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error178 error + error178, err = error177.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error178 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listConfigs failed: invalid message type") + return + } + result := MetaServiceListConfigsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSnapshot(req *CreateSnapshotReq) (r *ExecResp, err error) { + if err = p.sendCreateSnapshot(req); err != nil { return } + return p.recvCreateSnapshot() +} + +func (p *MetaServiceClient) sendCreateSnapshot(req *CreateSnapshotReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSnapshot", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateSnapshot() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSnapshot" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSnapshot failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSnapshot failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error179 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error180 error + error180, err = error179.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error180 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSnapshot failed: invalid message type") + return + } + result := MetaServiceCreateSnapshotResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSnapshot(req *DropSnapshotReq) (r *ExecResp, err error) { + if err = p.sendDropSnapshot(req); err != nil { return } + return p.recvDropSnapshot() +} + +func (p *MetaServiceClient) sendDropSnapshot(req *DropSnapshotReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropSnapshot", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropSnapshot() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropSnapshot" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropSnapshot failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropSnapshot failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error181 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error182 error + error182, err = error181.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error182 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropSnapshot failed: invalid message type") + return + } + result := MetaServiceDropSnapshotResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSnapshots(req *ListSnapshotsReq) (r *ListSnapshotsResp, err error) { + if err = p.sendListSnapshots(req); err != nil { return } + return p.recvListSnapshots() +} + +func (p *MetaServiceClient) sendListSnapshots(req *ListSnapshotsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSnapshots", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSnapshots" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSnapshots failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSnapshots failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error183 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error184 error + error184, err = error183.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error184 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSnapshots failed: invalid message type") + return + } + result := MetaServiceListSnapshotsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RunAdminJob(req *AdminJobReq) (r *AdminJobResp, err error) { + if err = p.sendRunAdminJob(req); err != nil { return } + return p.recvRunAdminJob() +} + +func (p *MetaServiceClient) sendRunAdminJob(req *AdminJobReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("runAdminJob", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRunAdminJob() (value *AdminJobResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "runAdminJob" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "runAdminJob failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "runAdminJob failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error185 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error186 error + error186, err = error185.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error186 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "runAdminJob failed: invalid message type") + return + } + result := MetaServiceRunAdminJobResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZone(req *AddZoneReq) (r *ExecResp, err error) { + if err = p.sendAddZone(req); err != nil { return } + return p.recvAddZone() +} + +func (p *MetaServiceClient) sendAddZone(req *AddZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAddZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error187 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error188 error + error188, err = error187.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error188 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addZone failed: invalid message type") + return + } + result := MetaServiceAddZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZone(req *DropZoneReq) (r *ExecResp, err error) { + if err = p.sendDropZone(req); err != nil { return } + return p.recvDropZone() +} + +func (p *MetaServiceClient) sendDropZone(req *DropZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error189 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error190 error + error190, err = error189.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error190 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropZone failed: invalid message type") + return + } + result := MetaServiceDropZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostIntoZone(req *AddHostIntoZoneReq) (r *ExecResp, err error) { + if err = p.sendAddHostIntoZone(req); err != nil { return } + return p.recvAddHostIntoZone() +} + +func (p *MetaServiceClient) sendAddHostIntoZone(req *AddHostIntoZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addHostIntoZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addHostIntoZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addHostIntoZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addHostIntoZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error191 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error192 error + error192, err = error191.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error192 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addHostIntoZone failed: invalid message type") + return + } + result := MetaServiceAddHostIntoZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHostFromZone(req *DropHostFromZoneReq) (r *ExecResp, err error) { + if err = p.sendDropHostFromZone(req); err != nil { return } + return p.recvDropHostFromZone() +} + +func (p *MetaServiceClient) sendDropHostFromZone(req *DropHostFromZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropHostFromZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropHostFromZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropHostFromZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropHostFromZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropHostFromZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error193 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error194 error + error194, err = error193.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error194 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropHostFromZone failed: invalid message type") + return + } + result := MetaServiceDropHostFromZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetZone(req *GetZoneReq) (r *GetZoneResp, err error) { + if err = p.sendGetZone(req); err != nil { return } + return p.recvGetZone() +} + +func (p *MetaServiceClient) sendGetZone(req *GetZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetZone() (value *GetZoneResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error195 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error196 error + error196, err = error195.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error196 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getZone failed: invalid message type") + return + } + result := MetaServiceGetZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListZones(req *ListZonesReq) (r *ListZonesResp, err error) { + if err = p.sendListZones(req); err != nil { return } + return p.recvListZones() +} + +func (p *MetaServiceClient) sendListZones(req *ListZonesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listZones", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListZonesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListZones() (value *ListZonesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listZones" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listZones failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listZones failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error197 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error198 error + error198, err = error197.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error198 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listZones failed: invalid message type") + return + } + result := MetaServiceListZonesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddGroup(req *AddGroupReq) (r *ExecResp, err error) { + if err = p.sendAddGroup(req); err != nil { return } + return p.recvAddGroup() +} + +func (p *MetaServiceClient) sendAddGroup(req *AddGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAddGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error199 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error200 error + error200, err = error199.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error200 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addGroup failed: invalid message type") + return + } + result := MetaServiceAddGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropGroup(req *DropGroupReq) (r *ExecResp, err error) { + if err = p.sendDropGroup(req); err != nil { return } + return p.recvDropGroup() +} + +func (p *MetaServiceClient) sendDropGroup(req *DropGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error201 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error202 error + error202, err = error201.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error202 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropGroup failed: invalid message type") + return + } + result := MetaServiceDropGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (r *ExecResp, err error) { + if err = p.sendAddZoneIntoGroup(req); err != nil { return } + return p.recvAddZoneIntoGroup() +} + +func (p *MetaServiceClient) sendAddZoneIntoGroup(req *AddZoneIntoGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addZoneIntoGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addZoneIntoGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addZoneIntoGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addZoneIntoGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error203 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error204 error + error204, err = error203.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error204 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addZoneIntoGroup failed: invalid message type") + return + } + result := MetaServiceAddZoneIntoGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (r *ExecResp, err error) { + if err = p.sendDropZoneFromGroup(req); err != nil { return } + return p.recvDropZoneFromGroup() +} + +func (p *MetaServiceClient) sendDropZoneFromGroup(req *DropZoneFromGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropZoneFromGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropZoneFromGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropZoneFromGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropZoneFromGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error205 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error206 error + error206, err = error205.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error206 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropZoneFromGroup failed: invalid message type") + return + } + result := MetaServiceDropZoneFromGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetGroup(req *GetGroupReq) (r *GetGroupResp, err error) { + if err = p.sendGetGroup(req); err != nil { return } + return p.recvGetGroup() +} + +func (p *MetaServiceClient) sendGetGroup(req *GetGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetGroup() (value *GetGroupResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error207 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error208 error + error208, err = error207.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error208 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getGroup failed: invalid message type") + return + } + result := MetaServiceGetGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListGroups(req *ListGroupsReq) (r *ListGroupsResp, err error) { + if err = p.sendListGroups(req); err != nil { return } + return p.recvListGroups() +} + +func (p *MetaServiceClient) sendListGroups(req *ListGroupsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listGroups", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListGroupsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListGroups() (value *ListGroupsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listGroups" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listGroups failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listGroups failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error209 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error210 error + error210, err = error209.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error210 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listGroups failed: invalid message type") + return + } + result := MetaServiceListGroupsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateBackup(req *CreateBackupReq) (r *CreateBackupResp, err error) { + if err = p.sendCreateBackup(req); err != nil { return } + return p.recvCreateBackup() +} + +func (p *MetaServiceClient) sendCreateBackup(req *CreateBackupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createBackup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateBackupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateBackup() (value *CreateBackupResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createBackup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createBackup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createBackup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error211 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error212 error + error212, err = error211.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error212 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createBackup failed: invalid message type") + return + } + result := MetaServiceCreateBackupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (r *ExecResp, err error) { + if err = p.sendRestoreMeta(req); err != nil { return } + return p.recvRestoreMeta() +} + +func (p *MetaServiceClient) sendRestoreMeta(req *RestoreMetaReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("restoreMeta", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRestoreMeta() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "restoreMeta" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "restoreMeta failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "restoreMeta failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error213 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error214 error + error214, err = error213.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error214 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "restoreMeta failed: invalid message type") + return + } + result := MetaServiceRestoreMetaResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddListener(req *AddListenerReq) (r *ExecResp, err error) { + if err = p.sendAddListener(req); err != nil { return } + return p.recvAddListener() +} + +func (p *MetaServiceClient) sendAddListener(req *AddListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvAddListener() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error215 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error216 error + error216, err = error215.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error216 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addListener failed: invalid message type") + return + } + result := MetaServiceAddListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveListener(req *RemoveListenerReq) (r *ExecResp, err error) { + if err = p.sendRemoveListener(req); err != nil { return } + return p.recvRemoveListener() +} + +func (p *MetaServiceClient) sendRemoveListener(req *RemoveListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRemoveListener() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error217 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error218 error + error218, err = error217.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error218 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeListener failed: invalid message type") + return + } + result := MetaServiceRemoveListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListListener(req *ListListenerReq) (r *ListListenerResp, err error) { + if err = p.sendListListener(req); err != nil { return } + return p.recvListListener() +} + +func (p *MetaServiceClient) sendListListener(req *ListListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListListener() (value *ListListenerResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error219 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error220 error + error220, err = error219.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error220 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listListener failed: invalid message type") + return + } + result := MetaServiceListListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetStatis(req *GetStatisReq) (r *GetStatisResp, err error) { + if err = p.sendGetStatis(req); err != nil { return } + return p.recvGetStatis() +} + +func (p *MetaServiceClient) sendGetStatis(req *GetStatisReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getStatis", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetStatisArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetStatis() (value *GetStatisResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getStatis" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getStatis failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getStatis failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error221 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error222 error + error222, err = error221.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error222 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getStatis failed: invalid message type") + return + } + result := MetaServiceGetStatisResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignInFTService(req *SignInFTServiceReq) (r *ExecResp, err error) { + if err = p.sendSignInFTService(req); err != nil { return } + return p.recvSignInFTService() +} + +func (p *MetaServiceClient) sendSignInFTService(req *SignInFTServiceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signInFTService", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvSignInFTService() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "signInFTService" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "signInFTService failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "signInFTService failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error223 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error224 error + error224, err = error223.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error224 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "signInFTService failed: invalid message type") + return + } + result := MetaServiceSignInFTServiceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignOutFTService(req *SignOutFTServiceReq) (r *ExecResp, err error) { + if err = p.sendSignOutFTService(req); err != nil { return } + return p.recvSignOutFTService() +} + +func (p *MetaServiceClient) sendSignOutFTService(req *SignOutFTServiceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signOutFTService", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvSignOutFTService() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "signOutFTService" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "signOutFTService failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "signOutFTService failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error225 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error226 error + error226, err = error225.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error226 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "signOutFTService failed: invalid message type") + return + } + result := MetaServiceSignOutFTServiceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTClients(req *ListFTClientsReq) (r *ListFTClientsResp, err error) { + if err = p.sendListFTClients(req); err != nil { return } + return p.recvListFTClients() +} + +func (p *MetaServiceClient) sendListFTClients(req *ListFTClientsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listFTClients", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListFTClientsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListFTClients() (value *ListFTClientsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listFTClients" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listFTClients failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listFTClients failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error227 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error228 error + error228, err = error227.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error228 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listFTClients failed: invalid message type") + return + } + result := MetaServiceListFTClientsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSession(req *CreateSessionReq) (r *CreateSessionResp, err error) { + if err = p.sendCreateSession(req); err != nil { return } + return p.recvCreateSession() +} + +func (p *MetaServiceClient) sendCreateSession(req *CreateSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvCreateSession() (value *CreateSessionResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error229 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error230 error + error230, err = error229.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error230 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSession failed: invalid message type") + return + } + result := MetaServiceCreateSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) UpdateSessions(req *UpdateSessionsReq) (r *ExecResp, err error) { + if err = p.sendUpdateSessions(req); err != nil { return } + return p.recvUpdateSessions() +} + +func (p *MetaServiceClient) sendUpdateSessions(req *UpdateSessionsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateSessions", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvUpdateSessions() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateSessions" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateSessions failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateSessions failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error231 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error232 error + error232, err = error231.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error232 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateSessions failed: invalid message type") + return + } + result := MetaServiceUpdateSessionsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSessions(req *ListSessionsReq) (r *ListSessionsResp, err error) { + if err = p.sendListSessions(req); err != nil { return } + return p.recvListSessions() +} + +func (p *MetaServiceClient) sendListSessions(req *ListSessionsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSessions", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSessionsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvListSessions() (value *ListSessionsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSessions" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSessions failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSessions failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error233 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error234 error + error234, err = error233.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error234 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSessions failed: invalid message type") + return + } + result := MetaServiceListSessionsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSession(req *GetSessionReq) (r *GetSessionResp, err error) { + if err = p.sendGetSession(req); err != nil { return } + return p.recvGetSession() +} + +func (p *MetaServiceClient) sendGetSession(req *GetSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvGetSession() (value *GetSessionResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error235 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error236 error + error236, err = error235.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error236 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getSession failed: invalid message type") + return + } + result := MetaServiceGetSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveSession(req *RemoveSessionReq) (r *ExecResp, err error) { + if err = p.sendRemoveSession(req); err != nil { return } + return p.recvRemoveSession() +} + +func (p *MetaServiceClient) sendRemoveSession(req *RemoveSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvRemoveSession() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error237 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error238 error + error238, err = error237.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error238 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeSession failed: invalid message type") + return + } + result := MetaServiceRemoveSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ReportTaskFinish(req *ReportTaskReq) (r *ExecResp, err error) { + if err = p.sendReportTaskFinish(req); err != nil { return } + return p.recvReportTaskFinish() +} + +func (p *MetaServiceClient) sendReportTaskFinish(req *ReportTaskReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("reportTaskFinish", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceClient) recvReportTaskFinish() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "reportTaskFinish" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "reportTaskFinish failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "reportTaskFinish failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error239 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error240 error + error240, err = error239.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error240 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "reportTaskFinish failed: invalid message type") + return + } + result := MetaServiceReportTaskFinishResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type MetaServiceThreadsafeClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 + Mu sync.Mutex +} + +func NewMetaServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewMetaServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +func (p *MetaServiceThreadsafeClient) Threadsafe() {} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSpace(req *CreateSpaceReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateSpace(req); err != nil { return } + return p.recvCreateSpace() +} + +func (p *MetaServiceThreadsafeClient) sendCreateSpace(req *CreateSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSpace() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error241 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error242 error + error242, err = error241.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error242 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSpace failed: invalid message type") + return + } + result := MetaServiceCreateSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSpace(req *DropSpaceReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropSpace(req); err != nil { return } + return p.recvDropSpace() +} + +func (p *MetaServiceThreadsafeClient) sendDropSpace(req *DropSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSpace() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error243 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error244 error + error244, err = error243.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error244 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropSpace failed: invalid message type") + return + } + result := MetaServiceDropSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSpace(req *GetSpaceReq) (r *GetSpaceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetSpace(req); err != nil { return } + return p.recvGetSpace() +} + +func (p *MetaServiceThreadsafeClient) sendGetSpace(req *GetSpaceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getSpace", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetSpaceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSpace() (value *GetSpaceResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getSpace" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getSpace failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getSpace failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error245 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error246 error + error246, err = error245.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error246 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getSpace failed: invalid message type") + return + } + result := MetaServiceGetSpaceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSpaces(req *ListSpacesReq) (r *ListSpacesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListSpaces(req); err != nil { return } + return p.recvListSpaces() +} + +func (p *MetaServiceThreadsafeClient) sendListSpaces(req *ListSpacesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSpaces", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSpacesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListSpaces() (value *ListSpacesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSpaces" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSpaces failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSpaces failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error247 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error248 error + error248, err = error247.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error248 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSpaces failed: invalid message type") + return + } + result := MetaServiceListSpacesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTag(req *CreateTagReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateTag(req); err != nil { return } + return p.recvCreateTag() +} + +func (p *MetaServiceThreadsafeClient) sendCreateTag(req *CreateTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error249 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error250 error + error250, err = error249.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error250 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createTag failed: invalid message type") + return + } + result := MetaServiceCreateTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterTag(req *AlterTagReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAlterTag(req); err != nil { return } + return p.recvAlterTag() +} + +func (p *MetaServiceThreadsafeClient) sendAlterTag(req *AlterTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error251 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error252 error + error252, err = error251.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error252 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterTag failed: invalid message type") + return + } + result := MetaServiceAlterTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTag(req *DropTagReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropTag(req); err != nil { return } + return p.recvDropTag() +} + +func (p *MetaServiceThreadsafeClient) sendDropTag(req *DropTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTag() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error253 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error254 error + error254, err = error253.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error254 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropTag failed: invalid message type") + return + } + result := MetaServiceDropTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTag(req *GetTagReq) (r *GetTagResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetTag(req); err != nil { return } + return p.recvGetTag() +} + +func (p *MetaServiceThreadsafeClient) sendGetTag(req *GetTagReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getTag", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetTagArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTag() (value *GetTagResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getTag" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getTag failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getTag failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error255 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error256 error + error256, err = error255.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error256 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTag failed: invalid message type") + return + } + result := MetaServiceGetTagResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTags(req *ListTagsReq) (r *ListTagsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListTags(req); err != nil { return } + return p.recvListTags() +} + +func (p *MetaServiceThreadsafeClient) sendListTags(req *ListTagsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTags", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListTags() (value *ListTagsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTags" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTags failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTags failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error257 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error258 error + error258, err = error257.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error258 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTags failed: invalid message type") + return + } + result := MetaServiceListTagsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdge(req *CreateEdgeReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateEdge(req); err != nil { return } + return p.recvCreateEdge() +} + +func (p *MetaServiceThreadsafeClient) sendCreateEdge(req *CreateEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error259 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error260 error + error260, err = error259.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error260 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createEdge failed: invalid message type") + return + } + result := MetaServiceCreateEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterEdge(req *AlterEdgeReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAlterEdge(req); err != nil { return } + return p.recvAlterEdge() +} + +func (p *MetaServiceThreadsafeClient) sendAlterEdge(req *AlterEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error261 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error262 error + error262, err = error261.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error262 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterEdge failed: invalid message type") + return + } + result := MetaServiceAlterEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdge(req *DropEdgeReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropEdge(req); err != nil { return } + return p.recvDropEdge() +} + +func (p *MetaServiceThreadsafeClient) sendDropEdge(req *DropEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdge() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error263 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error264 error + error264, err = error263.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error264 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropEdge failed: invalid message type") + return + } + result := MetaServiceDropEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdge(req *GetEdgeReq) (r *GetEdgeResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetEdge(req); err != nil { return } + return p.recvGetEdge() +} + +func (p *MetaServiceThreadsafeClient) sendGetEdge(req *GetEdgeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdge() (value *GetEdgeResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error265 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error266 error + error266, err = error265.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error266 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getEdge failed: invalid message type") + return + } + result := MetaServiceGetEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdges(req *ListEdgesReq) (r *ListEdgesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListEdges(req); err != nil { return } + return p.recvListEdges() +} + +func (p *MetaServiceThreadsafeClient) sendListEdges(req *ListEdgesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdges() (value *ListEdgesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error267 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error268 error + error268, err = error267.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error268 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdges failed: invalid message type") + return + } + result := MetaServiceListEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (r *ListHostsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListHosts(req); err != nil { return } + return p.recvListHosts() +} + +func (p *MetaServiceThreadsafeClient) sendListHosts(req *ListHostsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listHosts", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListHostsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListHosts() (value *ListHostsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listHosts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listHosts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listHosts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error269 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error270 error + error270, err = error269.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error270 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listHosts failed: invalid message type") + return + } + result := MetaServiceListHostsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetPartsAlloc(req *GetPartsAllocReq) (r *GetPartsAllocResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetPartsAlloc(req); err != nil { return } + return p.recvGetPartsAlloc() +} + +func (p *MetaServiceThreadsafeClient) sendGetPartsAlloc(req *GetPartsAllocReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getPartsAlloc", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getPartsAlloc" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getPartsAlloc failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getPartsAlloc failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error271 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error272 error + error272, err = error271.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error272 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getPartsAlloc failed: invalid message type") + return + } + result := MetaServiceGetPartsAllocResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListParts(req *ListPartsReq) (r *ListPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListParts(req); err != nil { return } + return p.recvListParts() +} + +func (p *MetaServiceThreadsafeClient) sendListParts(req *ListPartsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listParts", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListPartsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListParts() (value *ListPartsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listParts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listParts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listParts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error273 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error274 error + error274, err = error273.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error274 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listParts failed: invalid message type") + return + } + result := MetaServiceListPartsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiPut(req *MultiPutReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendMultiPut(req); err != nil { return } + return p.recvMultiPut() +} + +func (p *MetaServiceThreadsafeClient) sendMultiPut(req *MultiPutReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("multiPut", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceMultiPutArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiPut() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "multiPut" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "multiPut failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "multiPut failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error275 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error276 error + error276, err = error275.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error276 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "multiPut failed: invalid message type") + return + } + result := MetaServiceMultiPutResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Get(req *GetReq) (r *GetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGet(req); err != nil { return } + return p.recvGet() +} + +func (p *MetaServiceThreadsafeClient) sendGet(req *GetReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("get", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGet() (value *GetResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "get" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "get failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "get failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error277 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error278 error + error278, err = error277.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error278 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "get failed: invalid message type") + return + } + result := MetaServiceGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiGet(req *MultiGetReq) (r *MultiGetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendMultiGet(req); err != nil { return } + return p.recvMultiGet() +} + +func (p *MetaServiceThreadsafeClient) sendMultiGet(req *MultiGetReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("multiGet", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceMultiGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiGet() (value *MultiGetResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "multiGet" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "multiGet failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "multiGet failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error279 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error280 error + error280, err = error279.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error280 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "multiGet failed: invalid message type") + return + } + result := MetaServiceMultiGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Remove(req *RemoveReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemove(req); err != nil { return } + return p.recvRemove() +} + +func (p *MetaServiceThreadsafeClient) sendRemove(req *RemoveReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("remove", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRemove() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "remove" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "remove failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "remove failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error281 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error282 error + error282, err = error281.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error282 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "remove failed: invalid message type") + return + } + result := MetaServiceRemoveResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveRange(req *RemoveRangeReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemoveRange(req); err != nil { return } + return p.recvRemoveRange() +} + +func (p *MetaServiceThreadsafeClient) sendRemoveRange(req *RemoveRangeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeRange", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveRange() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeRange" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeRange failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeRange failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error283 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error284 error + error284, err = error283.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error284 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeRange failed: invalid message type") + return + } + result := MetaServiceRemoveRangeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Scan(req *ScanReq) (r *ScanResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendScan(req); err != nil { return } + return p.recvScan() +} + +func (p *MetaServiceThreadsafeClient) sendScan(req *ScanReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scan", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceScanArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvScan() (value *ScanResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scan" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scan failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scan failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error285 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error286 error + error286, err = error285.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error286 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scan failed: invalid message type") + return + } + result := MetaServiceScanResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTagIndex(req *CreateTagIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateTagIndex(req); err != nil { return } + return p.recvCreateTagIndex() +} + +func (p *MetaServiceThreadsafeClient) sendCreateTagIndex(req *CreateTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error287 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error288 error + error288, err = error287.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error288 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createTagIndex failed: invalid message type") + return + } + result := MetaServiceCreateTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTagIndex(req *DropTagIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropTagIndex(req); err != nil { return } + return p.recvDropTagIndex() +} + +func (p *MetaServiceThreadsafeClient) sendDropTagIndex(req *DropTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error289 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error290 error + error290, err = error289.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error290 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropTagIndex failed: invalid message type") + return + } + result := MetaServiceDropTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTagIndex(req *GetTagIndexReq) (r *GetTagIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetTagIndex(req); err != nil { return } + return p.recvGetTagIndex() +} + +func (p *MetaServiceThreadsafeClient) sendGetTagIndex(req *GetTagIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error291 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error292 error + error292, err = error291.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error292 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTagIndex failed: invalid message type") + return + } + result := MetaServiceGetTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexes(req *ListTagIndexesReq) (r *ListTagIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListTagIndexes(req); err != nil { return } + return p.recvListTagIndexes() +} + +func (p *MetaServiceThreadsafeClient) sendListTagIndexes(req *ListTagIndexesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTagIndexes", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTagIndexes" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTagIndexes failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTagIndexes failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error293 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error294 error + error294, err = error293.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error294 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTagIndexes failed: invalid message type") + return + } + result := MetaServiceListTagIndexesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRebuildTagIndex(req); err != nil { return } + return p.recvRebuildTagIndex() +} + +func (p *MetaServiceThreadsafeClient) sendRebuildTagIndex(req *RebuildIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildTagIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error295 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error296 error + error296, err = error295.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error296 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildTagIndex failed: invalid message type") + return + } + result := MetaServiceRebuildTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListTagIndexStatus(req); err != nil { return } + return p.recvListTagIndexStatus() +} + +func (p *MetaServiceThreadsafeClient) sendListTagIndexStatus(req *ListIndexStatusReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listTagIndexStatus", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listTagIndexStatus" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listTagIndexStatus failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listTagIndexStatus failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error297 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error298 error + error298, err = error297.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error298 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listTagIndexStatus failed: invalid message type") + return + } + result := MetaServiceListTagIndexStatusResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateEdgeIndex(req); err != nil { return } + return p.recvCreateEdgeIndex() +} + +func (p *MetaServiceThreadsafeClient) sendCreateEdgeIndex(req *CreateEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error299 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error300 error + error300, err = error299.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error300 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createEdgeIndex failed: invalid message type") + return + } + result := MetaServiceCreateEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdgeIndex(req *DropEdgeIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropEdgeIndex(req); err != nil { return } + return p.recvDropEdgeIndex() +} + +func (p *MetaServiceThreadsafeClient) sendDropEdgeIndex(req *DropEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error301 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error302 error + error302, err = error301.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error302 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropEdgeIndex failed: invalid message type") + return + } + result := MetaServiceDropEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdgeIndex(req *GetEdgeIndexReq) (r *GetEdgeIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetEdgeIndex(req); err != nil { return } + return p.recvGetEdgeIndex() +} + +func (p *MetaServiceThreadsafeClient) sendGetEdgeIndex(req *GetEdgeIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error303 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error304 error + error304, err = error303.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error304 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getEdgeIndex failed: invalid message type") + return + } + result := MetaServiceGetEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (r *ListEdgeIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListEdgeIndexes(req); err != nil { return } + return p.recvListEdgeIndexes() +} + +func (p *MetaServiceThreadsafeClient) sendListEdgeIndexes(req *ListEdgeIndexesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdgeIndexes", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdgeIndexes" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdgeIndexes failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdgeIndexes failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error305 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error306 error + error306, err = error305.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error306 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdgeIndexes failed: invalid message type") + return + } + result := MetaServiceListEdgeIndexesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRebuildEdgeIndex(req); err != nil { return } + return p.recvRebuildEdgeIndex() +} + +func (p *MetaServiceThreadsafeClient) sendRebuildEdgeIndex(req *RebuildIndexReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error307 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error308 error + error308, err = error307.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error308 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildEdgeIndex failed: invalid message type") + return + } + result := MetaServiceRebuildEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListEdgeIndexStatus(req); err != nil { return } + return p.recvListEdgeIndexStatus() +} + +func (p *MetaServiceThreadsafeClient) sendListEdgeIndexStatus(req *ListIndexStatusReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listEdgeIndexStatus", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listEdgeIndexStatus" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listEdgeIndexStatus failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listEdgeIndexStatus failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error309 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error310 error + error310, err = error309.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error310 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listEdgeIndexStatus failed: invalid message type") + return + } + result := MetaServiceListEdgeIndexStatusResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateUser(req *CreateUserReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateUser(req); err != nil { return } + return p.recvCreateUser() +} + +func (p *MetaServiceThreadsafeClient) sendCreateUser(req *CreateUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error311 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error312 error + error312, err = error311.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error312 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createUser failed: invalid message type") + return + } + result := MetaServiceCreateUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropUser(req *DropUserReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropUser(req); err != nil { return } + return p.recvDropUser() +} + +func (p *MetaServiceThreadsafeClient) sendDropUser(req *DropUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error313 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error314 error + error314, err = error313.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error314 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropUser failed: invalid message type") + return + } + result := MetaServiceDropUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterUser(req *AlterUserReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAlterUser(req); err != nil { return } + return p.recvAlterUser() +} + +func (p *MetaServiceThreadsafeClient) sendAlterUser(req *AlterUserReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("alterUser", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAlterUserArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterUser() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "alterUser" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "alterUser failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "alterUser failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error315 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error316 error + error316, err = error315.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error316 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "alterUser failed: invalid message type") + return + } + result := MetaServiceAlterUserResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GrantRole(req *GrantRoleReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGrantRole(req); err != nil { return } + return p.recvGrantRole() +} + +func (p *MetaServiceThreadsafeClient) sendGrantRole(req *GrantRoleReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("grantRole", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGrantRoleArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGrantRole() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "grantRole" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "grantRole failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "grantRole failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error317 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error318 error + error318, err = error317.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error318 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "grantRole failed: invalid message type") + return + } + result := MetaServiceGrantRoleResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RevokeRole(req *RevokeRoleReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRevokeRole(req); err != nil { return } + return p.recvRevokeRole() +} + +func (p *MetaServiceThreadsafeClient) sendRevokeRole(req *RevokeRoleReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("revokeRole", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRevokeRole() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "revokeRole" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "revokeRole failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "revokeRole failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error319 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error320 error + error320, err = error319.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error320 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "revokeRole failed: invalid message type") + return + } + result := MetaServiceRevokeRoleResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListUsers(req *ListUsersReq) (r *ListUsersResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListUsers(req); err != nil { return } + return p.recvListUsers() +} + +func (p *MetaServiceThreadsafeClient) sendListUsers(req *ListUsersReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listUsers", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListUsersArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListUsers() (value *ListUsersResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listUsers" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listUsers failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listUsers failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error321 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error322 error + error322, err = error321.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error322 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listUsers failed: invalid message type") + return + } + result := MetaServiceListUsersResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListRoles(req *ListRolesReq) (r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListRoles(req); err != nil { return } + return p.recvListRoles() +} + +func (p *MetaServiceThreadsafeClient) sendListRoles(req *ListRolesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listRoles", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListRolesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListRoles() (value *ListRolesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listRoles" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listRoles failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listRoles failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error323 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error324 error + error324, err = error323.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error324 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listRoles failed: invalid message type") + return + } + result := MetaServiceListRolesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetUserRoles(req *GetUserRolesReq) (r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetUserRoles(req); err != nil { return } + return p.recvGetUserRoles() +} + +func (p *MetaServiceThreadsafeClient) sendGetUserRoles(req *GetUserRolesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getUserRoles", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetUserRoles() (value *ListRolesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getUserRoles" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getUserRoles failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getUserRoles failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error325 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error326 error + error326, err = error325.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error326 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getUserRoles failed: invalid message type") + return + } + result := MetaServiceGetUserRolesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ChangePassword(req *ChangePasswordReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendChangePassword(req); err != nil { return } + return p.recvChangePassword() +} + +func (p *MetaServiceThreadsafeClient) sendChangePassword(req *ChangePasswordReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("changePassword", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceChangePasswordArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvChangePassword() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "changePassword" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "changePassword failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "changePassword failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error327 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error328 error + error328, err = error327.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error328 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "changePassword failed: invalid message type") + return + } + result := MetaServiceChangePasswordResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) HeartBeat(req *HBReq) (r *HBResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendHeartBeat(req); err != nil { return } + return p.recvHeartBeat() +} + +func (p *MetaServiceThreadsafeClient) sendHeartBeat(req *HBReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("heartBeat", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceHeartBeatArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvHeartBeat() (value *HBResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "heartBeat" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "heartBeat failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "heartBeat failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error329 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error330 error + error330, err = error329.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error330 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "heartBeat failed: invalid message type") + return + } + result := MetaServiceHeartBeatResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Balance(req *BalanceReq) (r *BalanceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendBalance(req); err != nil { return } + return p.recvBalance() +} + +func (p *MetaServiceThreadsafeClient) sendBalance(req *BalanceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("balance", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceBalanceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvBalance() (value *BalanceResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "balance" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "balance failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "balance failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error331 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error332 error + error332, err = error331.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error332 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "balance failed: invalid message type") + return + } + result := MetaServiceBalanceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) LeaderBalance(req *LeaderBalanceReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendLeaderBalance(req); err != nil { return } + return p.recvLeaderBalance() +} + +func (p *MetaServiceThreadsafeClient) sendLeaderBalance(req *LeaderBalanceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("leaderBalance", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvLeaderBalance() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "leaderBalance" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "leaderBalance failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "leaderBalance failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error333 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error334 error + error334, err = error333.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error334 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "leaderBalance failed: invalid message type") + return + } + result := MetaServiceLeaderBalanceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RegConfig(req *RegConfigReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRegConfig(req); err != nil { return } + return p.recvRegConfig() +} + +func (p *MetaServiceThreadsafeClient) sendRegConfig(req *RegConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("regConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRegConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRegConfig() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "regConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "regConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "regConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error335 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error336 error + error336, err = error335.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error336 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "regConfig failed: invalid message type") + return + } + result := MetaServiceRegConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetConfig(req *GetConfigReq) (r *GetConfigResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetConfig(req); err != nil { return } + return p.recvGetConfig() +} + +func (p *MetaServiceThreadsafeClient) sendGetConfig(req *GetConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetConfig() (value *GetConfigResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error337 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error338 error + error338, err = error337.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error338 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getConfig failed: invalid message type") + return + } + result := MetaServiceGetConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SetConfig(req *SetConfigReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendSetConfig(req); err != nil { return } + return p.recvSetConfig() +} + +func (p *MetaServiceThreadsafeClient) sendSetConfig(req *SetConfigReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("setConfig", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSetConfigArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvSetConfig() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "setConfig" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "setConfig failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "setConfig failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error339 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error340 error + error340, err = error339.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error340 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "setConfig failed: invalid message type") + return + } + result := MetaServiceSetConfigResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListConfigs(req *ListConfigsReq) (r *ListConfigsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListConfigs(req); err != nil { return } + return p.recvListConfigs() +} + +func (p *MetaServiceThreadsafeClient) sendListConfigs(req *ListConfigsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listConfigs", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListConfigsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListConfigs() (value *ListConfigsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listConfigs" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listConfigs failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listConfigs failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error341 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error342 error + error342, err = error341.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error342 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listConfigs failed: invalid message type") + return + } + result := MetaServiceListConfigsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSnapshot(req *CreateSnapshotReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateSnapshot(req); err != nil { return } + return p.recvCreateSnapshot() +} + +func (p *MetaServiceThreadsafeClient) sendCreateSnapshot(req *CreateSnapshotReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSnapshot", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSnapshot() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSnapshot" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSnapshot failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSnapshot failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error343 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error344 error + error344, err = error343.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error344 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSnapshot failed: invalid message type") + return + } + result := MetaServiceCreateSnapshotResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSnapshot(req *DropSnapshotReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropSnapshot(req); err != nil { return } + return p.recvDropSnapshot() +} + +func (p *MetaServiceThreadsafeClient) sendDropSnapshot(req *DropSnapshotReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropSnapshot", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSnapshot() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropSnapshot" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropSnapshot failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropSnapshot failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error345 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error346 error + error346, err = error345.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error346 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropSnapshot failed: invalid message type") + return + } + result := MetaServiceDropSnapshotResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSnapshots(req *ListSnapshotsReq) (r *ListSnapshotsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListSnapshots(req); err != nil { return } + return p.recvListSnapshots() +} + +func (p *MetaServiceThreadsafeClient) sendListSnapshots(req *ListSnapshotsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSnapshots", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSnapshots" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSnapshots failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSnapshots failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error347 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error348 error + error348, err = error347.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error348 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSnapshots failed: invalid message type") + return + } + result := MetaServiceListSnapshotsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RunAdminJob(req *AdminJobReq) (r *AdminJobResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRunAdminJob(req); err != nil { return } + return p.recvRunAdminJob() +} + +func (p *MetaServiceThreadsafeClient) sendRunAdminJob(req *AdminJobReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("runAdminJob", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRunAdminJob() (value *AdminJobResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "runAdminJob" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "runAdminJob failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "runAdminJob failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error349 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error350 error + error350, err = error349.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error350 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "runAdminJob failed: invalid message type") + return + } + result := MetaServiceRunAdminJobResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZone(req *AddZoneReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddZone(req); err != nil { return } + return p.recvAddZone() +} + +func (p *MetaServiceThreadsafeClient) sendAddZone(req *AddZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error351 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error352 error + error352, err = error351.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error352 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addZone failed: invalid message type") + return + } + result := MetaServiceAddZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZone(req *DropZoneReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropZone(req); err != nil { return } + return p.recvDropZone() +} + +func (p *MetaServiceThreadsafeClient) sendDropZone(req *DropZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error353 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error354 error + error354, err = error353.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error354 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropZone failed: invalid message type") + return + } + result := MetaServiceDropZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHostIntoZone(req *AddHostIntoZoneReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddHostIntoZone(req); err != nil { return } + return p.recvAddHostIntoZone() +} + +func (p *MetaServiceThreadsafeClient) sendAddHostIntoZone(req *AddHostIntoZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addHostIntoZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addHostIntoZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addHostIntoZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addHostIntoZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error355 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error356 error + error356, err = error355.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error356 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addHostIntoZone failed: invalid message type") + return + } + result := MetaServiceAddHostIntoZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropHostFromZone(req *DropHostFromZoneReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropHostFromZone(req); err != nil { return } + return p.recvDropHostFromZone() +} + +func (p *MetaServiceThreadsafeClient) sendDropHostFromZone(req *DropHostFromZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropHostFromZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropHostFromZone() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropHostFromZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropHostFromZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropHostFromZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error357 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error358 error + error358, err = error357.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error358 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropHostFromZone failed: invalid message type") + return + } + result := MetaServiceDropHostFromZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetZone(req *GetZoneReq) (r *GetZoneResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetZone(req); err != nil { return } + return p.recvGetZone() +} + +func (p *MetaServiceThreadsafeClient) sendGetZone(req *GetZoneReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getZone", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetZoneArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetZone() (value *GetZoneResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getZone" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getZone failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getZone failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error359 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error360 error + error360, err = error359.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error360 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getZone failed: invalid message type") + return + } + result := MetaServiceGetZoneResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListZones(req *ListZonesReq) (r *ListZonesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListZones(req); err != nil { return } + return p.recvListZones() +} + +func (p *MetaServiceThreadsafeClient) sendListZones(req *ListZonesReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listZones", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListZonesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListZones() (value *ListZonesResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listZones" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listZones failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listZones failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error361 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error362 error + error362, err = error361.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error362 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listZones failed: invalid message type") + return + } + result := MetaServiceListZonesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddGroup(req *AddGroupReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddGroup(req); err != nil { return } + return p.recvAddGroup() +} + +func (p *MetaServiceThreadsafeClient) sendAddGroup(req *AddGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAddGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error363 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error364 error + error364, err = error363.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error364 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addGroup failed: invalid message type") + return + } + result := MetaServiceAddGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropGroup(req *DropGroupReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropGroup(req); err != nil { return } + return p.recvDropGroup() +} + +func (p *MetaServiceThreadsafeClient) sendDropGroup(req *DropGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error365 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error366 error + error366, err = error365.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error366 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropGroup failed: invalid message type") + return + } + result := MetaServiceDropGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddZoneIntoGroup(req); err != nil { return } + return p.recvAddZoneIntoGroup() +} + +func (p *MetaServiceThreadsafeClient) sendAddZoneIntoGroup(req *AddZoneIntoGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addZoneIntoGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addZoneIntoGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addZoneIntoGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addZoneIntoGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error367 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error368 error + error368, err = error367.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error368 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addZoneIntoGroup failed: invalid message type") + return + } + result := MetaServiceAddZoneIntoGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropZoneFromGroup(req); err != nil { return } + return p.recvDropZoneFromGroup() +} + +func (p *MetaServiceThreadsafeClient) sendDropZoneFromGroup(req *DropZoneFromGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropZoneFromGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropZoneFromGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropZoneFromGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropZoneFromGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error369 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error370 error + error370, err = error369.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error370 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropZoneFromGroup failed: invalid message type") + return + } + result := MetaServiceDropZoneFromGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetGroup(req *GetGroupReq) (r *GetGroupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetGroup(req); err != nil { return } + return p.recvGetGroup() +} + +func (p *MetaServiceThreadsafeClient) sendGetGroup(req *GetGroupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getGroup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetGroupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetGroup() (value *GetGroupResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getGroup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getGroup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getGroup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error371 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error372 error + error372, err = error371.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error372 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getGroup failed: invalid message type") + return + } + result := MetaServiceGetGroupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListGroups(req *ListGroupsReq) (r *ListGroupsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListGroups(req); err != nil { return } + return p.recvListGroups() +} + +func (p *MetaServiceThreadsafeClient) sendListGroups(req *ListGroupsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listGroups", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListGroupsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListGroups() (value *ListGroupsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listGroups" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listGroups failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listGroups failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error373 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error374 error + error374, err = error373.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error374 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listGroups failed: invalid message type") + return + } + result := MetaServiceListGroupsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateBackup(req *CreateBackupReq) (r *CreateBackupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateBackup(req); err != nil { return } + return p.recvCreateBackup() +} + +func (p *MetaServiceThreadsafeClient) sendCreateBackup(req *CreateBackupReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createBackup", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateBackupArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateBackup() (value *CreateBackupResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createBackup" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createBackup failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createBackup failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error375 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error376 error + error376, err = error375.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error376 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createBackup failed: invalid message type") + return + } + result := MetaServiceCreateBackupResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRestoreMeta(req); err != nil { return } + return p.recvRestoreMeta() +} + +func (p *MetaServiceThreadsafeClient) sendRestoreMeta(req *RestoreMetaReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("restoreMeta", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "restoreMeta" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "restoreMeta failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "restoreMeta failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error377 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error378 error + error378, err = error377.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error378 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "restoreMeta failed: invalid message type") + return + } + result := MetaServiceRestoreMetaResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddListener(req *AddListenerReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddListener(req); err != nil { return } + return p.recvAddListener() +} + +func (p *MetaServiceThreadsafeClient) sendAddListener(req *AddListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceAddListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvAddListener() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error379 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error380 error + error380, err = error379.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error380 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addListener failed: invalid message type") + return + } + result := MetaServiceAddListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveListener(req *RemoveListenerReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemoveListener(req); err != nil { return } + return p.recvRemoveListener() +} + +func (p *MetaServiceThreadsafeClient) sendRemoveListener(req *RemoveListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveListener() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error381 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error382 error + error382, err = error381.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error382 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeListener failed: invalid message type") + return + } + result := MetaServiceRemoveListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListListener(req *ListListenerReq) (r *ListListenerResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListListener(req); err != nil { return } + return p.recvListListener() +} + +func (p *MetaServiceThreadsafeClient) sendListListener(req *ListListenerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listListener", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListListenerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListListener() (value *ListListenerResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listListener" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listListener failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listListener failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error383 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error384 error + error384, err = error383.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error384 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listListener failed: invalid message type") + return + } + result := MetaServiceListListenerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetStatis(req *GetStatisReq) (r *GetStatisResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetStatis(req); err != nil { return } + return p.recvGetStatis() +} + +func (p *MetaServiceThreadsafeClient) sendGetStatis(req *GetStatisReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getStatis", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetStatisArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetStatis() (value *GetStatisResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getStatis" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getStatis failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getStatis failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error385 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error386 error + error386, err = error385.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error386 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getStatis failed: invalid message type") + return + } + result := MetaServiceGetStatisResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignInFTService(req *SignInFTServiceReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendSignInFTService(req); err != nil { return } + return p.recvSignInFTService() +} + +func (p *MetaServiceThreadsafeClient) sendSignInFTService(req *SignInFTServiceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signInFTService", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvSignInFTService() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "signInFTService" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "signInFTService failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "signInFTService failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error387 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error388 error + error388, err = error387.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error388 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "signInFTService failed: invalid message type") + return + } + result := MetaServiceSignInFTServiceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignOutFTService(req *SignOutFTServiceReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendSignOutFTService(req); err != nil { return } + return p.recvSignOutFTService() +} + +func (p *MetaServiceThreadsafeClient) sendSignOutFTService(req *SignOutFTServiceReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("signOutFTService", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvSignOutFTService() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "signOutFTService" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "signOutFTService failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "signOutFTService failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error389 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error390 error + error390, err = error389.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error390 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "signOutFTService failed: invalid message type") + return + } + result := MetaServiceSignOutFTServiceResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTClients(req *ListFTClientsReq) (r *ListFTClientsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListFTClients(req); err != nil { return } + return p.recvListFTClients() +} + +func (p *MetaServiceThreadsafeClient) sendListFTClients(req *ListFTClientsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listFTClients", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListFTClientsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTClients() (value *ListFTClientsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listFTClients" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listFTClients failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listFTClients failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error391 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error392 error + error392, err = error391.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error392 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listFTClients failed: invalid message type") + return + } + result := MetaServiceListFTClientsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSession(req *CreateSessionReq) (r *CreateSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateSession(req); err != nil { return } + return p.recvCreateSession() +} + +func (p *MetaServiceThreadsafeClient) sendCreateSession(req *CreateSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceCreateSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSession() (value *CreateSessionResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error393 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error394 error + error394, err = error393.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error394 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createSession failed: invalid message type") + return + } + result := MetaServiceCreateSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) UpdateSessions(req *UpdateSessionsReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendUpdateSessions(req); err != nil { return } + return p.recvUpdateSessions() +} + +func (p *MetaServiceThreadsafeClient) sendUpdateSessions(req *UpdateSessionsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateSessions", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvUpdateSessions() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateSessions" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateSessions failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateSessions failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error395 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error396 error + error396, err = error395.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error396 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateSessions failed: invalid message type") + return + } + result := MetaServiceUpdateSessionsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSessions(req *ListSessionsReq) (r *ListSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendListSessions(req); err != nil { return } + return p.recvListSessions() +} + +func (p *MetaServiceThreadsafeClient) sendListSessions(req *ListSessionsReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("listSessions", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceListSessionsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvListSessions() (value *ListSessionsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "listSessions" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "listSessions failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "listSessions failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error397 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error398 error + error398, err = error397.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error398 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listSessions failed: invalid message type") + return + } + result := MetaServiceListSessionsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSession(req *GetSessionReq) (r *GetSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetSession(req); err != nil { return } + return p.recvGetSession() +} + +func (p *MetaServiceThreadsafeClient) sendGetSession(req *GetSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceGetSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSession() (value *GetSessionResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error399 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error400 error + error400, err = error399.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error400 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getSession failed: invalid message type") + return + } + result := MetaServiceGetSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveSession(req *RemoveSessionReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemoveSession(req); err != nil { return } + return p.recvRemoveSession() +} + +func (p *MetaServiceThreadsafeClient) sendRemoveSession(req *RemoveSessionReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removeSession", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveSession() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removeSession" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removeSession failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removeSession failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error401 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error402 error + error402, err = error401.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error402 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removeSession failed: invalid message type") + return + } + result := MetaServiceRemoveSessionResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ReportTaskFinish(req *ReportTaskReq) (r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendReportTaskFinish(req); err != nil { return } + return p.recvReportTaskFinish() +} + +func (p *MetaServiceThreadsafeClient) sendReportTaskFinish(req *ReportTaskReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("reportTaskFinish", thrift.CALL, p.SeqId); err != nil { + return + } + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *MetaServiceThreadsafeClient) recvReportTaskFinish() (value *ExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "reportTaskFinish" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "reportTaskFinish failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "reportTaskFinish failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error403 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error404 error + error404, err = error403.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error404 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "reportTaskFinish failed: invalid message type") + return + } + result := MetaServiceReportTaskFinishResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type MetaServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunction + handler MetaService +} + +func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *MetaServiceProcessor) GetProcessorFunction(key string) (processor thrift.ProcessorFunction, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunction { + return p.processorMap +} + +func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { + self405 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunction)} + self405.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self405.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self405.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self405.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self405.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self405.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self405.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self405.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self405.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self405.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self405.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self405.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self405.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self405.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self405.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self405.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self405.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self405.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} + self405.processorMap["get"] = &metaServiceProcessorGet{handler:handler} + self405.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} + self405.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} + self405.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} + self405.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} + self405.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self405.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self405.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self405.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self405.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self405.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self405.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self405.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self405.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self405.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self405.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self405.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self405.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self405.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self405.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self405.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self405.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self405.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self405.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self405.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self405.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self405.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self405.processorMap["balance"] = &metaServiceProcessorBalance{handler:handler} + self405.processorMap["leaderBalance"] = &metaServiceProcessorLeaderBalance{handler:handler} + self405.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self405.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self405.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self405.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self405.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self405.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self405.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self405.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self405.processorMap["addZone"] = &metaServiceProcessorAddZone{handler:handler} + self405.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self405.processorMap["addHostIntoZone"] = &metaServiceProcessorAddHostIntoZone{handler:handler} + self405.processorMap["dropHostFromZone"] = &metaServiceProcessorDropHostFromZone{handler:handler} + self405.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self405.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self405.processorMap["addGroup"] = &metaServiceProcessorAddGroup{handler:handler} + self405.processorMap["dropGroup"] = &metaServiceProcessorDropGroup{handler:handler} + self405.processorMap["addZoneIntoGroup"] = &metaServiceProcessorAddZoneIntoGroup{handler:handler} + self405.processorMap["dropZoneFromGroup"] = &metaServiceProcessorDropZoneFromGroup{handler:handler} + self405.processorMap["getGroup"] = &metaServiceProcessorGetGroup{handler:handler} + self405.processorMap["listGroups"] = &metaServiceProcessorListGroups{handler:handler} + self405.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self405.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self405.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self405.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self405.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self405.processorMap["getStatis"] = &metaServiceProcessorGetStatis{handler:handler} + self405.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} + self405.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} + self405.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} + self405.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self405.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self405.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self405.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self405.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self405.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + return self405 +} + +type metaServiceProcessorCreateSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSpace) 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("createSpace", 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 *metaServiceProcessorCreateSpace) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSpaceArgs) + var result MetaServiceCreateSpaceResult + if retval, err := p.handler.CreateSpace(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSpace) 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("dropSpace", 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 *metaServiceProcessorDropSpace) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSpaceArgs) + var result MetaServiceDropSpaceResult + if retval, err := p.handler.DropSpace(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSpace) 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("getSpace", 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 *metaServiceProcessorGetSpace) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSpaceArgs) + var result MetaServiceGetSpaceResult + if retval, err := p.handler.GetSpace(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSpaces struct { + handler MetaService +} + +func (p *metaServiceProcessorListSpaces) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSpacesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSpaces) 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("listSpaces", 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 *metaServiceProcessorListSpaces) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSpacesArgs) + var result MetaServiceListSpacesResult + if retval, err := p.handler.ListSpaces(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSpaces: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTag struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTag) 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("createTag", 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 *metaServiceProcessorCreateTag) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagArgs) + var result MetaServiceCreateTagResult + if retval, err := p.handler.CreateTag(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterTag struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterTag) 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("alterTag", 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 *metaServiceProcessorAlterTag) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterTagArgs) + var result MetaServiceAlterTagResult + if retval, err := p.handler.AlterTag(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTag struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTag) 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("dropTag", 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 *metaServiceProcessorDropTag) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagArgs) + var result MetaServiceDropTagResult + if retval, err := p.handler.DropTag(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTag struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTag) 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("getTag", 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 *metaServiceProcessorGetTag) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagArgs) + var result MetaServiceGetTagResult + if retval, err := p.handler.GetTag(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTags struct { + handler MetaService +} + +func (p *metaServiceProcessorListTags) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTags) 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("listTags", 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 *metaServiceProcessorListTags) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagsArgs) + var result MetaServiceListTagsResult + if retval, err := p.handler.ListTags(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTags: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdge) 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("createEdge", 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 *metaServiceProcessorCreateEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeArgs) + var result MetaServiceCreateEdgeResult + if retval, err := p.handler.CreateEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterEdge) 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("alterEdge", 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 *metaServiceProcessorAlterEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterEdgeArgs) + var result MetaServiceAlterEdgeResult + if retval, err := p.handler.AlterEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdge) 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("dropEdge", 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 *metaServiceProcessorDropEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeArgs) + var result MetaServiceDropEdgeResult + if retval, err := p.handler.DropEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdge) 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("getEdge", 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 *metaServiceProcessorGetEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeArgs) + var result MetaServiceGetEdgeResult + if retval, err := p.handler.GetEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdges struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdges) 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("listEdges", 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 *metaServiceProcessorListEdges) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgesArgs) + var result MetaServiceListEdgesResult + if retval, err := p.handler.ListEdges(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorListHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListHosts) 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("listHosts", 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 *metaServiceProcessorListHosts) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListHostsArgs) + var result MetaServiceListHostsResult + if retval, err := p.handler.ListHosts(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetPartsAlloc struct { + handler MetaService +} + +func (p *metaServiceProcessorGetPartsAlloc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetPartsAllocArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetPartsAlloc) 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("getPartsAlloc", 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 *metaServiceProcessorGetPartsAlloc) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetPartsAllocArgs) + var result MetaServiceGetPartsAllocResult + if retval, err := p.handler.GetPartsAlloc(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartsAlloc: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListParts struct { + handler MetaService +} + +func (p *metaServiceProcessorListParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListParts) 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("listParts", 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 *metaServiceProcessorListParts) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListPartsArgs) + var result MetaServiceListPartsResult + if retval, err := p.handler.ListParts(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiPut struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiPutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiPut) 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("multiPut", 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 *metaServiceProcessorMultiPut) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiPutArgs) + var result MetaServiceMultiPutResult + if retval, err := p.handler.MultiPut(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiPut: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGet struct { + handler MetaService +} + +func (p *metaServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorGet) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetArgs) + var result MetaServiceGetResult + if retval, err := p.handler.Get(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiGet struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiGet) 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("multiGet", 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 *metaServiceProcessorMultiGet) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiGetArgs) + var result MetaServiceMultiGetResult + if retval, err := p.handler.MultiGet(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiGet: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemove struct { + handler MetaService +} + +func (p *metaServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorRemove) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveArgs) + var result MetaServiceRemoveResult + if retval, err := p.handler.Remove(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveRange struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveRange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveRangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveRange) 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("removeRange", 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 *metaServiceProcessorRemoveRange) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveRangeArgs) + var result MetaServiceRemoveRangeResult + if retval, err := p.handler.RemoveRange(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeRange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorScan struct { + handler MetaService +} + +func (p *metaServiceProcessorScan) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceScanArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorScan) 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("scan", 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 *metaServiceProcessorScan) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceScanArgs) + var result MetaServiceScanResult + if retval, err := p.handler.Scan(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTagIndex) 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("createTagIndex", 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 *metaServiceProcessorCreateTagIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagIndexArgs) + var result MetaServiceCreateTagIndexResult + if retval, err := p.handler.CreateTagIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTagIndex) 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("dropTagIndex", 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 *metaServiceProcessorDropTagIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagIndexArgs) + var result MetaServiceDropTagIndexResult + if retval, err := p.handler.DropTagIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTagIndex) 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("getTagIndex", 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 *metaServiceProcessorGetTagIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagIndexArgs) + var result MetaServiceGetTagIndexResult + if retval, err := p.handler.GetTagIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexes) 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("listTagIndexes", 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 *metaServiceProcessorListTagIndexes) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexesArgs) + var result MetaServiceListTagIndexesResult + if retval, err := p.handler.ListTagIndexes(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *metaServiceProcessorRebuildTagIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildTagIndexArgs) + var result MetaServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexStatus) 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("listTagIndexStatus", 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 *metaServiceProcessorListTagIndexStatus) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexStatusArgs) + var result MetaServiceListTagIndexStatusResult + if retval, err := p.handler.ListTagIndexStatus(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdgeIndex) 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("createEdgeIndex", 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 *metaServiceProcessorCreateEdgeIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeIndexArgs) + var result MetaServiceCreateEdgeIndexResult + if retval, err := p.handler.CreateEdgeIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdgeIndex) 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("dropEdgeIndex", 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 *metaServiceProcessorDropEdgeIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeIndexArgs) + var result MetaServiceDropEdgeIndexResult + if retval, err := p.handler.DropEdgeIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdgeIndex) 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("getEdgeIndex", 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 *metaServiceProcessorGetEdgeIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeIndexArgs) + var result MetaServiceGetEdgeIndexResult + if retval, err := p.handler.GetEdgeIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexes) 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("listEdgeIndexes", 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 *metaServiceProcessorListEdgeIndexes) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexesArgs) + var result MetaServiceListEdgeIndexesResult + if retval, err := p.handler.ListEdgeIndexes(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *metaServiceProcessorRebuildEdgeIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildEdgeIndexArgs) + var result MetaServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexStatus) 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("listEdgeIndexStatus", 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 *metaServiceProcessorListEdgeIndexStatus) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexStatusArgs) + var result MetaServiceListEdgeIndexStatusResult + if retval, err := p.handler.ListEdgeIndexStatus(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateUser struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateUser) 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("createUser", 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 *metaServiceProcessorCreateUser) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateUserArgs) + var result MetaServiceCreateUserResult + if retval, err := p.handler.CreateUser(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropUser struct { + handler MetaService +} + +func (p *metaServiceProcessorDropUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropUser) 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("dropUser", 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 *metaServiceProcessorDropUser) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropUserArgs) + var result MetaServiceDropUserResult + if retval, err := p.handler.DropUser(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterUser struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterUser) 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("alterUser", 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 *metaServiceProcessorAlterUser) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterUserArgs) + var result MetaServiceAlterUserResult + if retval, err := p.handler.AlterUser(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGrantRole struct { + handler MetaService +} + +func (p *metaServiceProcessorGrantRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGrantRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGrantRole) 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("grantRole", 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 *metaServiceProcessorGrantRole) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGrantRoleArgs) + var result MetaServiceGrantRoleResult + if retval, err := p.handler.GrantRole(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grantRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRevokeRole struct { + handler MetaService +} + +func (p *metaServiceProcessorRevokeRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRevokeRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRevokeRole) 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("revokeRole", 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 *metaServiceProcessorRevokeRole) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRevokeRoleArgs) + var result MetaServiceRevokeRoleResult + if retval, err := p.handler.RevokeRole(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListUsers struct { + handler MetaService +} + +func (p *metaServiceProcessorListUsers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListUsersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListUsers) 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("listUsers", 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 *metaServiceProcessorListUsers) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListUsersArgs) + var result MetaServiceListUsersResult + if retval, err := p.handler.ListUsers(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listUsers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorListRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListRoles) 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("listRoles", 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 *metaServiceProcessorListRoles) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListRolesArgs) + var result MetaServiceListRolesResult + if retval, err := p.handler.ListRoles(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetUserRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorGetUserRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetUserRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetUserRoles) 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("getUserRoles", 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 *metaServiceProcessorGetUserRoles) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetUserRolesArgs) + var result MetaServiceGetUserRolesResult + if retval, err := p.handler.GetUserRoles(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUserRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorChangePassword struct { + handler MetaService +} + +func (p *metaServiceProcessorChangePassword) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceChangePasswordArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorChangePassword) 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("changePassword", 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 *metaServiceProcessorChangePassword) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceChangePasswordArgs) + var result MetaServiceChangePasswordResult + if retval, err := p.handler.ChangePassword(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changePassword: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorHeartBeat struct { + handler MetaService +} + +func (p *metaServiceProcessorHeartBeat) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceHeartBeatArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorHeartBeat) 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("heartBeat", 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 *metaServiceProcessorHeartBeat) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceHeartBeatArgs) + var result MetaServiceHeartBeatResult + if retval, err := p.handler.HeartBeat(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing heartBeat: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorBalance) 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("balance", 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 *metaServiceProcessorBalance) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceBalanceArgs) + var result MetaServiceBalanceResult + if retval, err := p.handler.Balance(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing balance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorLeaderBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorLeaderBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceLeaderBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorLeaderBalance) 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("leaderBalance", 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 *metaServiceProcessorLeaderBalance) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceLeaderBalanceArgs) + var result MetaServiceLeaderBalanceResult + if retval, err := p.handler.LeaderBalance(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing leaderBalance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRegConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorRegConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRegConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRegConfig) 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("regConfig", 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 *metaServiceProcessorRegConfig) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRegConfigArgs) + var result MetaServiceRegConfigResult + if retval, err := p.handler.RegConfig(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing regConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorGetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetConfig) 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("getConfig", 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 *metaServiceProcessorGetConfig) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetConfigArgs) + var result MetaServiceGetConfigResult + if retval, err := p.handler.GetConfig(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorSetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSetConfig) 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("setConfig", 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 *metaServiceProcessorSetConfig) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSetConfigArgs) + var result MetaServiceSetConfigResult + if retval, err := p.handler.SetConfig(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListConfigs struct { + handler MetaService +} + +func (p *metaServiceProcessorListConfigs) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListConfigsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListConfigs) 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("listConfigs", 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 *metaServiceProcessorListConfigs) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListConfigsArgs) + var result MetaServiceListConfigsResult + if retval, err := p.handler.ListConfigs(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listConfigs: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSnapshot) 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("createSnapshot", 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 *metaServiceProcessorCreateSnapshot) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSnapshotArgs) + var result MetaServiceCreateSnapshotResult + if retval, err := p.handler.CreateSnapshot(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSnapshot) 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("dropSnapshot", 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 *metaServiceProcessorDropSnapshot) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSnapshotArgs) + var result MetaServiceDropSnapshotResult + if retval, err := p.handler.DropSnapshot(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSnapshots struct { + handler MetaService +} + +func (p *metaServiceProcessorListSnapshots) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSnapshotsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSnapshots) 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("listSnapshots", 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 *metaServiceProcessorListSnapshots) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSnapshotsArgs) + var result MetaServiceListSnapshotsResult + if retval, err := p.handler.ListSnapshots(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSnapshots: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRunAdminJob struct { + handler MetaService +} + +func (p *metaServiceProcessorRunAdminJob) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRunAdminJobArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRunAdminJob) 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("runAdminJob", 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 *metaServiceProcessorRunAdminJob) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRunAdminJobArgs) + var result MetaServiceRunAdminJobResult + if retval, err := p.handler.RunAdminJob(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing runAdminJob: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddZone) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneArgs) + var result MetaServiceAddZoneResult + if retval, err := p.handler.AddZone(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZone) 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("dropZone", 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 *metaServiceProcessorDropZone) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneArgs) + var result MetaServiceDropZoneResult + if retval, err := p.handler.DropZone(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddHostIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostIntoZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHostIntoZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddHostIntoZone) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostIntoZoneArgs) + var result MetaServiceAddHostIntoZoneResult + if retval, err := p.handler.AddHostIntoZone(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostIntoZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropHostFromZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropHostFromZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("dropHostFromZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorDropHostFromZone) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropHostFromZoneArgs) + var result MetaServiceDropHostFromZoneResult + if retval, err := p.handler.DropHostFromZone(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHostFromZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetZone struct { + handler MetaService +} + +func (p *metaServiceProcessorGetZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetZone) 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("getZone", 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 *metaServiceProcessorGetZone) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetZoneArgs) + var result MetaServiceGetZoneResult + if retval, err := p.handler.GetZone(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListZones struct { + handler MetaService +} + +func (p *metaServiceProcessorListZones) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListZonesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListZones) 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("listZones", 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 *metaServiceProcessorListZones) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListZonesArgs) + var result MetaServiceListZonesResult + if retval, err := p.handler.ListZones(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listZones: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddGroup) 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("addGroup", 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 *metaServiceProcessorAddGroup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddGroupArgs) + var result MetaServiceAddGroupResult + if retval, err := p.handler.AddGroup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropGroup) 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("dropGroup", 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 *metaServiceProcessorDropGroup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropGroupArgs) + var result MetaServiceDropGroupResult + if retval, err := p.handler.DropGroup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZoneIntoGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZoneIntoGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneIntoGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZoneIntoGroup) 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("addZoneIntoGroup", 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 *metaServiceProcessorAddZoneIntoGroup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneIntoGroupArgs) + var result MetaServiceAddZoneIntoGroupResult + if retval, err := p.handler.AddZoneIntoGroup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZoneIntoGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZoneFromGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZoneFromGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneFromGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZoneFromGroup) 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("dropZoneFromGroup", 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 *metaServiceProcessorDropZoneFromGroup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneFromGroupArgs) + var result MetaServiceDropZoneFromGroupResult + if retval, err := p.handler.DropZoneFromGroup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZoneFromGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorGetGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetGroup) 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("getGroup", 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 *metaServiceProcessorGetGroup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetGroupArgs) + var result MetaServiceGetGroupResult + if retval, err := p.handler.GetGroup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListGroups struct { + handler MetaService +} + +func (p *metaServiceProcessorListGroups) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListGroupsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListGroups) 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("listGroups", 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 *metaServiceProcessorListGroups) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListGroupsArgs) + var result MetaServiceListGroupsResult + if retval, err := p.handler.ListGroups(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listGroups: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateBackup struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateBackup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateBackupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateBackup) 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("createBackup", 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 *metaServiceProcessorCreateBackup) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateBackupArgs) + var result MetaServiceCreateBackupResult + if retval, err := p.handler.CreateBackup(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createBackup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRestoreMeta struct { + handler MetaService +} + +func (p *metaServiceProcessorRestoreMeta) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRestoreMetaArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRestoreMeta) 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("restoreMeta", 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 *metaServiceProcessorRestoreMeta) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRestoreMetaArgs) + var result MetaServiceRestoreMetaResult + if retval, err := p.handler.RestoreMeta(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restoreMeta: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddListener struct { + handler MetaService +} + +func (p *metaServiceProcessorAddListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddListener) 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("addListener", 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 *metaServiceProcessorAddListener) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddListenerArgs) + var result MetaServiceAddListenerResult + if retval, err := p.handler.AddListener(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveListener struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveListener) 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("removeListener", 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 *metaServiceProcessorRemoveListener) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveListenerArgs) + var result MetaServiceRemoveListenerResult + if retval, err := p.handler.RemoveListener(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListListener struct { + handler MetaService +} + +func (p *metaServiceProcessorListListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListListener) 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("listListener", 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 *metaServiceProcessorListListener) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListListenerArgs) + var result MetaServiceListListenerResult + if retval, err := p.handler.ListListener(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetStatis struct { + handler MetaService +} + +func (p *metaServiceProcessorGetStatis) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetStatisArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetStatis) 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("getStatis", 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 *metaServiceProcessorGetStatis) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetStatisArgs) + var result MetaServiceGetStatisResult + if retval, err := p.handler.GetStatis(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStatis: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignInFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignInFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignInFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignInFTService) 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("signInFTService", 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 *metaServiceProcessorSignInFTService) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignInFTServiceArgs) + var result MetaServiceSignInFTServiceResult + if retval, err := p.handler.SignInFTService(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignOutFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignOutFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignOutFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignOutFTService) 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("signOutFTService", 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 *metaServiceProcessorSignOutFTService) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignOutFTServiceArgs) + var result MetaServiceSignOutFTServiceResult + if retval, err := p.handler.SignOutFTService(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTClients struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTClients) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTClientsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTClients) 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("listFTClients", 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 *metaServiceProcessorListFTClients) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTClientsArgs) + var result MetaServiceListFTClientsResult + if retval, err := p.handler.ListFTClients(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTClients: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSession struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSession) 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("createSession", 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 *metaServiceProcessorCreateSession) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSessionArgs) + var result MetaServiceCreateSessionResult + if retval, err := p.handler.CreateSession(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorUpdateSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorUpdateSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceUpdateSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorUpdateSessions) 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("updateSessions", 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 *metaServiceProcessorUpdateSessions) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceUpdateSessionsArgs) + var result MetaServiceUpdateSessionsResult + if retval, err := p.handler.UpdateSessions(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorListSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSessions) 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("listSessions", 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 *metaServiceProcessorListSessions) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSessionsArgs) + var result MetaServiceListSessionsResult + if retval, err := p.handler.ListSessions(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSession struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSession) 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("getSession", 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 *metaServiceProcessorGetSession) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSessionArgs) + var result MetaServiceGetSessionResult + if retval, err := p.handler.GetSession(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveSession struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveSession) 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("removeSession", 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 *metaServiceProcessorRemoveSession) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveSessionArgs) + var result MetaServiceRemoveSessionResult + if retval, err := p.handler.RemoveSession(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorReportTaskFinish struct { + handler MetaService +} + +func (p *metaServiceProcessorReportTaskFinish) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceReportTaskFinishArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorReportTaskFinish) 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("reportTaskFinish", 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 *metaServiceProcessorReportTaskFinish) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceReportTaskFinishArgs) + var result MetaServiceReportTaskFinishResult + if retval, err := p.handler.ReportTaskFinish(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reportTaskFinish: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type MetaServiceCreateSpaceArgs struct { + Req *CreateSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceArgs() *MetaServiceCreateSpaceArgs { + return &MetaServiceCreateSpaceArgs{} +} + +var MetaServiceCreateSpaceArgs_Req_DEFAULT *CreateSpaceReq +func (p *MetaServiceCreateSpaceArgs) GetReq() *CreateSpaceReq { + if !p.IsSetReq() { + return MetaServiceCreateSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSpaceResult() *MetaServiceCreateSpaceResult { + return &MetaServiceCreateSpaceResult{} +} + +var MetaServiceCreateSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSpaceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropSpaceArgs struct { + Req *DropSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSpaceArgs() *MetaServiceDropSpaceArgs { + return &MetaServiceDropSpaceArgs{} +} + +var MetaServiceDropSpaceArgs_Req_DEFAULT *DropSpaceReq +func (p *MetaServiceDropSpaceArgs) GetReq() *DropSpaceReq { + if !p.IsSetReq() { + return MetaServiceDropSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropSpaceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSpaceResult() *MetaServiceDropSpaceResult { + return &MetaServiceDropSpaceResult{} +} + +var MetaServiceDropSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropSpaceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetSpaceArgs struct { + Req *GetSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSpaceArgs() *MetaServiceGetSpaceArgs { + return &MetaServiceGetSpaceArgs{} +} + +var MetaServiceGetSpaceArgs_Req_DEFAULT *GetSpaceReq +func (p *MetaServiceGetSpaceArgs) GetReq() *GetSpaceReq { + if !p.IsSetReq() { + return MetaServiceGetSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetSpaceResult struct { + Success *GetSpaceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSpaceResult() *MetaServiceGetSpaceResult { + return &MetaServiceGetSpaceResult{} +} + +var MetaServiceGetSpaceResult_Success_DEFAULT *GetSpaceResp +func (p *MetaServiceGetSpaceResult) GetSuccess() *GetSpaceResp { + if !p.IsSetSuccess() { + return MetaServiceGetSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSpaceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSpaceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListSpacesArgs struct { + Req *ListSpacesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSpacesArgs() *MetaServiceListSpacesArgs { + return &MetaServiceListSpacesArgs{} +} + +var MetaServiceListSpacesArgs_Req_DEFAULT *ListSpacesReq +func (p *MetaServiceListSpacesArgs) GetReq() *ListSpacesReq { + if !p.IsSetReq() { + return MetaServiceListSpacesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSpacesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSpacesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSpacesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListSpacesResult struct { + Success *ListSpacesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSpacesResult() *MetaServiceListSpacesResult { + return &MetaServiceListSpacesResult{} +} + +var MetaServiceListSpacesResult_Success_DEFAULT *ListSpacesResp +func (p *MetaServiceListSpacesResult) GetSuccess() *ListSpacesResp { + if !p.IsSetSuccess() { + return MetaServiceListSpacesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSpacesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSpacesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSpacesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateTagArgs struct { + Req *CreateTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagArgs() *MetaServiceCreateTagArgs { + return &MetaServiceCreateTagArgs{} +} + +var MetaServiceCreateTagArgs_Req_DEFAULT *CreateTagReq +func (p *MetaServiceCreateTagArgs) GetReq() *CreateTagReq { + if !p.IsSetReq() { + return MetaServiceCreateTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateTagArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateTagResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagResult() *MetaServiceCreateTagResult { + return &MetaServiceCreateTagResult{} +} + +var MetaServiceCreateTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateTagResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAlterTagArgs struct { + Req *AlterTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterTagArgs() *MetaServiceAlterTagArgs { + return &MetaServiceAlterTagArgs{} +} + +var MetaServiceAlterTagArgs_Req_DEFAULT *AlterTagReq +func (p *MetaServiceAlterTagArgs) GetReq() *AlterTagReq { + if !p.IsSetReq() { + return MetaServiceAlterTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterTagArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterTagArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAlterTagResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterTagResult() *MetaServiceAlterTagResult { + return &MetaServiceAlterTagResult{} +} + +var MetaServiceAlterTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterTagResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterTagResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropTagArgs struct { + Req *DropTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagArgs() *MetaServiceDropTagArgs { + return &MetaServiceDropTagArgs{} +} + +var MetaServiceDropTagArgs_Req_DEFAULT *DropTagReq +func (p *MetaServiceDropTagArgs) GetReq() *DropTagReq { + if !p.IsSetReq() { + return MetaServiceDropTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropTagArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropTagResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagResult() *MetaServiceDropTagResult { + return &MetaServiceDropTagResult{} +} + +var MetaServiceDropTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropTagResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetTagArgs struct { + Req *GetTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagArgs() *MetaServiceGetTagArgs { + return &MetaServiceGetTagArgs{} +} + +var MetaServiceGetTagArgs_Req_DEFAULT *GetTagReq +func (p *MetaServiceGetTagArgs) GetReq() *GetTagReq { + if !p.IsSetReq() { + return MetaServiceGetTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetTagArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetTagResult struct { + Success *GetTagResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagResult() *MetaServiceGetTagResult { + return &MetaServiceGetTagResult{} +} + +var MetaServiceGetTagResult_Success_DEFAULT *GetTagResp +func (p *MetaServiceGetTagResult) GetSuccess() *GetTagResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetTagResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListTagsArgs struct { + Req *ListTagsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagsArgs() *MetaServiceListTagsArgs { + return &MetaServiceListTagsArgs{} +} + +var MetaServiceListTagsArgs_Req_DEFAULT *ListTagsReq +func (p *MetaServiceListTagsArgs) GetReq() *ListTagsReq { + if !p.IsSetReq() { + return MetaServiceListTagsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListTagsResult struct { + Success *ListTagsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagsResult() *MetaServiceListTagsResult { + return &MetaServiceListTagsResult{} +} + +var MetaServiceListTagsResult_Success_DEFAULT *ListTagsResp +func (p *MetaServiceListTagsResult) GetSuccess() *ListTagsResp { + if !p.IsSetSuccess() { + return MetaServiceListTagsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeArgs struct { + Req *CreateEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeArgs() *MetaServiceCreateEdgeArgs { + return &MetaServiceCreateEdgeArgs{} +} + +var MetaServiceCreateEdgeArgs_Req_DEFAULT *CreateEdgeReq +func (p *MetaServiceCreateEdgeArgs) GetReq() *CreateEdgeReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeResult() *MetaServiceCreateEdgeResult { + return &MetaServiceCreateEdgeResult{} +} + +var MetaServiceCreateEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAlterEdgeArgs struct { + Req *AlterEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterEdgeArgs() *MetaServiceAlterEdgeArgs { + return &MetaServiceAlterEdgeArgs{} +} + +var MetaServiceAlterEdgeArgs_Req_DEFAULT *AlterEdgeReq +func (p *MetaServiceAlterEdgeArgs) GetReq() *AlterEdgeReq { + if !p.IsSetReq() { + return MetaServiceAlterEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAlterEdgeResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterEdgeResult() *MetaServiceAlterEdgeResult { + return &MetaServiceAlterEdgeResult{} +} + +var MetaServiceAlterEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeArgs struct { + Req *DropEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeArgs() *MetaServiceDropEdgeArgs { + return &MetaServiceDropEdgeArgs{} +} + +var MetaServiceDropEdgeArgs_Req_DEFAULT *DropEdgeReq +func (p *MetaServiceDropEdgeArgs) GetReq() *DropEdgeReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeResult() *MetaServiceDropEdgeResult { + return &MetaServiceDropEdgeResult{} +} + +var MetaServiceDropEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeArgs struct { + Req *GetEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeArgs() *MetaServiceGetEdgeArgs { + return &MetaServiceGetEdgeArgs{} +} + +var MetaServiceGetEdgeArgs_Req_DEFAULT *GetEdgeReq +func (p *MetaServiceGetEdgeArgs) GetReq() *GetEdgeReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeResult struct { + Success *GetEdgeResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeResult() *MetaServiceGetEdgeResult { + return &MetaServiceGetEdgeResult{} +} + +var MetaServiceGetEdgeResult_Success_DEFAULT *GetEdgeResp +func (p *MetaServiceGetEdgeResult) GetSuccess() *GetEdgeResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListEdgesArgs struct { + Req *ListEdgesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgesArgs() *MetaServiceListEdgesArgs { + return &MetaServiceListEdgesArgs{} +} + +var MetaServiceListEdgesArgs_Req_DEFAULT *ListEdgesReq +func (p *MetaServiceListEdgesArgs) GetReq() *ListEdgesReq { + if !p.IsSetReq() { + return MetaServiceListEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListEdgesResult struct { + Success *ListEdgesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgesResult() *MetaServiceListEdgesResult { + return &MetaServiceListEdgesResult{} +} + +var MetaServiceListEdgesResult_Success_DEFAULT *ListEdgesResp +func (p *MetaServiceListEdgesResult) GetSuccess() *ListEdgesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListHostsArgs struct { + Req *ListHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListHostsArgs() *MetaServiceListHostsArgs { + return &MetaServiceListHostsArgs{} +} + +var MetaServiceListHostsArgs_Req_DEFAULT *ListHostsReq +func (p *MetaServiceListHostsArgs) GetReq() *ListHostsReq { + if !p.IsSetReq() { + return MetaServiceListHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListHostsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListHostsResult struct { + Success *ListHostsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListHostsResult() *MetaServiceListHostsResult { + return &MetaServiceListHostsResult{} +} + +var MetaServiceListHostsResult_Success_DEFAULT *ListHostsResp +func (p *MetaServiceListHostsResult) GetSuccess() *ListHostsResp { + if !p.IsSetSuccess() { + return MetaServiceListHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListHostsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListHostsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetPartsAllocArgs struct { + Req *GetPartsAllocReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetPartsAllocArgs() *MetaServiceGetPartsAllocArgs { + return &MetaServiceGetPartsAllocArgs{} +} + +var MetaServiceGetPartsAllocArgs_Req_DEFAULT *GetPartsAllocReq +func (p *MetaServiceGetPartsAllocArgs) GetReq() *GetPartsAllocReq { + if !p.IsSetReq() { + return MetaServiceGetPartsAllocArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetPartsAllocArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPartsAllocReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetPartsAllocArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetPartsAllocResult struct { + Success *GetPartsAllocResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetPartsAllocResult() *MetaServiceGetPartsAllocResult { + return &MetaServiceGetPartsAllocResult{} +} + +var MetaServiceGetPartsAllocResult_Success_DEFAULT *GetPartsAllocResp +func (p *MetaServiceGetPartsAllocResult) GetSuccess() *GetPartsAllocResp { + if !p.IsSetSuccess() { + return MetaServiceGetPartsAllocResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetPartsAllocResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPartsAllocResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetPartsAllocResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListPartsArgs struct { + Req *ListPartsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListPartsArgs() *MetaServiceListPartsArgs { + return &MetaServiceListPartsArgs{} +} + +var MetaServiceListPartsArgs_Req_DEFAULT *ListPartsReq +func (p *MetaServiceListPartsArgs) GetReq() *ListPartsReq { + if !p.IsSetReq() { + return MetaServiceListPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListPartsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListPartsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListPartsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListPartsResult struct { + Success *ListPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListPartsResult() *MetaServiceListPartsResult { + return &MetaServiceListPartsResult{} +} + +var MetaServiceListPartsResult_Success_DEFAULT *ListPartsResp +func (p *MetaServiceListPartsResult) GetSuccess() *ListPartsResp { + if !p.IsSetSuccess() { + return MetaServiceListPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListPartsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListPartsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceMultiPutArgs struct { + Req *MultiPutReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiPutArgs() *MetaServiceMultiPutArgs { + return &MetaServiceMultiPutArgs{} +} + +var MetaServiceMultiPutArgs_Req_DEFAULT *MultiPutReq +func (p *MetaServiceMultiPutArgs) GetReq() *MultiPutReq { + if !p.IsSetReq() { + return MetaServiceMultiPutArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiPutArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiPutReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiPutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMultiPutArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceMultiPutResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiPutResult() *MetaServiceMultiPutResult { + return &MetaServiceMultiPutResult{} +} + +var MetaServiceMultiPutResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMultiPutResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceMultiPutResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiPutResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiPutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMultiPutResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetArgs struct { + Req *GetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetArgs() *MetaServiceGetArgs { + return &MetaServiceGetArgs{} +} + +var MetaServiceGetArgs_Req_DEFAULT *GetReq +func (p *MetaServiceGetArgs) GetReq() *GetReq { + if !p.IsSetReq() { + return MetaServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetResult struct { + Success *GetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetResult() *MetaServiceGetResult { + return &MetaServiceGetResult{} +} + +var MetaServiceGetResult_Success_DEFAULT *GetResp +func (p *MetaServiceGetResult) GetSuccess() *GetResp { + if !p.IsSetSuccess() { + return MetaServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceMultiGetArgs struct { + Req *MultiGetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiGetArgs() *MetaServiceMultiGetArgs { + return &MetaServiceMultiGetArgs{} +} + +var MetaServiceMultiGetArgs_Req_DEFAULT *MultiGetReq +func (p *MetaServiceMultiGetArgs) GetReq() *MultiGetReq { + if !p.IsSetReq() { + return MetaServiceMultiGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiGetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMultiGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceMultiGetResult struct { + Success *MultiGetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiGetResult() *MetaServiceMultiGetResult { + return &MetaServiceMultiGetResult{} +} + +var MetaServiceMultiGetResult_Success_DEFAULT *MultiGetResp +func (p *MetaServiceMultiGetResult) GetSuccess() *MultiGetResp { + if !p.IsSetSuccess() { + return MetaServiceMultiGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewMultiGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMultiGetResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRemoveArgs struct { + Req *RemoveReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveArgs() *MetaServiceRemoveArgs { + return &MetaServiceRemoveArgs{} +} + +var MetaServiceRemoveArgs_Req_DEFAULT *RemoveReq +func (p *MetaServiceRemoveArgs) GetReq() *RemoveReq { + if !p.IsSetReq() { + return MetaServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRemoveResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveResult() *MetaServiceRemoveResult { + return &MetaServiceRemoveResult{} +} + +var MetaServiceRemoveResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRemoveRangeArgs struct { + Req *RemoveRangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveRangeArgs() *MetaServiceRemoveRangeArgs { + return &MetaServiceRemoveRangeArgs{} +} + +var MetaServiceRemoveRangeArgs_Req_DEFAULT *RemoveRangeReq +func (p *MetaServiceRemoveRangeArgs) GetReq() *RemoveRangeReq { + if !p.IsSetReq() { + return MetaServiceRemoveRangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveRangeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveRangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveRangeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRemoveRangeResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveRangeResult() *MetaServiceRemoveRangeResult { + return &MetaServiceRemoveRangeResult{} +} + +var MetaServiceRemoveRangeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveRangeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveRangeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveRangeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveRangeResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceScanArgs struct { + Req *ScanReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceScanArgs() *MetaServiceScanArgs { + return &MetaServiceScanArgs{} +} + +var MetaServiceScanArgs_Req_DEFAULT *ScanReq +func (p *MetaServiceScanArgs) GetReq() *ScanReq { + if !p.IsSetReq() { + return MetaServiceScanArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceScanArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceScanArgs) 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 *MetaServiceScanArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceScanArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanArgs) 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 *MetaServiceScanArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceScanArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceScanResult struct { + Success *ScanResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceScanResult() *MetaServiceScanResult { + return &MetaServiceScanResult{} +} + +var MetaServiceScanResult_Success_DEFAULT *ScanResp +func (p *MetaServiceScanResult) GetSuccess() *ScanResp { + if !p.IsSetSuccess() { + return MetaServiceScanResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceScanResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceScanResult) 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 *MetaServiceScanResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceScanResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanResult) 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 *MetaServiceScanResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceScanResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateTagIndexArgs struct { + Req *CreateTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagIndexArgs() *MetaServiceCreateTagIndexArgs { + return &MetaServiceCreateTagIndexArgs{} +} + +var MetaServiceCreateTagIndexArgs_Req_DEFAULT *CreateTagIndexReq +func (p *MetaServiceCreateTagIndexArgs) GetReq() *CreateTagIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateTagIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateTagIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagIndexResult() *MetaServiceCreateTagIndexResult { + return &MetaServiceCreateTagIndexResult{} +} + +var MetaServiceCreateTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateTagIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropTagIndexArgs struct { + Req *DropTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagIndexArgs() *MetaServiceDropTagIndexArgs { + return &MetaServiceDropTagIndexArgs{} +} + +var MetaServiceDropTagIndexArgs_Req_DEFAULT *DropTagIndexReq +func (p *MetaServiceDropTagIndexArgs) GetReq() *DropTagIndexReq { + if !p.IsSetReq() { + return MetaServiceDropTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropTagIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropTagIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagIndexResult() *MetaServiceDropTagIndexResult { + return &MetaServiceDropTagIndexResult{} +} + +var MetaServiceDropTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropTagIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetTagIndexArgs struct { + Req *GetTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagIndexArgs() *MetaServiceGetTagIndexArgs { + return &MetaServiceGetTagIndexArgs{} +} + +var MetaServiceGetTagIndexArgs_Req_DEFAULT *GetTagIndexReq +func (p *MetaServiceGetTagIndexArgs) GetReq() *GetTagIndexReq { + if !p.IsSetReq() { + return MetaServiceGetTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetTagIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetTagIndexResult struct { + Success *GetTagIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagIndexResult() *MetaServiceGetTagIndexResult { + return &MetaServiceGetTagIndexResult{} +} + +var MetaServiceGetTagIndexResult_Success_DEFAULT *GetTagIndexResp +func (p *MetaServiceGetTagIndexResult) GetSuccess() *GetTagIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetTagIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexesArgs struct { + Req *ListTagIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexesArgs() *MetaServiceListTagIndexesArgs { + return &MetaServiceListTagIndexesArgs{} +} + +var MetaServiceListTagIndexesArgs_Req_DEFAULT *ListTagIndexesReq +func (p *MetaServiceListTagIndexesArgs) GetReq() *ListTagIndexesReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagIndexesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexesResult struct { + Success *ListTagIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexesResult() *MetaServiceListTagIndexesResult { + return &MetaServiceListTagIndexesResult{} +} + +var MetaServiceListTagIndexesResult_Success_DEFAULT *ListTagIndexesResp +func (p *MetaServiceListTagIndexesResult) GetSuccess() *ListTagIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagIndexesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRebuildTagIndexArgs struct { + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildTagIndexArgs() *MetaServiceRebuildTagIndexArgs { + return &MetaServiceRebuildTagIndexArgs{} +} + +var MetaServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildTagIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildTagIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRebuildTagIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRebuildTagIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildTagIndexResult() *MetaServiceRebuildTagIndexResult { + return &MetaServiceRebuildTagIndexResult{} +} + +var MetaServiceRebuildTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRebuildTagIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexStatusArgs struct { + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexStatusArgs() *MetaServiceListTagIndexStatusArgs { + return &MetaServiceListTagIndexStatusArgs{} +} + +var MetaServiceListTagIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListTagIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexStatusArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagIndexStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexStatusResult struct { + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexStatusResult() *MetaServiceListTagIndexStatusResult { + return &MetaServiceListTagIndexStatusResult{} +} + +var MetaServiceListTagIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListTagIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListTagIndexStatusResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeIndexArgs struct { + Req *CreateEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeIndexArgs() *MetaServiceCreateEdgeIndexArgs { + return &MetaServiceCreateEdgeIndexArgs{} +} + +var MetaServiceCreateEdgeIndexArgs_Req_DEFAULT *CreateEdgeIndexReq +func (p *MetaServiceCreateEdgeIndexArgs) GetReq() *CreateEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeIndexResult() *MetaServiceCreateEdgeIndexResult { + return &MetaServiceCreateEdgeIndexResult{} +} + +var MetaServiceCreateEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeIndexArgs struct { + Req *DropEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeIndexArgs() *MetaServiceDropEdgeIndexArgs { + return &MetaServiceDropEdgeIndexArgs{} +} + +var MetaServiceDropEdgeIndexArgs_Req_DEFAULT *DropEdgeIndexReq +func (p *MetaServiceDropEdgeIndexArgs) GetReq() *DropEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropEdgeIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeIndexResult() *MetaServiceDropEdgeIndexResult { + return &MetaServiceDropEdgeIndexResult{} +} + +var MetaServiceDropEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropEdgeIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeIndexArgs struct { + Req *GetEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeIndexArgs() *MetaServiceGetEdgeIndexArgs { + return &MetaServiceGetEdgeIndexArgs{} +} + +var MetaServiceGetEdgeIndexArgs_Req_DEFAULT *GetEdgeIndexReq +func (p *MetaServiceGetEdgeIndexArgs) GetReq() *GetEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetEdgeIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeIndexResult struct { + Success *GetEdgeIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeIndexResult() *MetaServiceGetEdgeIndexResult { + return &MetaServiceGetEdgeIndexResult{} +} + +var MetaServiceGetEdgeIndexResult_Success_DEFAULT *GetEdgeIndexResp +func (p *MetaServiceGetEdgeIndexResult) GetSuccess() *GetEdgeIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetEdgeIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexesArgs struct { + Req *ListEdgeIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexesArgs() *MetaServiceListEdgeIndexesArgs { + return &MetaServiceListEdgeIndexesArgs{} +} + +var MetaServiceListEdgeIndexesArgs_Req_DEFAULT *ListEdgeIndexesReq +func (p *MetaServiceListEdgeIndexesArgs) GetReq() *ListEdgeIndexesReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgeIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgeIndexesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexesResult struct { + Success *ListEdgeIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexesResult() *MetaServiceListEdgeIndexesResult { + return &MetaServiceListEdgeIndexesResult{} +} + +var MetaServiceListEdgeIndexesResult_Success_DEFAULT *ListEdgeIndexesResp +func (p *MetaServiceListEdgeIndexesResult) GetSuccess() *ListEdgeIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgeIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgeIndexesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRebuildEdgeIndexArgs struct { + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildEdgeIndexArgs() *MetaServiceRebuildEdgeIndexArgs { + return &MetaServiceRebuildEdgeIndexArgs{} +} + +var MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRebuildEdgeIndexResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildEdgeIndexResult() *MetaServiceRebuildEdgeIndexResult { + return &MetaServiceRebuildEdgeIndexResult{} +} + +var MetaServiceRebuildEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexStatusArgs struct { + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexStatusArgs() *MetaServiceListEdgeIndexStatusArgs { + return &MetaServiceListEdgeIndexStatusArgs{} +} + +var MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListEdgeIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexStatusArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexStatusResult struct { + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexStatusResult() *MetaServiceListEdgeIndexStatusResult { + return &MetaServiceListEdgeIndexStatusResult{} +} + +var MetaServiceListEdgeIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListEdgeIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateUserArgs struct { + Req *CreateUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateUserArgs() *MetaServiceCreateUserArgs { + return &MetaServiceCreateUserArgs{} +} + +var MetaServiceCreateUserArgs_Req_DEFAULT *CreateUserReq +func (p *MetaServiceCreateUserArgs) GetReq() *CreateUserReq { + if !p.IsSetReq() { + return MetaServiceCreateUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateUserArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateUserResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateUserResult() *MetaServiceCreateUserResult { + return &MetaServiceCreateUserResult{} +} + +var MetaServiceCreateUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateUserResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropUserArgs struct { + Req *DropUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropUserArgs() *MetaServiceDropUserArgs { + return &MetaServiceDropUserArgs{} +} + +var MetaServiceDropUserArgs_Req_DEFAULT *DropUserReq +func (p *MetaServiceDropUserArgs) GetReq() *DropUserReq { + if !p.IsSetReq() { + return MetaServiceDropUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropUserArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropUserResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropUserResult() *MetaServiceDropUserResult { + return &MetaServiceDropUserResult{} +} + +var MetaServiceDropUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropUserResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAlterUserArgs struct { + Req *AlterUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterUserArgs() *MetaServiceAlterUserArgs { + return &MetaServiceAlterUserArgs{} +} + +var MetaServiceAlterUserArgs_Req_DEFAULT *AlterUserReq +func (p *MetaServiceAlterUserArgs) GetReq() *AlterUserReq { + if !p.IsSetReq() { + return MetaServiceAlterUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterUserArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAlterUserResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterUserResult() *MetaServiceAlterUserResult { + return &MetaServiceAlterUserResult{} +} + +var MetaServiceAlterUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterUserResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGrantRoleArgs struct { + Req *GrantRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGrantRoleArgs() *MetaServiceGrantRoleArgs { + return &MetaServiceGrantRoleArgs{} +} + +var MetaServiceGrantRoleArgs_Req_DEFAULT *GrantRoleReq +func (p *MetaServiceGrantRoleArgs) GetReq() *GrantRoleReq { + if !p.IsSetReq() { + return MetaServiceGrantRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGrantRoleArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGrantRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGrantRoleArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGrantRoleResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGrantRoleResult() *MetaServiceGrantRoleResult { + return &MetaServiceGrantRoleResult{} +} + +var MetaServiceGrantRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceGrantRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceGrantRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGrantRoleResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGrantRoleResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRevokeRoleArgs struct { + Req *RevokeRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRevokeRoleArgs() *MetaServiceRevokeRoleArgs { + return &MetaServiceRevokeRoleArgs{} +} + +var MetaServiceRevokeRoleArgs_Req_DEFAULT *RevokeRoleReq +func (p *MetaServiceRevokeRoleArgs) GetReq() *RevokeRoleReq { + if !p.IsSetReq() { + return MetaServiceRevokeRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRevokeRoleArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRevokeRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRevokeRoleArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRevokeRoleResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRevokeRoleResult() *MetaServiceRevokeRoleResult { + return &MetaServiceRevokeRoleResult{} +} + +var MetaServiceRevokeRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRevokeRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRevokeRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRevokeRoleResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRevokeRoleResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListUsersArgs struct { + Req *ListUsersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListUsersArgs() *MetaServiceListUsersArgs { + return &MetaServiceListUsersArgs{} +} + +var MetaServiceListUsersArgs_Req_DEFAULT *ListUsersReq +func (p *MetaServiceListUsersArgs) GetReq() *ListUsersReq { + if !p.IsSetReq() { + return MetaServiceListUsersArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListUsersArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListUsersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListUsersArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListUsersResult struct { + Success *ListUsersResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListUsersResult() *MetaServiceListUsersResult { + return &MetaServiceListUsersResult{} +} + +var MetaServiceListUsersResult_Success_DEFAULT *ListUsersResp +func (p *MetaServiceListUsersResult) GetSuccess() *ListUsersResp { + if !p.IsSetSuccess() { + return MetaServiceListUsersResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListUsersResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListUsersResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListUsersResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListRolesArgs struct { + Req *ListRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListRolesArgs() *MetaServiceListRolesArgs { + return &MetaServiceListRolesArgs{} +} + +var MetaServiceListRolesArgs_Req_DEFAULT *ListRolesReq +func (p *MetaServiceListRolesArgs) GetReq() *ListRolesReq { + if !p.IsSetReq() { + return MetaServiceListRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListRolesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListRolesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListRolesResult struct { + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListRolesResult() *MetaServiceListRolesResult { + return &MetaServiceListRolesResult{} +} + +var MetaServiceListRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceListRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceListRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListRolesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListRolesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetUserRolesArgs struct { + Req *GetUserRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetUserRolesArgs() *MetaServiceGetUserRolesArgs { + return &MetaServiceGetUserRolesArgs{} +} + +var MetaServiceGetUserRolesArgs_Req_DEFAULT *GetUserRolesReq +func (p *MetaServiceGetUserRolesArgs) GetReq() *GetUserRolesReq { + if !p.IsSetReq() { + return MetaServiceGetUserRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetUserRolesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUserRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetUserRolesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetUserRolesResult struct { + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetUserRolesResult() *MetaServiceGetUserRolesResult { + return &MetaServiceGetUserRolesResult{} +} + +var MetaServiceGetUserRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceGetUserRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceGetUserRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetUserRolesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetUserRolesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceChangePasswordArgs struct { + Req *ChangePasswordReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceChangePasswordArgs() *MetaServiceChangePasswordArgs { + return &MetaServiceChangePasswordArgs{} +} + +var MetaServiceChangePasswordArgs_Req_DEFAULT *ChangePasswordReq +func (p *MetaServiceChangePasswordArgs) GetReq() *ChangePasswordReq { + if !p.IsSetReq() { + return MetaServiceChangePasswordArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceChangePasswordArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewChangePasswordReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceChangePasswordArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceChangePasswordResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceChangePasswordResult() *MetaServiceChangePasswordResult { + return &MetaServiceChangePasswordResult{} +} + +var MetaServiceChangePasswordResult_Success_DEFAULT *ExecResp +func (p *MetaServiceChangePasswordResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceChangePasswordResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceChangePasswordResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceChangePasswordResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceHeartBeatArgs struct { + Req *HBReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceHeartBeatArgs() *MetaServiceHeartBeatArgs { + return &MetaServiceHeartBeatArgs{} +} + +var MetaServiceHeartBeatArgs_Req_DEFAULT *HBReq +func (p *MetaServiceHeartBeatArgs) GetReq() *HBReq { + if !p.IsSetReq() { + return MetaServiceHeartBeatArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceHeartBeatArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewHBReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceHeartBeatArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceHeartBeatResult struct { + Success *HBResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceHeartBeatResult() *MetaServiceHeartBeatResult { + return &MetaServiceHeartBeatResult{} +} + +var MetaServiceHeartBeatResult_Success_DEFAULT *HBResp +func (p *MetaServiceHeartBeatResult) GetSuccess() *HBResp { + if !p.IsSetSuccess() { + return MetaServiceHeartBeatResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceHeartBeatResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewHBResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceHeartBeatResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceBalanceArgs struct { + Req *BalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceBalanceArgs() *MetaServiceBalanceArgs { + return &MetaServiceBalanceArgs{} +} + +var MetaServiceBalanceArgs_Req_DEFAULT *BalanceReq +func (p *MetaServiceBalanceArgs) GetReq() *BalanceReq { + if !p.IsSetReq() { + return MetaServiceBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceBalanceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceBalanceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceBalanceResult struct { + Success *BalanceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceBalanceResult() *MetaServiceBalanceResult { + return &MetaServiceBalanceResult{} +} + +var MetaServiceBalanceResult_Success_DEFAULT *BalanceResp +func (p *MetaServiceBalanceResult) GetSuccess() *BalanceResp { + if !p.IsSetSuccess() { + return MetaServiceBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceBalanceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewBalanceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceBalanceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceLeaderBalanceArgs struct { + Req *LeaderBalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceLeaderBalanceArgs() *MetaServiceLeaderBalanceArgs { + return &MetaServiceLeaderBalanceArgs{} +} + +var MetaServiceLeaderBalanceArgs_Req_DEFAULT *LeaderBalanceReq +func (p *MetaServiceLeaderBalanceArgs) GetReq() *LeaderBalanceReq { + if !p.IsSetReq() { + return MetaServiceLeaderBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceLeaderBalanceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLeaderBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceLeaderBalanceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceLeaderBalanceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceLeaderBalanceResult() *MetaServiceLeaderBalanceResult { + return &MetaServiceLeaderBalanceResult{} +} + +var MetaServiceLeaderBalanceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceLeaderBalanceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceLeaderBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceLeaderBalanceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceLeaderBalanceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRegConfigArgs struct { + Req *RegConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRegConfigArgs() *MetaServiceRegConfigArgs { + return &MetaServiceRegConfigArgs{} +} + +var MetaServiceRegConfigArgs_Req_DEFAULT *RegConfigReq +func (p *MetaServiceRegConfigArgs) GetReq() *RegConfigReq { + if !p.IsSetReq() { + return MetaServiceRegConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRegConfigArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRegConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRegConfigArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRegConfigResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRegConfigResult() *MetaServiceRegConfigResult { + return &MetaServiceRegConfigResult{} +} + +var MetaServiceRegConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRegConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRegConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRegConfigResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRegConfigResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetConfigArgs struct { + Req *GetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetConfigArgs() *MetaServiceGetConfigArgs { + return &MetaServiceGetConfigArgs{} +} + +var MetaServiceGetConfigArgs_Req_DEFAULT *GetConfigReq +func (p *MetaServiceGetConfigArgs) GetReq() *GetConfigReq { + if !p.IsSetReq() { + return MetaServiceGetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetConfigArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetConfigArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetConfigResult struct { + Success *GetConfigResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetConfigResult() *MetaServiceGetConfigResult { + return &MetaServiceGetConfigResult{} +} + +var MetaServiceGetConfigResult_Success_DEFAULT *GetConfigResp +func (p *MetaServiceGetConfigResult) GetSuccess() *GetConfigResp { + if !p.IsSetSuccess() { + return MetaServiceGetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetConfigResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetConfigResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetConfigResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSetConfigArgs struct { + Req *SetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSetConfigArgs() *MetaServiceSetConfigArgs { + return &MetaServiceSetConfigArgs{} +} + +var MetaServiceSetConfigArgs_Req_DEFAULT *SetConfigReq +func (p *MetaServiceSetConfigArgs) GetReq() *SetConfigReq { + if !p.IsSetReq() { + return MetaServiceSetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSetConfigArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSetConfigArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSetConfigResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSetConfigResult() *MetaServiceSetConfigResult { + return &MetaServiceSetConfigResult{} +} + +var MetaServiceSetConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSetConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSetConfigResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSetConfigResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListConfigsArgs struct { + Req *ListConfigsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListConfigsArgs() *MetaServiceListConfigsArgs { + return &MetaServiceListConfigsArgs{} +} + +var MetaServiceListConfigsArgs_Req_DEFAULT *ListConfigsReq +func (p *MetaServiceListConfigsArgs) GetReq() *ListConfigsReq { + if !p.IsSetReq() { + return MetaServiceListConfigsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListConfigsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListConfigsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListConfigsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListConfigsResult struct { + Success *ListConfigsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListConfigsResult() *MetaServiceListConfigsResult { + return &MetaServiceListConfigsResult{} +} + +var MetaServiceListConfigsResult_Success_DEFAULT *ListConfigsResp +func (p *MetaServiceListConfigsResult) GetSuccess() *ListConfigsResp { + if !p.IsSetSuccess() { + return MetaServiceListConfigsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListConfigsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListConfigsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListConfigsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateSnapshotArgs struct { + Req *CreateSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSnapshotArgs() *MetaServiceCreateSnapshotArgs { + return &MetaServiceCreateSnapshotArgs{} +} + +var MetaServiceCreateSnapshotArgs_Req_DEFAULT *CreateSnapshotReq +func (p *MetaServiceCreateSnapshotArgs) GetReq() *CreateSnapshotReq { + if !p.IsSetReq() { + return MetaServiceCreateSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSnapshotArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSnapshotArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateSnapshotResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSnapshotResult() *MetaServiceCreateSnapshotResult { + return &MetaServiceCreateSnapshotResult{} +} + +var MetaServiceCreateSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSnapshotResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSnapshotResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropSnapshotArgs struct { + Req *DropSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSnapshotArgs() *MetaServiceDropSnapshotArgs { + return &MetaServiceDropSnapshotArgs{} +} + +var MetaServiceDropSnapshotArgs_Req_DEFAULT *DropSnapshotReq +func (p *MetaServiceDropSnapshotArgs) GetReq() *DropSnapshotReq { + if !p.IsSetReq() { + return MetaServiceDropSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSnapshotArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropSnapshotArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropSnapshotResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSnapshotResult() *MetaServiceDropSnapshotResult { + return &MetaServiceDropSnapshotResult{} +} + +var MetaServiceDropSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSnapshotResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropSnapshotResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListSnapshotsArgs struct { + Req *ListSnapshotsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSnapshotsArgs() *MetaServiceListSnapshotsArgs { + return &MetaServiceListSnapshotsArgs{} +} + +var MetaServiceListSnapshotsArgs_Req_DEFAULT *ListSnapshotsReq +func (p *MetaServiceListSnapshotsArgs) GetReq() *ListSnapshotsReq { + if !p.IsSetReq() { + return MetaServiceListSnapshotsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSnapshotsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSnapshotsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSnapshotsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListSnapshotsResult struct { + Success *ListSnapshotsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSnapshotsResult() *MetaServiceListSnapshotsResult { + return &MetaServiceListSnapshotsResult{} +} + +var MetaServiceListSnapshotsResult_Success_DEFAULT *ListSnapshotsResp +func (p *MetaServiceListSnapshotsResult) GetSuccess() *ListSnapshotsResp { + if !p.IsSetSuccess() { + return MetaServiceListSnapshotsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSnapshotsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSnapshotsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSnapshotsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRunAdminJobArgs struct { + Req *AdminJobReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRunAdminJobArgs() *MetaServiceRunAdminJobArgs { + return &MetaServiceRunAdminJobArgs{} +} + +var MetaServiceRunAdminJobArgs_Req_DEFAULT *AdminJobReq +func (p *MetaServiceRunAdminJobArgs) GetReq() *AdminJobReq { + if !p.IsSetReq() { + return MetaServiceRunAdminJobArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRunAdminJobArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAdminJobReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRunAdminJobArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRunAdminJobResult struct { + Success *AdminJobResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRunAdminJobResult() *MetaServiceRunAdminJobResult { + return &MetaServiceRunAdminJobResult{} +} + +var MetaServiceRunAdminJobResult_Success_DEFAULT *AdminJobResp +func (p *MetaServiceRunAdminJobResult) GetSuccess() *AdminJobResp { + if !p.IsSetSuccess() { + return MetaServiceRunAdminJobResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRunAdminJobResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminJobResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRunAdminJobResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddZoneArgs struct { + Req *AddZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneArgs() *MetaServiceAddZoneArgs { + return &MetaServiceAddZoneArgs{} +} + +var MetaServiceAddZoneArgs_Req_DEFAULT *AddZoneReq +func (p *MetaServiceAddZoneArgs) GetReq() *AddZoneReq { + if !p.IsSetReq() { + return MetaServiceAddZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_args"); err != nil { + 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 *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneResult() *MetaServiceAddZoneResult { + return &MetaServiceAddZoneResult{} +} + +var MetaServiceAddZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_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 *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropZoneArgs struct { + Req *DropZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneArgs() *MetaServiceDropZoneArgs { + return &MetaServiceDropZoneArgs{} +} + +var MetaServiceDropZoneArgs_Req_DEFAULT *DropZoneReq +func (p *MetaServiceDropZoneArgs) GetReq() *DropZoneReq { + if !p.IsSetReq() { + return MetaServiceDropZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneResult() *MetaServiceDropZoneResult { + return &MetaServiceDropZoneResult{} +} + +var MetaServiceDropZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddHostIntoZoneArgs struct { + Req *AddHostIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostIntoZoneArgs() *MetaServiceAddHostIntoZoneArgs { + return &MetaServiceAddHostIntoZoneArgs{} +} + +var MetaServiceAddHostIntoZoneArgs_Req_DEFAULT *AddHostIntoZoneReq +func (p *MetaServiceAddHostIntoZoneArgs) GetReq() *AddHostIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostIntoZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostIntoZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_args"); err != nil { + 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 *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddHostIntoZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostIntoZoneResult() *MetaServiceAddHostIntoZoneResult { + return &MetaServiceAddHostIntoZoneResult{} +} + +var MetaServiceAddHostIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostIntoZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_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 *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropHostFromZoneArgs struct { + Req *DropHostFromZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostFromZoneArgs() *MetaServiceDropHostFromZoneArgs { + return &MetaServiceDropHostFromZoneArgs{} +} + +var MetaServiceDropHostFromZoneArgs_Req_DEFAULT *DropHostFromZoneReq +func (p *MetaServiceDropHostFromZoneArgs) GetReq() *DropHostFromZoneReq { + if !p.IsSetReq() { + return MetaServiceDropHostFromZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostFromZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropHostFromZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_args"); err != nil { + 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 *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropHostFromZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropHostFromZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostFromZoneResult() *MetaServiceDropHostFromZoneResult { + return &MetaServiceDropHostFromZoneResult{} +} + +var MetaServiceDropHostFromZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostFromZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostFromZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostFromZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_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 *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropHostFromZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetZoneArgs struct { + Req *GetZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetZoneArgs() *MetaServiceGetZoneArgs { + return &MetaServiceGetZoneArgs{} +} + +var MetaServiceGetZoneArgs_Req_DEFAULT *GetZoneReq +func (p *MetaServiceGetZoneArgs) GetReq() *GetZoneReq { + if !p.IsSetReq() { + return MetaServiceGetZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetZoneResult struct { + Success *GetZoneResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetZoneResult() *MetaServiceGetZoneResult { + return &MetaServiceGetZoneResult{} +} + +var MetaServiceGetZoneResult_Success_DEFAULT *GetZoneResp +func (p *MetaServiceGetZoneResult) GetSuccess() *GetZoneResp { + if !p.IsSetSuccess() { + return MetaServiceGetZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetZoneResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListZonesArgs struct { + Req *ListZonesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListZonesArgs() *MetaServiceListZonesArgs { + return &MetaServiceListZonesArgs{} +} + +var MetaServiceListZonesArgs_Req_DEFAULT *ListZonesReq +func (p *MetaServiceListZonesArgs) GetReq() *ListZonesReq { + if !p.IsSetReq() { + return MetaServiceListZonesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListZonesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListZonesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListZonesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListZonesResult struct { + Success *ListZonesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListZonesResult() *MetaServiceListZonesResult { + return &MetaServiceListZonesResult{} +} + +var MetaServiceListZonesResult_Success_DEFAULT *ListZonesResp +func (p *MetaServiceListZonesResult) GetSuccess() *ListZonesResp { + if !p.IsSetSuccess() { + return MetaServiceListZonesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListZonesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListZonesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListZonesResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddGroupArgs struct { + Req *AddGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddGroupArgs() *MetaServiceAddGroupArgs { + return &MetaServiceAddGroupArgs{} +} + +var MetaServiceAddGroupArgs_Req_DEFAULT *AddGroupReq +func (p *MetaServiceAddGroupArgs) GetReq() *AddGroupReq { + if !p.IsSetReq() { + return MetaServiceAddGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddGroupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddGroupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddGroupResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddGroupResult() *MetaServiceAddGroupResult { + return &MetaServiceAddGroupResult{} +} + +var MetaServiceAddGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddGroupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropGroupArgs struct { + Req *DropGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropGroupArgs() *MetaServiceDropGroupArgs { + return &MetaServiceDropGroupArgs{} +} + +var MetaServiceDropGroupArgs_Req_DEFAULT *DropGroupReq +func (p *MetaServiceDropGroupArgs) GetReq() *DropGroupReq { + if !p.IsSetReq() { + return MetaServiceDropGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropGroupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropGroupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropGroupResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropGroupResult() *MetaServiceDropGroupResult { + return &MetaServiceDropGroupResult{} +} + +var MetaServiceDropGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropGroupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddZoneIntoGroupArgs struct { + Req *AddZoneIntoGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneIntoGroupArgs() *MetaServiceAddZoneIntoGroupArgs { + return &MetaServiceAddZoneIntoGroupArgs{} +} + +var MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT *AddZoneIntoGroupReq +func (p *MetaServiceAddZoneIntoGroupArgs) GetReq() *AddZoneIntoGroupReq { + if !p.IsSetReq() { + return MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneIntoGroupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneIntoGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddZoneIntoGroupResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneIntoGroupResult() *MetaServiceAddZoneIntoGroupResult { + return &MetaServiceAddZoneIntoGroupResult{} +} + +var MetaServiceAddZoneIntoGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneIntoGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneIntoGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneIntoGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropZoneFromGroupArgs struct { + Req *DropZoneFromGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneFromGroupArgs() *MetaServiceDropZoneFromGroupArgs { + return &MetaServiceDropZoneFromGroupArgs{} +} + +var MetaServiceDropZoneFromGroupArgs_Req_DEFAULT *DropZoneFromGroupReq +func (p *MetaServiceDropZoneFromGroupArgs) GetReq() *DropZoneFromGroupReq { + if !p.IsSetReq() { + return MetaServiceDropZoneFromGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneFromGroupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneFromGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropZoneFromGroupResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneFromGroupResult() *MetaServiceDropZoneFromGroupResult { + return &MetaServiceDropZoneFromGroupResult{} +} + +var MetaServiceDropZoneFromGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneFromGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneFromGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneFromGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetGroupArgs struct { + Req *GetGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetGroupArgs() *MetaServiceGetGroupArgs { + return &MetaServiceGetGroupArgs{} +} + +var MetaServiceGetGroupArgs_Req_DEFAULT *GetGroupReq +func (p *MetaServiceGetGroupArgs) GetReq() *GetGroupReq { + if !p.IsSetReq() { + return MetaServiceGetGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetGroupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetGroupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetGroupResult struct { + Success *GetGroupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetGroupResult() *MetaServiceGetGroupResult { + return &MetaServiceGetGroupResult{} +} + +var MetaServiceGetGroupResult_Success_DEFAULT *GetGroupResp +func (p *MetaServiceGetGroupResult) GetSuccess() *GetGroupResp { + if !p.IsSetSuccess() { + return MetaServiceGetGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetGroupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetGroupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetGroupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListGroupsArgs struct { + Req *ListGroupsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListGroupsArgs() *MetaServiceListGroupsArgs { + return &MetaServiceListGroupsArgs{} +} + +var MetaServiceListGroupsArgs_Req_DEFAULT *ListGroupsReq +func (p *MetaServiceListGroupsArgs) GetReq() *ListGroupsReq { + if !p.IsSetReq() { + return MetaServiceListGroupsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListGroupsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListGroupsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListGroupsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListGroupsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListGroupsResult struct { + Success *ListGroupsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListGroupsResult() *MetaServiceListGroupsResult { + return &MetaServiceListGroupsResult{} +} + +var MetaServiceListGroupsResult_Success_DEFAULT *ListGroupsResp +func (p *MetaServiceListGroupsResult) GetSuccess() *ListGroupsResp { + if !p.IsSetSuccess() { + return MetaServiceListGroupsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListGroupsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListGroupsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListGroupsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListGroupsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateBackupArgs struct { + Req *CreateBackupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateBackupArgs() *MetaServiceCreateBackupArgs { + return &MetaServiceCreateBackupArgs{} +} + +var MetaServiceCreateBackupArgs_Req_DEFAULT *CreateBackupReq +func (p *MetaServiceCreateBackupArgs) GetReq() *CreateBackupReq { + if !p.IsSetReq() { + return MetaServiceCreateBackupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateBackupArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateBackupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateBackupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateBackupResult struct { + Success *CreateBackupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateBackupResult() *MetaServiceCreateBackupResult { + return &MetaServiceCreateBackupResult{} +} + +var MetaServiceCreateBackupResult_Success_DEFAULT *CreateBackupResp +func (p *MetaServiceCreateBackupResult) GetSuccess() *CreateBackupResp { + if !p.IsSetSuccess() { + return MetaServiceCreateBackupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateBackupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateBackupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateBackupResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRestoreMetaArgs struct { + Req *RestoreMetaReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRestoreMetaArgs() *MetaServiceRestoreMetaArgs { + return &MetaServiceRestoreMetaArgs{} +} + +var MetaServiceRestoreMetaArgs_Req_DEFAULT *RestoreMetaReq +func (p *MetaServiceRestoreMetaArgs) GetReq() *RestoreMetaReq { + if !p.IsSetReq() { + return MetaServiceRestoreMetaArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRestoreMetaArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRestoreMetaReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRestoreMetaArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRestoreMetaResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { + return &MetaServiceRestoreMetaResult{} +} + +var MetaServiceRestoreMetaResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRestoreMetaResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRestoreMetaResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddListenerArgs struct { + Req *AddListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddListenerArgs() *MetaServiceAddListenerArgs { + return &MetaServiceAddListenerArgs{} +} + +var MetaServiceAddListenerArgs_Req_DEFAULT *AddListenerReq +func (p *MetaServiceAddListenerArgs) GetReq() *AddListenerReq { + if !p.IsSetReq() { + return MetaServiceAddListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddListenerArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddListenerArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddListenerResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddListenerResult() *MetaServiceAddListenerResult { + return &MetaServiceAddListenerResult{} +} + +var MetaServiceAddListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddListenerResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddListenerResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRemoveListenerArgs struct { + Req *RemoveListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveListenerArgs() *MetaServiceRemoveListenerArgs { + return &MetaServiceRemoveListenerArgs{} +} + +var MetaServiceRemoveListenerArgs_Req_DEFAULT *RemoveListenerReq +func (p *MetaServiceRemoveListenerArgs) GetReq() *RemoveListenerReq { + if !p.IsSetReq() { + return MetaServiceRemoveListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveListenerArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveListenerArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRemoveListenerResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveListenerResult() *MetaServiceRemoveListenerResult { + return &MetaServiceRemoveListenerResult{} +} + +var MetaServiceRemoveListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveListenerResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveListenerResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListListenerArgs struct { + Req *ListListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListListenerArgs() *MetaServiceListListenerArgs { + return &MetaServiceListListenerArgs{} +} + +var MetaServiceListListenerArgs_Req_DEFAULT *ListListenerReq +func (p *MetaServiceListListenerArgs) GetReq() *ListListenerReq { + if !p.IsSetReq() { + return MetaServiceListListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListListenerArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListListenerArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListListenerResult struct { + Success *ListListenerResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListListenerResult() *MetaServiceListListenerResult { + return &MetaServiceListListenerResult{} +} + +var MetaServiceListListenerResult_Success_DEFAULT *ListListenerResp +func (p *MetaServiceListListenerResult) GetSuccess() *ListListenerResp { + if !p.IsSetSuccess() { + return MetaServiceListListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListListenerResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListListenerResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListListenerResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetStatisArgs struct { + Req *GetStatisReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetStatisArgs() *MetaServiceGetStatisArgs { + return &MetaServiceGetStatisArgs{} +} + +var MetaServiceGetStatisArgs_Req_DEFAULT *GetStatisReq +func (p *MetaServiceGetStatisArgs) GetReq() *GetStatisReq { + if !p.IsSetReq() { + return MetaServiceGetStatisArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetStatisArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetStatisReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetStatisArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetStatisArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetStatisResult struct { + Success *GetStatisResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetStatisResult() *MetaServiceGetStatisResult { + return &MetaServiceGetStatisResult{} +} + +var MetaServiceGetStatisResult_Success_DEFAULT *GetStatisResp +func (p *MetaServiceGetStatisResult) GetSuccess() *GetStatisResp { + if !p.IsSetSuccess() { + return MetaServiceGetStatisResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetStatisResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetStatisResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetStatisResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetStatisResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSignInFTServiceArgs struct { + Req *SignInFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignInFTServiceArgs() *MetaServiceSignInFTServiceArgs { + return &MetaServiceSignInFTServiceArgs{} +} + +var MetaServiceSignInFTServiceArgs_Req_DEFAULT *SignInFTServiceReq +func (p *MetaServiceSignInFTServiceArgs) GetReq() *SignInFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignInFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignInFTServiceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignInFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignInFTServiceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSignInFTServiceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignInFTServiceResult() *MetaServiceSignInFTServiceResult { + return &MetaServiceSignInFTServiceResult{} +} + +var MetaServiceSignInFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignInFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignInFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignInFTServiceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignInFTServiceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSignOutFTServiceArgs struct { + Req *SignOutFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignOutFTServiceArgs() *MetaServiceSignOutFTServiceArgs { + return &MetaServiceSignOutFTServiceArgs{} +} + +var MetaServiceSignOutFTServiceArgs_Req_DEFAULT *SignOutFTServiceReq +func (p *MetaServiceSignOutFTServiceArgs) GetReq() *SignOutFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignOutFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignOutFTServiceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignOutFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignOutFTServiceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSignOutFTServiceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignOutFTServiceResult() *MetaServiceSignOutFTServiceResult { + return &MetaServiceSignOutFTServiceResult{} +} + +var MetaServiceSignOutFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignOutFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignOutFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignOutFTServiceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignOutFTServiceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListFTClientsArgs struct { + Req *ListFTClientsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTClientsArgs() *MetaServiceListFTClientsArgs { + return &MetaServiceListFTClientsArgs{} +} + +var MetaServiceListFTClientsArgs_Req_DEFAULT *ListFTClientsReq +func (p *MetaServiceListFTClientsArgs) GetReq() *ListFTClientsReq { + if !p.IsSetReq() { + return MetaServiceListFTClientsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTClientsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTClientsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTClientsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListFTClientsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListFTClientsResult struct { + Success *ListFTClientsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTClientsResult() *MetaServiceListFTClientsResult { + return &MetaServiceListFTClientsResult{} +} + +var MetaServiceListFTClientsResult_Success_DEFAULT *ListFTClientsResp +func (p *MetaServiceListFTClientsResult) GetSuccess() *ListFTClientsResp { + if !p.IsSetSuccess() { + return MetaServiceListFTClientsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTClientsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTClientsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTClientsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListFTClientsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateSessionArgs struct { + Req *CreateSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSessionArgs() *MetaServiceCreateSessionArgs { + return &MetaServiceCreateSessionArgs{} +} + +var MetaServiceCreateSessionArgs_Req_DEFAULT *CreateSessionReq +func (p *MetaServiceCreateSessionArgs) GetReq() *CreateSessionReq { + if !p.IsSetReq() { + return MetaServiceCreateSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSessionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSessionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateSessionResult struct { + Success *CreateSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSessionResult() *MetaServiceCreateSessionResult { + return &MetaServiceCreateSessionResult{} +} + +var MetaServiceCreateSessionResult_Success_DEFAULT *CreateSessionResp +func (p *MetaServiceCreateSessionResult) GetSuccess() *CreateSessionResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceCreateSessionResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceUpdateSessionsArgs struct { + Req *UpdateSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceUpdateSessionsArgs() *MetaServiceUpdateSessionsArgs { + return &MetaServiceUpdateSessionsArgs{} +} + +var MetaServiceUpdateSessionsArgs_Req_DEFAULT *UpdateSessionsReq +func (p *MetaServiceUpdateSessionsArgs) GetReq() *UpdateSessionsReq { + if !p.IsSetReq() { + return MetaServiceUpdateSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceUpdateSessionsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceUpdateSessionsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceUpdateSessionsResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceUpdateSessionsResult() *MetaServiceUpdateSessionsResult { + return &MetaServiceUpdateSessionsResult{} +} + +var MetaServiceUpdateSessionsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceUpdateSessionsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceUpdateSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceUpdateSessionsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceUpdateSessionsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListSessionsArgs struct { + Req *ListSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSessionsArgs() *MetaServiceListSessionsArgs { + return &MetaServiceListSessionsArgs{} +} + +var MetaServiceListSessionsArgs_Req_DEFAULT *ListSessionsReq +func (p *MetaServiceListSessionsArgs) GetReq() *ListSessionsReq { + if !p.IsSetReq() { + return MetaServiceListSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSessionsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSessionsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListSessionsResult struct { + Success *ListSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSessionsResult() *MetaServiceListSessionsResult { + return &MetaServiceListSessionsResult{} +} + +var MetaServiceListSessionsResult_Success_DEFAULT *ListSessionsResp +func (p *MetaServiceListSessionsResult) GetSuccess() *ListSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceListSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSessionsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListSessionsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetSessionArgs struct { + Req *GetSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSessionArgs() *MetaServiceGetSessionArgs { + return &MetaServiceGetSessionArgs{} +} + +var MetaServiceGetSessionArgs_Req_DEFAULT *GetSessionReq +func (p *MetaServiceGetSessionArgs) GetReq() *GetSessionReq { + if !p.IsSetReq() { + return MetaServiceGetSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSessionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSessionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetSessionResult struct { + Success *GetSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSessionResult() *MetaServiceGetSessionResult { + return &MetaServiceGetSessionResult{} +} + +var MetaServiceGetSessionResult_Success_DEFAULT *GetSessionResp +func (p *MetaServiceGetSessionResult) GetSuccess() *GetSessionResp { + if !p.IsSetSuccess() { + return MetaServiceGetSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSessionResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRemoveSessionArgs struct { + Req *RemoveSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveSessionArgs() *MetaServiceRemoveSessionArgs { + return &MetaServiceRemoveSessionArgs{} +} + +var MetaServiceRemoveSessionArgs_Req_DEFAULT *RemoveSessionReq +func (p *MetaServiceRemoveSessionArgs) GetReq() *RemoveSessionReq { + if !p.IsSetReq() { + return MetaServiceRemoveSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveSessionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveSessionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRemoveSessionResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveSessionResult() *MetaServiceRemoveSessionResult { + return &MetaServiceRemoveSessionResult{} +} + +var MetaServiceRemoveSessionResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveSessionResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRemoveSessionResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceReportTaskFinishArgs struct { + Req *ReportTaskReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceReportTaskFinishArgs() *MetaServiceReportTaskFinishArgs { + return &MetaServiceReportTaskFinishArgs{} +} + +var MetaServiceReportTaskFinishArgs_Req_DEFAULT *ReportTaskReq +func (p *MetaServiceReportTaskFinishArgs) GetReq() *ReportTaskReq { + if !p.IsSetReq() { + return MetaServiceReportTaskFinishArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceReportTaskFinishArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewReportTaskReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceReportTaskFinishArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceReportTaskFinishResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceReportTaskFinishResult() *MetaServiceReportTaskFinishResult { + return &MetaServiceReportTaskFinishResult{} +} + +var MetaServiceReportTaskFinishResult_Success_DEFAULT *ExecResp +func (p *MetaServiceReportTaskFinishResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceReportTaskFinishResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceReportTaskFinishResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceReportTaskFinishResult(%+v)", *p) +} + + diff --git a/ccore/nebula/internal/thrift/v2_0_0/meta/ttypes.go b/ccore/nebula/internal/thrift/v2_0_0/meta/ttypes.go new file mode 100644 index 0000000..ffa0720 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/meta/ttypes.go @@ -0,0 +1,23143 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -11 + ErrorCode_E_NO_HOSTS ErrorCode = -21 + ErrorCode_E_EXISTED ErrorCode = -22 + ErrorCode_E_NOT_FOUND ErrorCode = -23 + ErrorCode_E_INVALID_HOST ErrorCode = -24 + ErrorCode_E_UNSUPPORTED ErrorCode = -25 + ErrorCode_E_NOT_DROP ErrorCode = -26 + ErrorCode_E_BALANCER_RUNNING ErrorCode = -27 + ErrorCode_E_CONFIG_IMMUTABLE ErrorCode = -28 + ErrorCode_E_CONFLICT ErrorCode = -29 + ErrorCode_E_INVALID_PARM ErrorCode = -30 + ErrorCode_E_WRONGCLUSTER ErrorCode = -31 + ErrorCode_E_STORE_FAILURE ErrorCode = -32 + ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -33 + ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -34 + ErrorCode_E_BALANCED ErrorCode = -35 + ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -36 + ErrorCode_E_NO_VALID_HOST ErrorCode = -37 + ErrorCode_E_CORRUPTTED_BALANCE_PLAN ErrorCode = -38 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -39 + ErrorCode_E_INVALID_PASSWORD ErrorCode = -41 + ErrorCode_E_IMPROPER_ROLE ErrorCode = -42 + ErrorCode_E_INVALID_PARTITION_NUM ErrorCode = -43 + ErrorCode_E_INVALID_REPLICA_FACTOR ErrorCode = -44 + ErrorCode_E_INVALID_CHARSET ErrorCode = -45 + ErrorCode_E_INVALID_COLLATE ErrorCode = -46 + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH ErrorCode = -47 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -51 + ErrorCode_E_BLOCK_WRITE_FAILURE ErrorCode = -52 + ErrorCode_E_REBUILD_INDEX_FAILURE ErrorCode = -53 + ErrorCode_E_INDEX_WITH_TTL ErrorCode = -54 + ErrorCode_E_ADD_JOB_FAILURE ErrorCode = -55 + ErrorCode_E_STOP_JOB_FAILURE ErrorCode = -56 + ErrorCode_E_SAVE_JOB_FAILURE ErrorCode = -57 + ErrorCode_E_BALANCER_FAILURE ErrorCode = -58 + ErrorCode_E_JOB_NOT_FINISHED ErrorCode = -59 + ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -60 + ErrorCode_E_BACKUP_FAILURE ErrorCode = -70 + ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -71 + ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -72 + ErrorCode_E_RESTORE_FAILURE ErrorCode = -80 + ErrorCode_E_UNKNOWN ErrorCode = -99 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAIL_TO_CONNECT: "E_FAIL_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_LEADER_CHANGED: "E_LEADER_CHANGED", + ErrorCode_E_NO_HOSTS: "E_NO_HOSTS", + ErrorCode_E_EXISTED: "E_EXISTED", + ErrorCode_E_NOT_FOUND: "E_NOT_FOUND", + ErrorCode_E_INVALID_HOST: "E_INVALID_HOST", + ErrorCode_E_UNSUPPORTED: "E_UNSUPPORTED", + ErrorCode_E_NOT_DROP: "E_NOT_DROP", + ErrorCode_E_BALANCER_RUNNING: "E_BALANCER_RUNNING", + ErrorCode_E_CONFIG_IMMUTABLE: "E_CONFIG_IMMUTABLE", + ErrorCode_E_CONFLICT: "E_CONFLICT", + ErrorCode_E_INVALID_PARM: "E_INVALID_PARM", + ErrorCode_E_WRONGCLUSTER: "E_WRONGCLUSTER", + 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", + ErrorCode_E_BALANCED: "E_BALANCED", + ErrorCode_E_NO_RUNNING_BALANCE_PLAN: "E_NO_RUNNING_BALANCE_PLAN", + ErrorCode_E_NO_VALID_HOST: "E_NO_VALID_HOST", + ErrorCode_E_CORRUPTTED_BALANCE_PLAN: "E_CORRUPTTED_BALANCE_PLAN", + ErrorCode_E_NO_INVALID_BALANCE_PLAN: "E_NO_INVALID_BALANCE_PLAN", + ErrorCode_E_INVALID_PASSWORD: "E_INVALID_PASSWORD", + ErrorCode_E_IMPROPER_ROLE: "E_IMPROPER_ROLE", + ErrorCode_E_INVALID_PARTITION_NUM: "E_INVALID_PARTITION_NUM", + ErrorCode_E_INVALID_REPLICA_FACTOR: "E_INVALID_REPLICA_FACTOR", + ErrorCode_E_INVALID_CHARSET: "E_INVALID_CHARSET", + ErrorCode_E_INVALID_COLLATE: "E_INVALID_COLLATE", + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH: "E_CHARSET_COLLATE_NOT_MATCH", + ErrorCode_E_SNAPSHOT_FAILURE: "E_SNAPSHOT_FAILURE", + ErrorCode_E_BLOCK_WRITE_FAILURE: "E_BLOCK_WRITE_FAILURE", + ErrorCode_E_REBUILD_INDEX_FAILURE: "E_REBUILD_INDEX_FAILURE", + ErrorCode_E_INDEX_WITH_TTL: "E_INDEX_WITH_TTL", + ErrorCode_E_ADD_JOB_FAILURE: "E_ADD_JOB_FAILURE", + ErrorCode_E_STOP_JOB_FAILURE: "E_STOP_JOB_FAILURE", + ErrorCode_E_SAVE_JOB_FAILURE: "E_SAVE_JOB_FAILURE", + ErrorCode_E_BALANCER_FAILURE: "E_BALANCER_FAILURE", + ErrorCode_E_JOB_NOT_FINISHED: "E_JOB_NOT_FINISHED", + ErrorCode_E_TASK_REPORT_OUT_DATE: "E_TASK_REPORT_OUT_DATE", + ErrorCode_E_BACKUP_FAILURE: "E_BACKUP_FAILURE", + ErrorCode_E_BACKUP_BUILDING_INDEX: "E_BACKUP_BUILDING_INDEX", + ErrorCode_E_BACKUP_SPACE_NOT_FOUND: "E_BACKUP_SPACE_NOT_FOUND", + ErrorCode_E_RESTORE_FAILURE: "E_RESTORE_FAILURE", + ErrorCode_E_UNKNOWN: "E_UNKNOWN", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAIL_TO_CONNECT": ErrorCode_E_FAIL_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_LEADER_CHANGED": ErrorCode_E_LEADER_CHANGED, + "E_NO_HOSTS": ErrorCode_E_NO_HOSTS, + "E_EXISTED": ErrorCode_E_EXISTED, + "E_NOT_FOUND": ErrorCode_E_NOT_FOUND, + "E_INVALID_HOST": ErrorCode_E_INVALID_HOST, + "E_UNSUPPORTED": ErrorCode_E_UNSUPPORTED, + "E_NOT_DROP": ErrorCode_E_NOT_DROP, + "E_BALANCER_RUNNING": ErrorCode_E_BALANCER_RUNNING, + "E_CONFIG_IMMUTABLE": ErrorCode_E_CONFIG_IMMUTABLE, + "E_CONFLICT": ErrorCode_E_CONFLICT, + "E_INVALID_PARM": ErrorCode_E_INVALID_PARM, + "E_WRONGCLUSTER": ErrorCode_E_WRONGCLUSTER, + "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, + "E_BALANCED": ErrorCode_E_BALANCED, + "E_NO_RUNNING_BALANCE_PLAN": ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + "E_NO_VALID_HOST": ErrorCode_E_NO_VALID_HOST, + "E_CORRUPTTED_BALANCE_PLAN": ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + "E_NO_INVALID_BALANCE_PLAN": ErrorCode_E_NO_INVALID_BALANCE_PLAN, + "E_INVALID_PASSWORD": ErrorCode_E_INVALID_PASSWORD, + "E_IMPROPER_ROLE": ErrorCode_E_IMPROPER_ROLE, + "E_INVALID_PARTITION_NUM": ErrorCode_E_INVALID_PARTITION_NUM, + "E_INVALID_REPLICA_FACTOR": ErrorCode_E_INVALID_REPLICA_FACTOR, + "E_INVALID_CHARSET": ErrorCode_E_INVALID_CHARSET, + "E_INVALID_COLLATE": ErrorCode_E_INVALID_COLLATE, + "E_CHARSET_COLLATE_NOT_MATCH": ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + "E_SNAPSHOT_FAILURE": ErrorCode_E_SNAPSHOT_FAILURE, + "E_BLOCK_WRITE_FAILURE": ErrorCode_E_BLOCK_WRITE_FAILURE, + "E_REBUILD_INDEX_FAILURE": ErrorCode_E_REBUILD_INDEX_FAILURE, + "E_INDEX_WITH_TTL": ErrorCode_E_INDEX_WITH_TTL, + "E_ADD_JOB_FAILURE": ErrorCode_E_ADD_JOB_FAILURE, + "E_STOP_JOB_FAILURE": ErrorCode_E_STOP_JOB_FAILURE, + "E_SAVE_JOB_FAILURE": ErrorCode_E_SAVE_JOB_FAILURE, + "E_BALANCER_FAILURE": ErrorCode_E_BALANCER_FAILURE, + "E_JOB_NOT_FINISHED": ErrorCode_E_JOB_NOT_FINISHED, + "E_TASK_REPORT_OUT_DATE": ErrorCode_E_TASK_REPORT_OUT_DATE, + "E_BACKUP_FAILURE": ErrorCode_E_BACKUP_FAILURE, + "E_BACKUP_BUILDING_INDEX": ErrorCode_E_BACKUP_BUILDING_INDEX, + "E_BACKUP_SPACE_NOT_FOUND": ErrorCode_E_BACKUP_SPACE_NOT_FOUND, + "E_RESTORE_FAILURE": ErrorCode_E_RESTORE_FAILURE, + "E_UNKNOWN": ErrorCode_E_UNKNOWN, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +type AlterSchemaOp int64 +const ( + AlterSchemaOp_ADD AlterSchemaOp = 1 + AlterSchemaOp_CHANGE AlterSchemaOp = 2 + AlterSchemaOp_DROP AlterSchemaOp = 3 + AlterSchemaOp_UNKNOWN AlterSchemaOp = 4 +) + +var AlterSchemaOpToName = map[AlterSchemaOp]string { + AlterSchemaOp_ADD: "ADD", + AlterSchemaOp_CHANGE: "CHANGE", + AlterSchemaOp_DROP: "DROP", + AlterSchemaOp_UNKNOWN: "UNKNOWN", +} + +var AlterSchemaOpToValue = map[string]AlterSchemaOp { + "ADD": AlterSchemaOp_ADD, + "CHANGE": AlterSchemaOp_CHANGE, + "DROP": AlterSchemaOp_DROP, + "UNKNOWN": AlterSchemaOp_UNKNOWN, +} + +func (p AlterSchemaOp) String() string { + if v, ok := AlterSchemaOpToName[p]; ok { + return v + } + return "" +} + +func AlterSchemaOpFromString(s string) (AlterSchemaOp, error) { + if v, ok := AlterSchemaOpToValue[s]; ok { + return v, nil + } + return AlterSchemaOp(0), fmt.Errorf("not a valid AlterSchemaOp string") +} + +func AlterSchemaOpPtr(v AlterSchemaOp) *AlterSchemaOp { return &v } + +type RoleType int64 +const ( + RoleType_GOD RoleType = 1 + RoleType_ADMIN RoleType = 2 + RoleType_DBA RoleType = 3 + RoleType_USER RoleType = 4 + RoleType_GUEST RoleType = 5 +) + +var RoleTypeToName = map[RoleType]string { + RoleType_GOD: "GOD", + RoleType_ADMIN: "ADMIN", + RoleType_DBA: "DBA", + RoleType_USER: "USER", + RoleType_GUEST: "GUEST", +} + +var RoleTypeToValue = map[string]RoleType { + "GOD": RoleType_GOD, + "ADMIN": RoleType_ADMIN, + "DBA": RoleType_DBA, + "USER": RoleType_USER, + "GUEST": RoleType_GUEST, +} + +func (p RoleType) String() string { + if v, ok := RoleTypeToName[p]; ok { + return v + } + return "" +} + +func RoleTypeFromString(s string) (RoleType, error) { + if v, ok := RoleTypeToValue[s]; ok { + return v, nil + } + return RoleType(0), fmt.Errorf("not a valid RoleType string") +} + +func RoleTypePtr(v RoleType) *RoleType { return &v } + +type PropertyType int64 +const ( + PropertyType_UNKNOWN PropertyType = 0 + PropertyType_BOOL PropertyType = 1 + PropertyType_INT64 PropertyType = 2 + PropertyType_VID PropertyType = 3 + PropertyType_FLOAT PropertyType = 4 + PropertyType_DOUBLE PropertyType = 5 + PropertyType_STRING PropertyType = 6 + PropertyType_FIXED_STRING PropertyType = 7 + PropertyType_INT8 PropertyType = 8 + PropertyType_INT16 PropertyType = 9 + PropertyType_INT32 PropertyType = 10 + PropertyType_TIMESTAMP PropertyType = 21 + PropertyType_DATE PropertyType = 24 + PropertyType_DATETIME PropertyType = 25 + PropertyType_TIME PropertyType = 26 +) + +var PropertyTypeToName = map[PropertyType]string { + PropertyType_UNKNOWN: "UNKNOWN", + PropertyType_BOOL: "BOOL", + PropertyType_INT64: "INT64", + PropertyType_VID: "VID", + PropertyType_FLOAT: "FLOAT", + PropertyType_DOUBLE: "DOUBLE", + PropertyType_STRING: "STRING", + PropertyType_FIXED_STRING: "FIXED_STRING", + PropertyType_INT8: "INT8", + PropertyType_INT16: "INT16", + PropertyType_INT32: "INT32", + PropertyType_TIMESTAMP: "TIMESTAMP", + PropertyType_DATE: "DATE", + PropertyType_DATETIME: "DATETIME", + PropertyType_TIME: "TIME", +} + +var PropertyTypeToValue = map[string]PropertyType { + "UNKNOWN": PropertyType_UNKNOWN, + "BOOL": PropertyType_BOOL, + "INT64": PropertyType_INT64, + "VID": PropertyType_VID, + "FLOAT": PropertyType_FLOAT, + "DOUBLE": PropertyType_DOUBLE, + "STRING": PropertyType_STRING, + "FIXED_STRING": PropertyType_FIXED_STRING, + "INT8": PropertyType_INT8, + "INT16": PropertyType_INT16, + "INT32": PropertyType_INT32, + "TIMESTAMP": PropertyType_TIMESTAMP, + "DATE": PropertyType_DATE, + "DATETIME": PropertyType_DATETIME, + "TIME": PropertyType_TIME, +} + +func (p PropertyType) String() string { + if v, ok := PropertyTypeToName[p]; ok { + return v + } + return "" +} + +func PropertyTypeFromString(s string) (PropertyType, error) { + if v, ok := PropertyTypeToValue[s]; ok { + return v, nil + } + return PropertyType(0), fmt.Errorf("not a valid PropertyType string") +} + +func PropertyTypePtr(v PropertyType) *PropertyType { return &v } + +type IsolationLevel int64 +const ( + IsolationLevel_DEFAULT IsolationLevel = 0 + IsolationLevel_TOSS IsolationLevel = 1 +) + +var IsolationLevelToName = map[IsolationLevel]string { + IsolationLevel_DEFAULT: "DEFAULT", + IsolationLevel_TOSS: "TOSS", +} + +var IsolationLevelToValue = map[string]IsolationLevel { + "DEFAULT": IsolationLevel_DEFAULT, + "TOSS": IsolationLevel_TOSS, +} + +func (p IsolationLevel) String() string { + if v, ok := IsolationLevelToName[p]; ok { + return v + } + return "" +} + +func IsolationLevelFromString(s string) (IsolationLevel, error) { + if v, ok := IsolationLevelToValue[s]; ok { + return v, nil + } + return IsolationLevel(0), fmt.Errorf("not a valid IsolationLevel string") +} + +func IsolationLevelPtr(v IsolationLevel) *IsolationLevel { return &v } + +type HostStatus int64 +const ( + HostStatus_ONLINE HostStatus = 0 + HostStatus_OFFLINE HostStatus = 1 + HostStatus_UNKNOWN HostStatus = 2 +) + +var HostStatusToName = map[HostStatus]string { + HostStatus_ONLINE: "ONLINE", + HostStatus_OFFLINE: "OFFLINE", + HostStatus_UNKNOWN: "UNKNOWN", +} + +var HostStatusToValue = map[string]HostStatus { + "ONLINE": HostStatus_ONLINE, + "OFFLINE": HostStatus_OFFLINE, + "UNKNOWN": HostStatus_UNKNOWN, +} + +func (p HostStatus) String() string { + if v, ok := HostStatusToName[p]; ok { + return v + } + return "" +} + +func HostStatusFromString(s string) (HostStatus, error) { + if v, ok := HostStatusToValue[s]; ok { + return v, nil + } + return HostStatus(0), fmt.Errorf("not a valid HostStatus string") +} + +func HostStatusPtr(v HostStatus) *HostStatus { return &v } + +type SnapshotStatus int64 +const ( + SnapshotStatus_VALID SnapshotStatus = 0 + SnapshotStatus_INVALID SnapshotStatus = 1 +) + +var SnapshotStatusToName = map[SnapshotStatus]string { + SnapshotStatus_VALID: "VALID", + SnapshotStatus_INVALID: "INVALID", +} + +var SnapshotStatusToValue = map[string]SnapshotStatus { + "VALID": SnapshotStatus_VALID, + "INVALID": SnapshotStatus_INVALID, +} + +func (p SnapshotStatus) String() string { + if v, ok := SnapshotStatusToName[p]; ok { + return v + } + return "" +} + +func SnapshotStatusFromString(s string) (SnapshotStatus, error) { + if v, ok := SnapshotStatusToValue[s]; ok { + return v, nil + } + return SnapshotStatus(0), fmt.Errorf("not a valid SnapshotStatus string") +} + +func SnapshotStatusPtr(v SnapshotStatus) *SnapshotStatus { return &v } + +type AdminJobOp int64 +const ( + AdminJobOp_ADD AdminJobOp = 1 + AdminJobOp_SHOW_All AdminJobOp = 2 + AdminJobOp_SHOW AdminJobOp = 3 + AdminJobOp_STOP AdminJobOp = 4 + AdminJobOp_RECOVER AdminJobOp = 5 +) + +var AdminJobOpToName = map[AdminJobOp]string { + AdminJobOp_ADD: "ADD", + AdminJobOp_SHOW_All: "SHOW_All", + AdminJobOp_SHOW: "SHOW", + AdminJobOp_STOP: "STOP", + AdminJobOp_RECOVER: "RECOVER", +} + +var AdminJobOpToValue = map[string]AdminJobOp { + "ADD": AdminJobOp_ADD, + "SHOW_All": AdminJobOp_SHOW_All, + "SHOW": AdminJobOp_SHOW, + "STOP": AdminJobOp_STOP, + "RECOVER": AdminJobOp_RECOVER, +} + +func (p AdminJobOp) String() string { + if v, ok := AdminJobOpToName[p]; ok { + return v + } + return "" +} + +func AdminJobOpFromString(s string) (AdminJobOp, error) { + if v, ok := AdminJobOpToValue[s]; ok { + return v, nil + } + return AdminJobOp(0), fmt.Errorf("not a valid AdminJobOp string") +} + +func AdminJobOpPtr(v AdminJobOp) *AdminJobOp { return &v } + +type AdminCmd int64 +const ( + AdminCmd_COMPACT AdminCmd = 0 + AdminCmd_FLUSH AdminCmd = 1 + AdminCmd_REBUILD_TAG_INDEX AdminCmd = 2 + AdminCmd_REBUILD_EDGE_INDEX AdminCmd = 3 + AdminCmd_STATS AdminCmd = 4 + AdminCmd_DATA_BALANCE AdminCmd = 5 + AdminCmd_DOWELOAD AdminCmd = 6 + AdminCmd_INGEST AdminCmd = 7 + AdminCmd_UNKNOWN AdminCmd = 99 +) + +var AdminCmdToName = map[AdminCmd]string { + AdminCmd_COMPACT: "COMPACT", + AdminCmd_FLUSH: "FLUSH", + AdminCmd_REBUILD_TAG_INDEX: "REBUILD_TAG_INDEX", + AdminCmd_REBUILD_EDGE_INDEX: "REBUILD_EDGE_INDEX", + AdminCmd_STATS: "STATS", + AdminCmd_DATA_BALANCE: "DATA_BALANCE", + AdminCmd_DOWELOAD: "DOWELOAD", + AdminCmd_INGEST: "INGEST", + AdminCmd_UNKNOWN: "UNKNOWN", +} + +var AdminCmdToValue = map[string]AdminCmd { + "COMPACT": AdminCmd_COMPACT, + "FLUSH": AdminCmd_FLUSH, + "REBUILD_TAG_INDEX": AdminCmd_REBUILD_TAG_INDEX, + "REBUILD_EDGE_INDEX": AdminCmd_REBUILD_EDGE_INDEX, + "STATS": AdminCmd_STATS, + "DATA_BALANCE": AdminCmd_DATA_BALANCE, + "DOWELOAD": AdminCmd_DOWELOAD, + "INGEST": AdminCmd_INGEST, + "UNKNOWN": AdminCmd_UNKNOWN, +} + +func (p AdminCmd) String() string { + if v, ok := AdminCmdToName[p]; ok { + return v + } + return "" +} + +func AdminCmdFromString(s string) (AdminCmd, error) { + if v, ok := AdminCmdToValue[s]; ok { + return v, nil + } + return AdminCmd(0), fmt.Errorf("not a valid AdminCmd string") +} + +func AdminCmdPtr(v AdminCmd) *AdminCmd { return &v } + +type JobStatus int64 +const ( + JobStatus_QUEUE JobStatus = 1 + JobStatus_RUNNING JobStatus = 2 + JobStatus_FINISHED JobStatus = 3 + JobStatus_FAILED JobStatus = 4 + JobStatus_STOPPED JobStatus = 5 + JobStatus_INVALID JobStatus = 255 +) + +var JobStatusToName = map[JobStatus]string { + JobStatus_QUEUE: "QUEUE", + JobStatus_RUNNING: "RUNNING", + JobStatus_FINISHED: "FINISHED", + JobStatus_FAILED: "FAILED", + JobStatus_STOPPED: "STOPPED", + JobStatus_INVALID: "INVALID", +} + +var JobStatusToValue = map[string]JobStatus { + "QUEUE": JobStatus_QUEUE, + "RUNNING": JobStatus_RUNNING, + "FINISHED": JobStatus_FINISHED, + "FAILED": JobStatus_FAILED, + "STOPPED": JobStatus_STOPPED, + "INVALID": JobStatus_INVALID, +} + +func (p JobStatus) String() string { + if v, ok := JobStatusToName[p]; ok { + return v + } + return "" +} + +func JobStatusFromString(s string) (JobStatus, error) { + if v, ok := JobStatusToValue[s]; ok { + return v, nil + } + return JobStatus(0), fmt.Errorf("not a valid JobStatus string") +} + +func JobStatusPtr(v JobStatus) *JobStatus { return &v } + +type ListHostType int64 +const ( + ListHostType_ALLOC ListHostType = 0 + ListHostType_GRAPH ListHostType = 1 + ListHostType_META ListHostType = 2 + ListHostType_STORAGE ListHostType = 3 +) + +var ListHostTypeToName = map[ListHostType]string { + ListHostType_ALLOC: "ALLOC", + ListHostType_GRAPH: "GRAPH", + ListHostType_META: "META", + ListHostType_STORAGE: "STORAGE", +} + +var ListHostTypeToValue = map[string]ListHostType { + "ALLOC": ListHostType_ALLOC, + "GRAPH": ListHostType_GRAPH, + "META": ListHostType_META, + "STORAGE": ListHostType_STORAGE, +} + +func (p ListHostType) String() string { + if v, ok := ListHostTypeToName[p]; ok { + return v + } + return "" +} + +func ListHostTypeFromString(s string) (ListHostType, error) { + if v, ok := ListHostTypeToValue[s]; ok { + return v, nil + } + return ListHostType(0), fmt.Errorf("not a valid ListHostType string") +} + +func ListHostTypePtr(v ListHostType) *ListHostType { return &v } + +type HostRole int64 +const ( + HostRole_GRAPH HostRole = 0 + HostRole_META HostRole = 1 + HostRole_STORAGE HostRole = 2 + HostRole_LISTENER HostRole = 3 + HostRole_UNKNOWN HostRole = 4 +) + +var HostRoleToName = map[HostRole]string { + HostRole_GRAPH: "GRAPH", + HostRole_META: "META", + HostRole_STORAGE: "STORAGE", + HostRole_LISTENER: "LISTENER", + HostRole_UNKNOWN: "UNKNOWN", +} + +var HostRoleToValue = map[string]HostRole { + "GRAPH": HostRole_GRAPH, + "META": HostRole_META, + "STORAGE": HostRole_STORAGE, + "LISTENER": HostRole_LISTENER, + "UNKNOWN": HostRole_UNKNOWN, +} + +func (p HostRole) String() string { + if v, ok := HostRoleToName[p]; ok { + return v + } + return "" +} + +func HostRoleFromString(s string) (HostRole, error) { + if v, ok := HostRoleToValue[s]; ok { + return v, nil + } + return HostRole(0), fmt.Errorf("not a valid HostRole string") +} + +func HostRolePtr(v HostRole) *HostRole { return &v } + +type TaskResult_ int64 +const ( + TaskResult__SUCCEEDED TaskResult_ = 0 + TaskResult__FAILED TaskResult_ = 1 + TaskResult__IN_PROGRESS TaskResult_ = 2 + TaskResult__INVALID TaskResult_ = 3 +) + +var TaskResult_ToName = map[TaskResult_]string { + TaskResult__SUCCEEDED: "SUCCEEDED", + TaskResult__FAILED: "FAILED", + TaskResult__IN_PROGRESS: "IN_PROGRESS", + TaskResult__INVALID: "INVALID", +} + +var TaskResult_ToValue = map[string]TaskResult_ { + "SUCCEEDED": TaskResult__SUCCEEDED, + "FAILED": TaskResult__FAILED, + "IN_PROGRESS": TaskResult__IN_PROGRESS, + "INVALID": TaskResult__INVALID, +} + +func (p TaskResult_) String() string { + if v, ok := TaskResult_ToName[p]; ok { + return v + } + return "" +} + +func TaskResult_FromString(s string) (TaskResult_, error) { + if v, ok := TaskResult_ToValue[s]; ok { + return v, nil + } + return TaskResult_(0), fmt.Errorf("not a valid TaskResult_ string") +} + +func TaskResult_Ptr(v TaskResult_) *TaskResult_ { return &v } + +type ConfigModule int64 +const ( + ConfigModule_UNKNOWN ConfigModule = 0 + ConfigModule_ALL ConfigModule = 1 + ConfigModule_GRAPH ConfigModule = 2 + ConfigModule_META ConfigModule = 3 + ConfigModule_STORAGE ConfigModule = 4 +) + +var ConfigModuleToName = map[ConfigModule]string { + ConfigModule_UNKNOWN: "UNKNOWN", + ConfigModule_ALL: "ALL", + ConfigModule_GRAPH: "GRAPH", + ConfigModule_META: "META", + ConfigModule_STORAGE: "STORAGE", +} + +var ConfigModuleToValue = map[string]ConfigModule { + "UNKNOWN": ConfigModule_UNKNOWN, + "ALL": ConfigModule_ALL, + "GRAPH": ConfigModule_GRAPH, + "META": ConfigModule_META, + "STORAGE": ConfigModule_STORAGE, +} + +func (p ConfigModule) String() string { + if v, ok := ConfigModuleToName[p]; ok { + return v + } + return "" +} + +func ConfigModuleFromString(s string) (ConfigModule, error) { + if v, ok := ConfigModuleToValue[s]; ok { + return v, nil + } + return ConfigModule(0), fmt.Errorf("not a valid ConfigModule string") +} + +func ConfigModulePtr(v ConfigModule) *ConfigModule { return &v } + +type ConfigMode int64 +const ( + ConfigMode_IMMUTABLE ConfigMode = 0 + ConfigMode_REBOOT ConfigMode = 1 + ConfigMode_MUTABLE ConfigMode = 2 + ConfigMode_IGNORED ConfigMode = 3 +) + +var ConfigModeToName = map[ConfigMode]string { + ConfigMode_IMMUTABLE: "IMMUTABLE", + ConfigMode_REBOOT: "REBOOT", + ConfigMode_MUTABLE: "MUTABLE", + ConfigMode_IGNORED: "IGNORED", +} + +var ConfigModeToValue = map[string]ConfigMode { + "IMMUTABLE": ConfigMode_IMMUTABLE, + "REBOOT": ConfigMode_REBOOT, + "MUTABLE": ConfigMode_MUTABLE, + "IGNORED": ConfigMode_IGNORED, +} + +func (p ConfigMode) String() string { + if v, ok := ConfigModeToName[p]; ok { + return v + } + return "" +} + +func ConfigModeFromString(s string) (ConfigMode, error) { + if v, ok := ConfigModeToValue[s]; ok { + return v, nil + } + return ConfigMode(0), fmt.Errorf("not a valid ConfigMode string") +} + +func ConfigModePtr(v ConfigMode) *ConfigMode { return &v } + +type ListenerType int64 +const ( + ListenerType_UNKNOWN ListenerType = 0 + ListenerType_ELASTICSEARCH ListenerType = 1 +) + +var ListenerTypeToName = map[ListenerType]string { + ListenerType_UNKNOWN: "UNKNOWN", + ListenerType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var ListenerTypeToValue = map[string]ListenerType { + "UNKNOWN": ListenerType_UNKNOWN, + "ELASTICSEARCH": ListenerType_ELASTICSEARCH, +} + +func (p ListenerType) String() string { + if v, ok := ListenerTypeToName[p]; ok { + return v + } + return "" +} + +func ListenerTypeFromString(s string) (ListenerType, error) { + if v, ok := ListenerTypeToValue[s]; ok { + return v, nil + } + return ListenerType(0), fmt.Errorf("not a valid ListenerType string") +} + +func ListenerTypePtr(v ListenerType) *ListenerType { return &v } + +type FTServiceType int64 +const ( + FTServiceType_ELASTICSEARCH FTServiceType = 1 +) + +var FTServiceTypeToName = map[FTServiceType]string { + FTServiceType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var FTServiceTypeToValue = map[string]FTServiceType { + "ELASTICSEARCH": FTServiceType_ELASTICSEARCH, +} + +func (p FTServiceType) String() string { + if v, ok := FTServiceTypeToName[p]; ok { + return v + } + return "" +} + +func FTServiceTypeFromString(s string) (FTServiceType, error) { + if v, ok := FTServiceTypeToValue[s]; ok { + return v, nil + } + return FTServiceType(0), fmt.Errorf("not a valid FTServiceType string") +} + +func FTServiceTypePtr(v FTServiceType) *FTServiceType { return &v } + +type SchemaVer int64 + +func SchemaVerPtr(v SchemaVer) *SchemaVer { return &v } + +type ClusterID int64 + +func ClusterIDPtr(v ClusterID) *ClusterID { return &v } + +// Attributes: +// - SpaceID +// - TagID +// - EdgeType +// - IndexID +// - ClusterID +type ID struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + TagID *nebula0.TagID `thrift:"tag_id,2" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,3" db:"edge_type" json:"edge_type,omitempty"` + IndexID *nebula0.IndexID `thrift:"index_id,4" db:"index_id" json:"index_id,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,5" db:"cluster_id" json:"cluster_id,omitempty"` +} + +func NewID() *ID { + return &ID{} +} + +var ID_SpaceID_DEFAULT nebula0.GraphSpaceID +func (p *ID) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return ID_SpaceID_DEFAULT + } +return *p.SpaceID +} +var ID_TagID_DEFAULT nebula0.TagID +func (p *ID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return ID_TagID_DEFAULT + } +return *p.TagID +} +var ID_EdgeType_DEFAULT nebula0.EdgeType +func (p *ID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return ID_EdgeType_DEFAULT + } +return *p.EdgeType +} +var ID_IndexID_DEFAULT nebula0.IndexID +func (p *ID) GetIndexID() nebula0.IndexID { + if !p.IsSetIndexID() { + return ID_IndexID_DEFAULT + } +return *p.IndexID +} +var ID_ClusterID_DEFAULT ClusterID +func (p *ID) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return ID_ClusterID_DEFAULT + } +return *p.ClusterID +} +func (p *ID) CountSetFieldsID() int { + count := 0 + if (p.IsSetSpaceID()) { + count++ + } + if (p.IsSetTagID()) { + count++ + } + if (p.IsSetEdgeType()) { + count++ + } + if (p.IsSetIndexID()) { + count++ + } + if (p.IsSetClusterID()) { + count++ + } + return count + +} + +func (p *ID) IsSetSpaceID() bool { + return p.SpaceID != nil +} + +func (p *ID) IsSetTagID() bool { + return p.TagID != nil +} + +func (p *ID) IsSetEdgeType() bool { + return p.EdgeType != nil +} + +func (p *ID) IsSetIndexID() bool { + return p.IndexID != nil +} + +func (p *ID) IsSetClusterID() bool { + return p.ClusterID != nil +} + +func (p *ID) 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 + } + 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 *ID) 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 *ID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *ID) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *ID) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = &temp +} + return nil +} + +func (p *ID) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = &temp +} + return nil +} + +func (p *ID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsID(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("ID"); 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 *ID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *ID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_id: ", p), err) } + } + return err +} + +func (p *ID) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_type: ", p), err) } + } + return err +} + +func (p *ID) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetIndexID() { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:index_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:index_id: ", p), err) } + } + return err +} + +func (p *ID) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_id: ", p), err) } + } + return err +} + +func (p *ID) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ID(%+v)", *p) +} + +// Attributes: +// - Type +// - TypeLength +type ColumnTypeDef struct { + Type PropertyType `thrift:"type,1,required" db:"type" json:"type"` + TypeLength int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewColumnTypeDef() *ColumnTypeDef { + return &ColumnTypeDef{} +} + + +func (p *ColumnTypeDef) GetType() PropertyType { + return p.Type +} +var ColumnTypeDef_TypeLength_DEFAULT int16 = 0 + +func (p *ColumnTypeDef) GetTypeLength() int16 { + return p.TypeLength +} +func (p *ColumnTypeDef) IsSetTypeLength() bool { + return p.TypeLength != ColumnTypeDef_TypeLength_DEFAULT +} + +func (p *ColumnTypeDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType 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 + } + issetType = 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 !issetType{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnTypeDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := PropertyType(v) + p.Type = temp +} + return nil +} + +func (p *ColumnTypeDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = v +} + return nil +} + +func (p *ColumnTypeDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnTypeDef"); 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 *ColumnTypeDef) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ColumnTypeDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) } + if err := oprot.WriteI16(int16(p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *ColumnTypeDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnTypeDef(%+v)", *p) +} + +// Attributes: +// - Name +// - Type +// - DefaultValue +// - Nullable +type ColumnDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Type *ColumnTypeDef `thrift:"type,2,required" db:"type" json:"type"` + DefaultValue []byte `thrift:"default_value,3" db:"default_value" json:"default_value,omitempty"` + Nullable bool `thrift:"nullable,4" db:"nullable" json:"nullable,omitempty"` +} + +func NewColumnDef() *ColumnDef { + return &ColumnDef{} +} + + +func (p *ColumnDef) GetName() []byte { + return p.Name +} +var ColumnDef_Type_DEFAULT *ColumnTypeDef +func (p *ColumnDef) GetType() *ColumnTypeDef { + if !p.IsSetType() { + return ColumnDef_Type_DEFAULT + } +return p.Type +} +var ColumnDef_DefaultValue_DEFAULT []byte + +func (p *ColumnDef) GetDefaultValue() []byte { + return p.DefaultValue +} +var ColumnDef_Nullable_DEFAULT bool = false + +func (p *ColumnDef) GetNullable() bool { + return p.Nullable +} +func (p *ColumnDef) IsSetType() bool { + return p.Type != nil +} + +func (p *ColumnDef) IsSetDefaultValue() bool { + return p.DefaultValue != nil +} + +func (p *ColumnDef) IsSetNullable() bool { + return p.Nullable != ColumnDef_Nullable_DEFAULT +} + +func (p *ColumnDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetType 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetType = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetType{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ColumnDef) ReadField2(iprot thrift.Protocol) error { + p.Type = NewColumnTypeDef() + if err := p.Type.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err) + } + return nil +} + +func (p *ColumnDef) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.DefaultValue = v +} + return nil +} + +func (p *ColumnDef) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Nullable = v +} + return nil +} + +func (p *ColumnDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnDef"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ColumnDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *ColumnDef) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := p.Type.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *ColumnDef) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetDefaultValue() { + if err := oprot.WriteFieldBegin("default_value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:default_value: ", p), err) } + if err := oprot.WriteBinary(p.DefaultValue); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.default_value (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:default_value: ", p), err) } + } + return err +} + +func (p *ColumnDef) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNullable() { + if err := oprot.WriteFieldBegin("nullable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:nullable: ", p), err) } + if err := oprot.WriteBool(bool(p.Nullable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullable (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:nullable: ", p), err) } + } + return err +} + +func (p *ColumnDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnDef(%+v)", *p) +} + +// Attributes: +// - TtlDuration +// - TtlCol +type SchemaProp struct { + TtlDuration *int64 `thrift:"ttl_duration,1" db:"ttl_duration" json:"ttl_duration,omitempty"` + TtlCol []byte `thrift:"ttl_col,2" db:"ttl_col" json:"ttl_col,omitempty"` +} + +func NewSchemaProp() *SchemaProp { + return &SchemaProp{} +} + +var SchemaProp_TtlDuration_DEFAULT int64 +func (p *SchemaProp) GetTtlDuration() int64 { + if !p.IsSetTtlDuration() { + return SchemaProp_TtlDuration_DEFAULT + } +return *p.TtlDuration +} +var SchemaProp_TtlCol_DEFAULT []byte + +func (p *SchemaProp) GetTtlCol() []byte { + return p.TtlCol +} +func (p *SchemaProp) IsSetTtlDuration() bool { + return p.TtlDuration != nil +} + +func (p *SchemaProp) IsSetTtlCol() bool { + return p.TtlCol != nil +} + +func (p *SchemaProp) 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 *SchemaProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TtlDuration = &v +} + return nil +} + +func (p *SchemaProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TtlCol = v +} + return nil +} + +func (p *SchemaProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SchemaProp"); 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 *SchemaProp) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTtlDuration() { + if err := oprot.WriteFieldBegin("ttl_duration", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ttl_duration: ", p), err) } + if err := oprot.WriteI64(int64(*p.TtlDuration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_duration (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ttl_duration: ", p), err) } + } + return err +} + +func (p *SchemaProp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTtlCol() { + if err := oprot.WriteFieldBegin("ttl_col", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_col: ", p), err) } + if err := oprot.WriteBinary(p.TtlCol); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_col (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_col: ", p), err) } + } + return err +} + +func (p *SchemaProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemaProp(%+v)", *p) +} + +// Attributes: +// - Columns +// - SchemaProp +type Schema struct { + Columns []*ColumnDef `thrift:"columns,1" db:"columns" json:"columns"` + SchemaProp *SchemaProp `thrift:"schema_prop,2" db:"schema_prop" json:"schema_prop"` +} + +func NewSchema() *Schema { + return &Schema{} +} + + +func (p *Schema) GetColumns() []*ColumnDef { + return p.Columns +} +var Schema_SchemaProp_DEFAULT *SchemaProp +func (p *Schema) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return Schema_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *Schema) IsSetSchemaProp() bool { + return p.SchemaProp != nil +} + +func (p *Schema) 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 *Schema) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Columns = tSlice + for i := 0; i < size; i ++ { + _elem1 := NewColumnDef() + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Columns = append(p.Columns, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Schema) ReadField2(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *Schema) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Schema"); 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 *Schema) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } + return err +} + +func (p *Schema) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_prop: ", p), err) } + return err +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Schema(%+v)", *p) +} + +// Attributes: +// - Id +// - Name +type IdName struct { + Id *ID `thrift:"id,1" db:"id" json:"id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewIdName() *IdName { + return &IdName{} +} + +var IdName_Id_DEFAULT *ID +func (p *IdName) GetId() *ID { + if !p.IsSetId() { + return IdName_Id_DEFAULT + } +return p.Id +} + +func (p *IdName) GetName() []byte { + return p.Name +} +func (p *IdName) IsSetId() bool { + return p.Id != nil +} + +func (p *IdName) 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 *IdName) ReadField1(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *IdName) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IdName) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IdName"); 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 *IdName) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *IdName) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *IdName) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IdName(%+v)", *p) +} + +// Attributes: +// - SpaceName +// - PartitionNum +// - ReplicaFactor +// - CharsetName +// - CollateName +// - VidType +// - GroupName +// - IsolationLevel +type SpaceDesc struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + PartitionNum int32 `thrift:"partition_num,2" db:"partition_num" json:"partition_num"` + ReplicaFactor int32 `thrift:"replica_factor,3" db:"replica_factor" json:"replica_factor"` + CharsetName []byte `thrift:"charset_name,4" db:"charset_name" json:"charset_name"` + CollateName []byte `thrift:"collate_name,5" db:"collate_name" json:"collate_name"` + VidType *ColumnTypeDef `thrift:"vid_type,6" db:"vid_type" json:"vid_type"` + GroupName []byte `thrift:"group_name,7" db:"group_name" json:"group_name,omitempty"` + IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` +} + +func NewSpaceDesc() *SpaceDesc { + return &SpaceDesc{} +} + + +func (p *SpaceDesc) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *SpaceDesc) GetPartitionNum() int32 { + return p.PartitionNum +} + +func (p *SpaceDesc) GetReplicaFactor() int32 { + return p.ReplicaFactor +} + +func (p *SpaceDesc) GetCharsetName() []byte { + return p.CharsetName +} + +func (p *SpaceDesc) GetCollateName() []byte { + return p.CollateName +} +var SpaceDesc_VidType_DEFAULT *ColumnTypeDef = &ColumnTypeDef{ + Type: 7, + TypeLength: 8, +} +func (p *SpaceDesc) GetVidType() *ColumnTypeDef { + if !p.IsSetVidType() { + return SpaceDesc_VidType_DEFAULT + } +return p.VidType +} +var SpaceDesc_GroupName_DEFAULT []byte + +func (p *SpaceDesc) GetGroupName() []byte { + return p.GroupName +} +var SpaceDesc_IsolationLevel_DEFAULT IsolationLevel +func (p *SpaceDesc) GetIsolationLevel() IsolationLevel { + if !p.IsSetIsolationLevel() { + return SpaceDesc_IsolationLevel_DEFAULT + } +return *p.IsolationLevel +} +func (p *SpaceDesc) IsSetVidType() bool { + return p.VidType != nil +} + +func (p *SpaceDesc) IsSetGroupName() bool { + return p.GroupName != nil +} + +func (p *SpaceDesc) IsSetIsolationLevel() bool { + return p.IsolationLevel != nil +} + +func (p *SpaceDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *SpaceDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.PartitionNum = v +} + return nil +} + +func (p *SpaceDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReplicaFactor = v +} + return nil +} + +func (p *SpaceDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.CharsetName = v +} + return nil +} + +func (p *SpaceDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.CollateName = v +} + return nil +} + +func (p *SpaceDesc) ReadField6(iprot thrift.Protocol) error { + p.VidType = NewColumnTypeDef() + if err := p.VidType.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VidType), err) + } + return nil +} + +func (p *SpaceDesc) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *SpaceDesc) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + temp := IsolationLevel(v) + p.IsolationLevel = &temp +} + return nil +} + +func (p *SpaceDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SpaceDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_num", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_num: ", p), err) } + if err := oprot.WriteI32(int32(p.PartitionNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_num (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_num: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("replica_factor", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:replica_factor: ", p), err) } + if err := oprot.WriteI32(int32(p.ReplicaFactor)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_factor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:replica_factor: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("charset_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:charset_name: ", p), err) } + if err := oprot.WriteBinary(p.CharsetName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.charset_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:charset_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("collate_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:collate_name: ", p), err) } + if err := oprot.WriteBinary(p.CollateName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.collate_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:collate_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid_type", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vid_type: ", p), err) } + if err := p.VidType.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VidType), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vid_type: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetGroupName() { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:group_name: ", p), err) } + } + return err +} + +func (p *SpaceDesc) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetIsolationLevel() { + if err := oprot.WriteFieldBegin("isolation_level", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:isolation_level: ", p), err) } + if err := oprot.WriteI32(int32(*p.IsolationLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isolation_level (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:isolation_level: ", p), err) } + } + return err +} + +func (p *SpaceDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceDesc(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Properties +type SpaceItem struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Properties *SpaceDesc `thrift:"properties,2" db:"properties" json:"properties"` +} + +func NewSpaceItem() *SpaceItem { + return &SpaceItem{} +} + + +func (p *SpaceItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var SpaceItem_Properties_DEFAULT *SpaceDesc +func (p *SpaceItem) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return SpaceItem_Properties_DEFAULT + } +return p.Properties +} +func (p *SpaceItem) IsSetProperties() bool { + return p.Properties != nil +} + +func (p *SpaceItem) 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 *SpaceItem) 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 *SpaceItem) ReadField2(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *SpaceItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceItem"); 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 *SpaceItem) 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 *SpaceItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:properties: ", p), err) } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) } + return err +} + +func (p *SpaceItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceItem(%+v)", *p) +} + +// Attributes: +// - TagID +// - TagName +// - Version +// - Schema +type TagItem struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewTagItem() *TagItem { + return &TagItem{} +} + + +func (p *TagItem) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *TagItem) GetTagName() []byte { + return p.TagName +} + +func (p *TagItem) GetVersion() SchemaVer { + return p.Version +} +var TagItem_Schema_DEFAULT *Schema +func (p *TagItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return TagItem_Schema_DEFAULT + } +return p.Schema +} +func (p *TagItem) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *TagItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TagItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *TagItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *TagItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *TagItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TagItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TagItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TagItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *TagItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *TagItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *TagItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *TagItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TagItem(%+v)", *p) +} + +// Attributes: +// - Op +// - Schema +type AlterSchemaItem struct { + Op AlterSchemaOp `thrift:"op,1" db:"op" json:"op"` + Schema *Schema `thrift:"schema,2" db:"schema" json:"schema"` +} + +func NewAlterSchemaItem() *AlterSchemaItem { + return &AlterSchemaItem{} +} + + +func (p *AlterSchemaItem) GetOp() AlterSchemaOp { + return p.Op +} +var AlterSchemaItem_Schema_DEFAULT *Schema +func (p *AlterSchemaItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return AlterSchemaItem_Schema_DEFAULT + } +return p.Schema +} +func (p *AlterSchemaItem) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *AlterSchemaItem) 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 *AlterSchemaItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := AlterSchemaOp(v) + p.Op = temp +} + return nil +} + +func (p *AlterSchemaItem) ReadField2(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *AlterSchemaItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterSchemaItem"); 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 *AlterSchemaItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) } + return err +} + +func (p *AlterSchemaItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } + return err +} + +func (p *AlterSchemaItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterSchemaItem(%+v)", *p) +} + +// Attributes: +// - EdgeType +// - EdgeName +// - Version +// - Schema +type EdgeItem struct { + EdgeType nebula0.EdgeType `thrift:"edge_type,1" db:"edge_type" json:"edge_type"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewEdgeItem() *EdgeItem { + return &EdgeItem{} +} + + +func (p *EdgeItem) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeItem) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *EdgeItem) GetVersion() SchemaVer { + return p.Version +} +var EdgeItem_Schema_DEFAULT *Schema +func (p *EdgeItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return EdgeItem_Schema_DEFAULT + } +return p.Schema +} +func (p *EdgeItem) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *EdgeItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *EdgeItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *EdgeItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *EdgeItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_type: ", p), err) } + return err +} + +func (p *EdgeItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *EdgeItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *EdgeItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *EdgeItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeItem(%+v)", *p) +} + +// Attributes: +// - TagID +// - EdgeType +type SchemaID struct { + TagID *nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type,omitempty"` +} + +func NewSchemaID() *SchemaID { + return &SchemaID{} +} + +var SchemaID_TagID_DEFAULT nebula0.TagID +func (p *SchemaID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return SchemaID_TagID_DEFAULT + } +return *p.TagID +} +var SchemaID_EdgeType_DEFAULT nebula0.EdgeType +func (p *SchemaID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return SchemaID_EdgeType_DEFAULT + } +return *p.EdgeType +} +func (p *SchemaID) CountSetFieldsSchemaID() int { + count := 0 + if (p.IsSetTagID()) { + count++ + } + if (p.IsSetEdgeType()) { + count++ + } + return count + +} + +func (p *SchemaID) IsSetTagID() bool { + return p.TagID != nil +} + +func (p *SchemaID) IsSetEdgeType() bool { + return p.EdgeType != nil +} + +func (p *SchemaID) 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 *SchemaID) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *SchemaID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *SchemaID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsSchemaID(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SchemaID"); 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 *SchemaID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + } + return err +} + +func (p *SchemaID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + } + return err +} + +func (p *SchemaID) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemaID(%+v)", *p) +} + +// Attributes: +// - IndexID +// - IndexName +// - SchemaID +// - SchemaName +// - Fields +type IndexItem struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + SchemaID *SchemaID `thrift:"schema_id,3" db:"schema_id" json:"schema_id"` + SchemaName []byte `thrift:"schema_name,4" db:"schema_name" json:"schema_name"` + Fields []*ColumnDef `thrift:"fields,5" db:"fields" json:"fields"` +} + +func NewIndexItem() *IndexItem { + return &IndexItem{} +} + + +func (p *IndexItem) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexItem) GetIndexName() []byte { + return p.IndexName +} +var IndexItem_SchemaID_DEFAULT *SchemaID +func (p *IndexItem) GetSchemaID() *SchemaID { + if !p.IsSetSchemaID() { + return IndexItem_SchemaID_DEFAULT + } +return p.SchemaID +} + +func (p *IndexItem) GetSchemaName() []byte { + return p.SchemaName +} + +func (p *IndexItem) GetFields() []*ColumnDef { + return p.Fields +} +func (p *IndexItem) IsSetSchemaID() bool { + return p.SchemaID != nil +} + +func (p *IndexItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + 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 *IndexItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *IndexItem) ReadField3(iprot thrift.Protocol) error { + p.SchemaID = NewSchemaID() + if err := p.SchemaID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SchemaName = v +} + return nil +} + +func (p *IndexItem) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewColumnDef() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.Fields = append(p.Fields, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *IndexItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema_id: ", p), err) } + if err := p.SchemaID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_name: ", p), err) } + if err := oprot.WriteBinary(p.SchemaName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schema_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err) } + return err +} + +func (p *IndexItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexItem(%+v)", *p) +} + +// Attributes: +// - HostAddr +// - Status +// - LeaderParts +// - AllParts +// - Role +// - GitInfoSha +// - ZoneName +type HostItem struct { + HostAddr *nebula0.HostAddr `thrift:"hostAddr,1" db:"hostAddr" json:"hostAddr"` + Status HostStatus `thrift:"status,2" db:"status" json:"status"` + LeaderParts map[string][]nebula0.PartitionID `thrift:"leader_parts,3" db:"leader_parts" json:"leader_parts"` + AllParts map[string][]nebula0.PartitionID `thrift:"all_parts,4" db:"all_parts" json:"all_parts"` + Role HostRole `thrift:"role,5" db:"role" json:"role"` + GitInfoSha []byte `thrift:"git_info_sha,6" db:"git_info_sha" json:"git_info_sha"` + ZoneName []byte `thrift:"zone_name,7" db:"zone_name" json:"zone_name,omitempty"` +} + +func NewHostItem() *HostItem { + return &HostItem{} +} + +var HostItem_HostAddr_DEFAULT *nebula0.HostAddr +func (p *HostItem) GetHostAddr() *nebula0.HostAddr { + if !p.IsSetHostAddr() { + return HostItem_HostAddr_DEFAULT + } +return p.HostAddr +} + +func (p *HostItem) GetStatus() HostStatus { + return p.Status +} + +func (p *HostItem) GetLeaderParts() map[string][]nebula0.PartitionID { + return p.LeaderParts +} + +func (p *HostItem) GetAllParts() map[string][]nebula0.PartitionID { + return p.AllParts +} + +func (p *HostItem) GetRole() HostRole { + return p.Role +} + +func (p *HostItem) GetGitInfoSha() []byte { + return p.GitInfoSha +} +var HostItem_ZoneName_DEFAULT []byte + +func (p *HostItem) GetZoneName() []byte { + return p.ZoneName +} +func (p *HostItem) IsSetHostAddr() bool { + return p.HostAddr != nil +} + +func (p *HostItem) IsSetZoneName() bool { + return p.ZoneName != nil +} + +func (p *HostItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostItem) ReadField1(iprot thrift.Protocol) error { + p.HostAddr = nebula0.NewHostAddr() + if err := p.HostAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostAddr), err) + } + return nil +} + +func (p *HostItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *HostItem) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key3 = v +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val4 := tSlice + for i := 0; i < size; i ++ { +var _elem5 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem5 = temp +} + _val4 = append(_val4, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.AllParts = tMap + for i := 0; i < size; i ++ { +var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key6 = v +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val7 := tSlice + for i := 0; i < size; i ++ { +var _elem8 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem8 = temp +} + _val7 = append(_val7, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.AllParts[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HostItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HostItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *HostItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hostAddr", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hostAddr: ", p), err) } + if err := p.HostAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostAddr: ", p), err) } + return err +} + +func (p *HostItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *HostItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:leader_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("all_parts", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:all_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.AllParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.AllParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 4:all_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:role: ", p), err) } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:role: ", p), err) } + return err +} + +func (p *HostItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:git_info_sha: ", p), err) } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:git_info_sha: ", p), err) } + return err +} + +func (p *HostItem) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetZoneName() { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_name: ", p), err) } + } + return err +} + +func (p *HostItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostItem(%+v)", *p) +} + +// Attributes: +// - Account +// - IsLock +// - MaxQueriesPerHour +// - MaxUpdatesPerHour +// - MaxConnectionsPerHour +// - MaxUserConnections +type UserItem struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IsLock bool `thrift:"is_lock,2" db:"is_lock" json:"is_lock"` + MaxQueriesPerHour int32 `thrift:"max_queries_per_hour,3" db:"max_queries_per_hour" json:"max_queries_per_hour"` + MaxUpdatesPerHour int32 `thrift:"max_updates_per_hour,4" db:"max_updates_per_hour" json:"max_updates_per_hour"` + MaxConnectionsPerHour int32 `thrift:"max_connections_per_hour,5" db:"max_connections_per_hour" json:"max_connections_per_hour"` + MaxUserConnections int32 `thrift:"max_user_connections,6" db:"max_user_connections" json:"max_user_connections"` +} + +func NewUserItem() *UserItem { + return &UserItem{} +} + + +func (p *UserItem) GetAccount() []byte { + return p.Account +} + +func (p *UserItem) GetIsLock() bool { + return p.IsLock +} + +func (p *UserItem) GetMaxQueriesPerHour() int32 { + return p.MaxQueriesPerHour +} + +func (p *UserItem) GetMaxUpdatesPerHour() int32 { + return p.MaxUpdatesPerHour +} + +func (p *UserItem) GetMaxConnectionsPerHour() int32 { + return p.MaxConnectionsPerHour +} + +func (p *UserItem) GetMaxUserConnections() int32 { + return p.MaxUserConnections +} +func (p *UserItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UserItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *UserItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsLock = v +} + return nil +} + +func (p *UserItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.MaxQueriesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.MaxUpdatesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.MaxConnectionsPerHour = v +} + return nil +} + +func (p *UserItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.MaxUserConnections = v +} + return nil +} + +func (p *UserItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UserItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UserItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *UserItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_lock", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_lock: ", p), err) } + if err := oprot.WriteBool(bool(p.IsLock)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_lock (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_lock: ", p), err) } + return err +} + +func (p *UserItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_queries_per_hour", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_queries_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxQueriesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_queries_per_hour (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_queries_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_updates_per_hour", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_updates_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxUpdatesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_updates_per_hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_updates_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_connections_per_hour", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_connections_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxConnectionsPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_connections_per_hour (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_connections_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_user_connections", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:max_user_connections: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxUserConnections)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_user_connections (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_user_connections: ", p), err) } + return err +} + +func (p *UserItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserItem(%+v)", *p) +} + +// Attributes: +// - UserID +// - SpaceID +// - RoleType +type RoleItem struct { + UserID []byte `thrift:"user_id,1" db:"user_id" json:"user_id"` + SpaceID nebula0.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` + RoleType RoleType `thrift:"role_type,3" db:"role_type" json:"role_type"` +} + +func NewRoleItem() *RoleItem { + return &RoleItem{} +} + + +func (p *RoleItem) GetUserID() []byte { + return p.UserID +} + +func (p *RoleItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RoleItem) GetRoleType() RoleType { + return p.RoleType +} +func (p *RoleItem) 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 *RoleItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.UserID = v +} + return nil +} + +func (p *RoleItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RoleItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := RoleType(v) + p.RoleType = temp +} + return nil +} + +func (p *RoleItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RoleItem"); 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 *RoleItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user_id: ", p), err) } + if err := oprot.WriteBinary(p.UserID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role_type: ", p), err) } + if err := oprot.WriteI32(int32(p.RoleType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role_type: ", p), err) } + return err +} + +func (p *RoleItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RoleItem(%+v)", *p) +} + +// Attributes: +// - Code +// - Id +// - Leader +type ExecResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id *ID `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` +} + +func NewExecResp() *ExecResp { + return &ExecResp{} +} + + +func (p *ExecResp) GetCode() ErrorCode { + return p.Code +} +var ExecResp_Id_DEFAULT *ID +func (p *ExecResp) GetId() *ID { + if !p.IsSetId() { + return ExecResp_Id_DEFAULT + } +return p.Id +} +var ExecResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ExecResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ExecResp_Leader_DEFAULT + } +return p.Leader +} +func (p *ExecResp) IsSetId() bool { + return p.Id != nil +} + +func (p *ExecResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ExecResp) 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 *ExecResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ExecResp) ReadField2(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *ExecResp) ReadField3(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 *ExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResp"); 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 *ExecResp) 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 *ExecResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *ExecResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + return err +} + +func (p *ExecResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecResp(%+v)", *p) +} + +// Attributes: +// - Op +// - Cmd +// - Paras +type AdminJobReq struct { + Op AdminJobOp `thrift:"op,1" db:"op" json:"op"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` +} + +func NewAdminJobReq() *AdminJobReq { + return &AdminJobReq{} +} + + +func (p *AdminJobReq) GetOp() AdminJobOp { + return p.Op +} + +func (p *AdminJobReq) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *AdminJobReq) GetParas() [][]byte { + return p.Paras +} +func (p *AdminJobReq) 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 *AdminJobReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := AdminJobOp(v) + p.Op = temp +} + return nil +} + +func (p *AdminJobReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AdminJobReq) ReadField3(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.Paras = tSlice + for i := 0; i < size; i ++ { +var _elem9 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem9 = v +} + p.Paras = append(p.Paras, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobReq"); 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 *AdminJobReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) } + return err +} + +func (p *AdminJobReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobReq(%+v)", *p) +} + +// Attributes: +// - Id +// - Cmd +// - Paras +// - Status +// - StartTime +// - StopTime +type JobDesc struct { + Id int32 `thrift:"id,1" db:"id" json:"id"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras []string `thrift:"paras,3" db:"paras" json:"paras"` + Status JobStatus `thrift:"status,4" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,5" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,6" db:"stop_time" json:"stop_time"` +} + +func NewJobDesc() *JobDesc { + return &JobDesc{} +} + + +func (p *JobDesc) GetId() int32 { + return p.Id +} + +func (p *JobDesc) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *JobDesc) GetParas() []string { + return p.Paras +} + +func (p *JobDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *JobDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *JobDesc) GetStopTime() int64 { + return p.StopTime +} +func (p *JobDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JobDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *JobDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *JobDesc) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Paras = tSlice + for i := 0; i < size; i ++ { +var _elem10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem10 = v +} + p.Paras = append(p.Paras, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *JobDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *JobDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *JobDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *JobDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("JobDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *JobDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := oprot.WriteI32(int32(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *JobDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) } + return err +} + +func (p *JobDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) } + return err +} + +func (p *JobDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *JobDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:start_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) } + return err +} + +func (p *JobDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:stop_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:stop_time: ", p), err) } + return err +} + +func (p *JobDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("JobDesc(%+v)", *p) +} + +// Attributes: +// - TaskID +// - Host +// - Status +// - StartTime +// - StopTime +// - JobID +type TaskDesc struct { + TaskID int32 `thrift:"task_id,1" db:"task_id" json:"task_id"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + Status JobStatus `thrift:"status,3" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` + JobID int32 `thrift:"job_id,6" db:"job_id" json:"job_id"` +} + +func NewTaskDesc() *TaskDesc { + return &TaskDesc{} +} + + +func (p *TaskDesc) GetTaskID() int32 { + return p.TaskID +} +var TaskDesc_Host_DEFAULT *nebula0.HostAddr +func (p *TaskDesc) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return TaskDesc_Host_DEFAULT + } +return p.Host +} + +func (p *TaskDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *TaskDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *TaskDesc) GetStopTime() int64 { + return p.StopTime +} + +func (p *TaskDesc) GetJobID() int32 { + return p.JobID +} +func (p *TaskDesc) IsSetHost() bool { + return p.Host != nil +} + +func (p *TaskDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *TaskDesc) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *TaskDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *TaskDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *TaskDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *TaskDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *TaskDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TaskDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:task_id: ", p), err) } + return err +} + +func (p *TaskDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *TaskDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) } + return err +} + +func (p *TaskDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:start_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:start_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:stop_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stop_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:job_id: ", p), err) } + return err +} + +func (p *TaskDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TaskDesc(%+v)", *p) +} + +// Attributes: +// - JobID +// - JobDesc +// - TaskDesc +// - RecoveredJobNum +type AdminJobResult_ struct { + JobID *int32 `thrift:"job_id,1" db:"job_id" json:"job_id,omitempty"` + JobDesc []*JobDesc `thrift:"job_desc,2" db:"job_desc" json:"job_desc,omitempty"` + TaskDesc []*TaskDesc `thrift:"task_desc,3" db:"task_desc" json:"task_desc,omitempty"` + RecoveredJobNum *int32 `thrift:"recovered_job_num,4" db:"recovered_job_num" json:"recovered_job_num,omitempty"` +} + +func NewAdminJobResult_() *AdminJobResult_ { + return &AdminJobResult_{} +} + +var AdminJobResult__JobID_DEFAULT int32 +func (p *AdminJobResult_) GetJobID() int32 { + if !p.IsSetJobID() { + return AdminJobResult__JobID_DEFAULT + } +return *p.JobID +} +var AdminJobResult__JobDesc_DEFAULT []*JobDesc + +func (p *AdminJobResult_) GetJobDesc() []*JobDesc { + return p.JobDesc +} +var AdminJobResult__TaskDesc_DEFAULT []*TaskDesc + +func (p *AdminJobResult_) GetTaskDesc() []*TaskDesc { + return p.TaskDesc +} +var AdminJobResult__RecoveredJobNum_DEFAULT int32 +func (p *AdminJobResult_) GetRecoveredJobNum() int32 { + if !p.IsSetRecoveredJobNum() { + return AdminJobResult__RecoveredJobNum_DEFAULT + } +return *p.RecoveredJobNum +} +func (p *AdminJobResult_) IsSetJobID() bool { + return p.JobID != nil +} + +func (p *AdminJobResult_) IsSetJobDesc() bool { + return p.JobDesc != nil +} + +func (p *AdminJobResult_) IsSetTaskDesc() bool { + return p.TaskDesc != nil +} + +func (p *AdminJobResult_) IsSetRecoveredJobNum() bool { + return p.RecoveredJobNum != nil +} + +func (p *AdminJobResult_) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResult_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = &v +} + return nil +} + +func (p *AdminJobResult_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*JobDesc, 0, size) + p.JobDesc = tSlice + for i := 0; i < size; i ++ { + _elem11 := NewJobDesc() + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.JobDesc = append(p.JobDesc, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TaskDesc, 0, size) + p.TaskDesc = tSlice + for i := 0; i < size; i ++ { + _elem12 := NewTaskDesc() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.TaskDesc = append(p.TaskDesc, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.RecoveredJobNum = &v +} + return nil +} + +func (p *AdminJobResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResult"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminJobResult_) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetJobID() { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetJobDesc() { + if err := oprot.WriteFieldBegin("job_desc", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_desc: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.JobDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.JobDesc { + 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:job_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskDesc() { + if err := oprot.WriteFieldBegin("task_desc", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_desc: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TaskDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskDesc { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetRecoveredJobNum() { + if err := oprot.WriteFieldBegin("recovered_job_num", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:recovered_job_num: ", p), err) } + if err := oprot.WriteI32(int32(*p.RecoveredJobNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.recovered_job_num (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:recovered_job_num: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobResult_(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Result_ +type AdminJobResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Result_ *AdminJobResult_ `thrift:"result,3" db:"result" json:"result"` +} + +func NewAdminJobResp() *AdminJobResp { + return &AdminJobResp{} +} + + +func (p *AdminJobResp) GetCode() ErrorCode { + return p.Code +} +var AdminJobResp_Leader_DEFAULT *nebula0.HostAddr +func (p *AdminJobResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return AdminJobResp_Leader_DEFAULT + } +return p.Leader +} +var AdminJobResp_Result__DEFAULT *AdminJobResult_ +func (p *AdminJobResp) GetResult_() *AdminJobResult_ { + if !p.IsSetResult_() { + return AdminJobResp_Result__DEFAULT + } +return p.Result_ +} +func (p *AdminJobResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *AdminJobResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *AdminJobResp) 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 *AdminJobResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *AdminJobResp) 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 *AdminJobResp) ReadField3(iprot thrift.Protocol) error { + p.Result_ = NewAdminJobResult_() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminJobResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResp"); 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:result: ", p), err) } + return err +} + +func (p *AdminJobResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobResp(%+v)", *p) +} + +// Attributes: +// - PartID +// - Proportion +type Correlativity struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Proportion float64 `thrift:"proportion,2" db:"proportion" json:"proportion"` +} + +func NewCorrelativity() *Correlativity { + return &Correlativity{} +} + + +func (p *Correlativity) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *Correlativity) GetProportion() float64 { + return p.Proportion +} +func (p *Correlativity) 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 *Correlativity) 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 *Correlativity) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Proportion = v +} + return nil +} + +func (p *Correlativity) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Correlativity"); 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 *Correlativity) 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 *Correlativity) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("proportion", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:proportion: ", p), err) } + if err := oprot.WriteDouble(float64(p.Proportion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.proportion (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:proportion: ", p), err) } + return err +} + +func (p *Correlativity) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Correlativity(%+v)", *p) +} + +// Attributes: +// - TagVertices +// - Edges +// - SpaceVertices +// - SpaceEdges +// - PartCorelativity +// - Status +type StatisItem struct { + TagVertices map[string]int64 `thrift:"tag_vertices,1" db:"tag_vertices" json:"tag_vertices"` + Edges map[string]int64 `thrift:"edges,2" db:"edges" json:"edges"` + SpaceVertices int64 `thrift:"space_vertices,3" db:"space_vertices" json:"space_vertices"` + SpaceEdges int64 `thrift:"space_edges,4" db:"space_edges" json:"space_edges"` + PartCorelativity map[nebula0.PartitionID][]*Correlativity `thrift:"part_corelativity,5" db:"part_corelativity" json:"part_corelativity"` + Status JobStatus `thrift:"status,6" db:"status" json:"status"` +} + +func NewStatisItem() *StatisItem { + return &StatisItem{} +} + + +func (p *StatisItem) GetTagVertices() map[string]int64 { + return p.TagVertices +} + +func (p *StatisItem) GetEdges() map[string]int64 { + return p.Edges +} + +func (p *StatisItem) GetSpaceVertices() int64 { + return p.SpaceVertices +} + +func (p *StatisItem) GetSpaceEdges() int64 { + return p.SpaceEdges +} + +func (p *StatisItem) GetPartCorelativity() map[nebula0.PartitionID][]*Correlativity { + return p.PartCorelativity +} + +func (p *StatisItem) GetStatus() JobStatus { + return p.Status +} +func (p *StatisItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatisItem) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.TagVertices = tMap + for i := 0; i < size; i ++ { +var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key13 = v +} +var _val14 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val14 = v +} + p.TagVertices[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.Edges = tMap + for i := 0; i < size; i ++ { +var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key15 = v +} +var _val16 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val16 = v +} + p.Edges[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SpaceVertices = v +} + return nil +} + +func (p *StatisItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceEdges = v +} + return nil +} + +func (p *StatisItem) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.PartCorelativity = tMap + for i := 0; i < size; i ++ { +var _key17 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key17 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val18 := tSlice + for i := 0; i < size; i ++ { + _elem19 := NewCorrelativity() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + _val18 = append(_val18, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PartCorelativity[_key17] = _val18 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *StatisItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatisItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StatisItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_vertices", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_vertices: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.TagVertices)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.TagVertices { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_vertices: ", p), err) } + return err +} + +func (p *StatisItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edges: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.Edges)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Edges { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edges: ", p), err) } + return err +} + +func (p *StatisItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_vertices", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:space_vertices: ", p), err) } + if err := oprot.WriteI64(int64(p.SpaceVertices)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_vertices (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:space_vertices: ", p), err) } + return err +} + +func (p *StatisItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_edges", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_edges: ", p), err) } + if err := oprot.WriteI64(int64(p.SpaceEdges)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_edges (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_edges: ", p), err) } + return err +} + +func (p *StatisItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_corelativity", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:part_corelativity: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PartCorelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PartCorelativity { + 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 5:part_corelativity: ", p), err) } + return err +} + +func (p *StatisItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:status: ", p), err) } + return err +} + +func (p *StatisItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StatisItem(%+v)", *p) +} + +// Attributes: +// - Properties +// - IfNotExists +type CreateSpaceReq struct { + Properties *SpaceDesc `thrift:"properties,1" db:"properties" json:"properties"` + IfNotExists bool `thrift:"if_not_exists,2" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateSpaceReq() *CreateSpaceReq { + return &CreateSpaceReq{} +} + +var CreateSpaceReq_Properties_DEFAULT *SpaceDesc +func (p *CreateSpaceReq) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return CreateSpaceReq_Properties_DEFAULT + } +return p.Properties +} + +func (p *CreateSpaceReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateSpaceReq) IsSetProperties() bool { + return p.Properties != nil +} + +func (p *CreateSpaceReq) 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 *CreateSpaceReq) ReadField1(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSpaceReq"); 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 *CreateSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:properties: ", p), err) } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:properties: ", p), err) } + return err +} + +func (p *CreateSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_not_exists: ", p), err) } + return err +} + +func (p *CreateSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSpaceReq(%+v)", *p) +} + +// Attributes: +// - SpaceName +// - IfExists +type DropSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropSpaceReq() *DropSpaceReq { + return &DropSpaceReq{} +} + + +func (p *DropSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *DropSpaceReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropSpaceReq) 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 *DropSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *DropSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSpaceReq"); 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 *DropSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *DropSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropSpaceReq(%+v)", *p) +} + +type ListSpacesReq struct { +} + +func NewListSpacesReq() *ListSpacesReq { + return &ListSpacesReq{} +} + +func (p *ListSpacesReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSpacesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSpacesReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Spaces +type ListSpacesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Spaces []*IdName `thrift:"spaces,3" db:"spaces" json:"spaces"` +} + +func NewListSpacesResp() *ListSpacesResp { + return &ListSpacesResp{} +} + + +func (p *ListSpacesResp) GetCode() ErrorCode { + return p.Code +} +var ListSpacesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSpacesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSpacesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSpacesResp) GetSpaces() []*IdName { + return p.Spaces +} +func (p *ListSpacesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListSpacesResp) 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 *ListSpacesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSpacesResp) 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 *ListSpacesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IdName, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i ++ { + _elem20 := NewIdName() + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + } + p.Spaces = append(p.Spaces, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSpacesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesResp"); 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spaces: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spaces: ", p), err) } + return err +} + +func (p *ListSpacesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSpacesResp(%+v)", *p) +} + +// Attributes: +// - SpaceName +type GetSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` +} + +func NewGetSpaceReq() *GetSpaceReq { + return &GetSpaceReq{} +} + + +func (p *GetSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} +func (p *GetSpaceReq) 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 *GetSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *GetSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceReq"); 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 *GetSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *GetSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSpaceReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetSpaceResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *SpaceItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetSpaceResp() *GetSpaceResp { + return &GetSpaceResp{} +} + + +func (p *GetSpaceResp) GetCode() ErrorCode { + return p.Code +} +var GetSpaceResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetSpaceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSpaceResp_Leader_DEFAULT + } +return p.Leader +} +var GetSpaceResp_Item_DEFAULT *SpaceItem +func (p *GetSpaceResp) GetItem() *SpaceItem { + if !p.IsSetItem() { + return GetSpaceResp_Item_DEFAULT + } +return p.Item +} +func (p *GetSpaceResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetSpaceResp) IsSetItem() bool { + return p.Item != nil +} + +func (p *GetSpaceResp) 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 *GetSpaceResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetSpaceResp) 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 *GetSpaceResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewSpaceItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetSpaceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceResp"); 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetSpaceResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSpaceResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - TagName +// - Schema +// - IfNotExists +type CreateTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateTagReq() *CreateTagReq { + return &CreateTagReq{} +} + + +func (p *CreateTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagReq) GetTagName() []byte { + return p.TagName +} +var CreateTagReq_Schema_DEFAULT *Schema +func (p *CreateTagReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateTagReq_Schema_DEFAULT + } +return p.Schema +} + +func (p *CreateTagReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateTagReq) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *CreateTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateTagReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTagReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - TagName +// - TagItems +// - SchemaProp +type AlterTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + TagItems []*AlterSchemaItem `thrift:"tag_items,3" db:"tag_items" json:"tag_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterTagReq() *AlterTagReq { + return &AlterTagReq{} +} + + +func (p *AlterTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *AlterTagReq) GetTagItems() []*AlterSchemaItem { + return p.TagItems +} +var AlterTagReq_SchemaProp_DEFAULT *SchemaProp +func (p *AlterTagReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterTagReq_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *AlterTagReq) IsSetSchemaProp() bool { + return p.SchemaProp != nil +} + +func (p *AlterTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *AlterTagReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.TagItems = tSlice + for i := 0; i < size; i ++ { + _elem21 := NewAlterSchemaItem() + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + } + p.TagItems = append(p.TagItems, _elem21) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterTagReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TagItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TagItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_items: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterTagReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - TagName +// - IfExists +type DropTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagReq() *DropTagReq { + return &DropTagReq{} +} + + +func (p *DropTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *DropTagReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagReq) 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 *DropTagReq) 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 *DropTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *DropTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagReq"); 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 *DropTagReq) 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 *DropTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *DropTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropTagReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListTagsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagsReq() *ListTagsReq { + return &ListTagsReq{} +} + + +func (p *ListTagsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagsReq) 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 *ListTagsReq) 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 *ListTagsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsReq"); 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 *ListTagsReq) 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 *ListTagsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Tags +type ListTagsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Tags []*TagItem `thrift:"tags,3" db:"tags" json:"tags"` +} + +func NewListTagsResp() *ListTagsResp { + return &ListTagsResp{} +} + + +func (p *ListTagsResp) GetCode() ErrorCode { + return p.Code +} +var ListTagsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListTagsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListTagsResp) GetTags() []*TagItem { + return p.Tags +} +func (p *ListTagsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListTagsResp) 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 *ListTagsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListTagsResp) 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 *ListTagsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TagItem, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem22 := NewTagItem() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.Tags = append(p.Tags, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsResp"); 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tags: ", p), err) } + return err +} + +func (p *ListTagsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagsResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - TagName +// - Version +type GetTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetTagReq() *GetTagReq { + return &GetTagReq{} +} + + +func (p *GetTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *GetTagReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetTagReq) 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 *GetTagReq) 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 *GetTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *GetTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagReq"); 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 *GetTagReq) 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 *GetTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *GetTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetTagResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetTagResp() *GetTagResp { + return &GetTagResp{} +} + + +func (p *GetTagResp) GetCode() ErrorCode { + return p.Code +} +var GetTagResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetTagResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagResp_Leader_DEFAULT + } +return p.Leader +} +var GetTagResp_Schema_DEFAULT *Schema +func (p *GetTagResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetTagResp_Schema_DEFAULT + } +return p.Schema +} +func (p *GetTagResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetTagResp) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *GetTagResp) 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 *GetTagResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetTagResp) 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 *GetTagResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetTagResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagResp"); 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetTagResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Schema +// - IfNotExists +type CreateEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateEdgeReq() *CreateEdgeReq { + return &CreateEdgeReq{} +} + + +func (p *CreateEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} +var CreateEdgeReq_Schema_DEFAULT *Schema +func (p *CreateEdgeReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateEdgeReq_Schema_DEFAULT + } +return p.Schema +} + +func (p *CreateEdgeReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateEdgeReq) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *CreateEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateEdgeReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - EdgeItems +// - SchemaProp +type AlterEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + EdgeItems []*AlterSchemaItem `thrift:"edge_items,3" db:"edge_items" json:"edge_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterEdgeReq() *AlterEdgeReq { + return &AlterEdgeReq{} +} + + +func (p *AlterEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *AlterEdgeReq) GetEdgeItems() []*AlterSchemaItem { + return p.EdgeItems +} +var AlterEdgeReq_SchemaProp_DEFAULT *SchemaProp +func (p *AlterEdgeReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterEdgeReq_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *AlterEdgeReq) IsSetSchemaProp() bool { + return p.SchemaProp != nil +} + +func (p *AlterEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *AlterEdgeReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.EdgeItems = tSlice + for i := 0; i < size; i ++ { + _elem23 := NewAlterSchemaItem() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.EdgeItems = append(p.EdgeItems, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_items: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterEdgeReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Version +type GetEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetEdgeReq() *GetEdgeReq { + return &GetEdgeReq{} +} + + +func (p *GetEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *GetEdgeReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetEdgeReq) 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 *GetEdgeReq) 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 *GetEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *GetEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeReq"); 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 *GetEdgeReq) 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 *GetEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *GetEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetEdgeResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetEdgeResp() *GetEdgeResp { + return &GetEdgeResp{} +} + + +func (p *GetEdgeResp) GetCode() ErrorCode { + return p.Code +} +var GetEdgeResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetEdgeResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeResp_Leader_DEFAULT + } +return p.Leader +} +var GetEdgeResp_Schema_DEFAULT *Schema +func (p *GetEdgeResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetEdgeResp_Schema_DEFAULT + } +return p.Schema +} +func (p *GetEdgeResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetEdgeResp) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *GetEdgeResp) 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 *GetEdgeResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetEdgeResp) 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 *GetEdgeResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetEdgeResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeResp"); 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetEdgeResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - IfExists +type DropEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeReq() *DropEdgeReq { + return &DropEdgeReq{} +} + + +func (p *DropEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *DropEdgeReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeReq) 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 *DropEdgeReq) 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 *DropEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *DropEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeReq"); 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 *DropEdgeReq) 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 *DropEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *DropEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropEdgeReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListEdgesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgesReq() *ListEdgesReq { + return &ListEdgesReq{} +} + + +func (p *ListEdgesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgesReq) 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 *ListEdgesReq) 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 *ListEdgesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesReq"); 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 *ListEdgesReq) 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 *ListEdgesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgesReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Edges +type ListEdgesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Edges []*EdgeItem `thrift:"edges,3" db:"edges" json:"edges"` +} + +func NewListEdgesResp() *ListEdgesResp { + return &ListEdgesResp{} +} + + +func (p *ListEdgesResp) GetCode() ErrorCode { + return p.Code +} +var ListEdgesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListEdgesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListEdgesResp) GetEdges() []*EdgeItem { + return p.Edges +} +func (p *ListEdgesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListEdgesResp) 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 *ListEdgesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListEdgesResp) 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 *ListEdgesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeItem, 0, size) + p.Edges = tSlice + for i := 0; i < size; i ++ { + _elem24 := NewEdgeItem() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + } + p.Edges = append(p.Edges, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesResp"); 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 *ListEdgesResp) 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 *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edges: ", p), err) } + return err +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgesResp(%+v)", *p) +} + +// Attributes: +// - Type +type ListHostsReq struct { + Type ListHostType `thrift:"type,1" db:"type" json:"type"` +} + +func NewListHostsReq() *ListHostsReq { + return &ListHostsReq{} +} + + +func (p *ListHostsReq) GetType() ListHostType { + return p.Type +} +func (p *ListHostsReq) 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 *ListHostsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListHostType(v) + p.Type = temp +} + return nil +} + +func (p *ListHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsReq"); 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 *ListHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListHostsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListHostsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type ListHostsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*HostItem `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewListHostsResp() *ListHostsResp { + return &ListHostsResp{} +} + + +func (p *ListHostsResp) GetCode() ErrorCode { + return p.Code +} +var ListHostsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListHostsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListHostsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListHostsResp) GetHosts() []*HostItem { + return p.Hosts +} +func (p *ListHostsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListHostsResp) 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 *ListHostsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListHostsResp) 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 *ListHostsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostItem, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem25 := NewHostItem() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + } + p.Hosts = append(p.Hosts, _elem25) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListHostsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsResp"); 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *ListHostsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListHostsResp(%+v)", *p) +} + +// Attributes: +// - PartID +// - Leader +// - Peers +// - Losts +type PartItem struct { + PartID nebula0.PartitionID `thrift:"part_id,1,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader,omitempty"` + Peers []*nebula0.HostAddr `thrift:"peers,3,required" db:"peers" json:"peers"` + Losts []*nebula0.HostAddr `thrift:"losts,4,required" db:"losts" json:"losts"` +} + +func NewPartItem() *PartItem { + return &PartItem{} +} + + +func (p *PartItem) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartItem_Leader_DEFAULT *nebula0.HostAddr +func (p *PartItem) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartItem_Leader_DEFAULT + } +return p.Leader +} + +func (p *PartItem) GetPeers() []*nebula0.HostAddr { + return p.Peers +} + +func (p *PartItem) GetLosts() []*nebula0.HostAddr { + return p.Losts +} +func (p *PartItem) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *PartItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPartID bool = false; + var issetPeers bool = false; + var issetLosts 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 + } + issetPartID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetPeers = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetLosts = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + if !issetPeers{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Peers is not set")); + } + if !issetLosts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Losts is not set")); + } + return nil +} + +func (p *PartItem) 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 *PartItem) 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 *PartItem) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem26 := nebula0.NewHostAddr() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + } + p.Peers = append(p.Peers, _elem26) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) ReadField4(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.Losts = tSlice + for i := 0; i < size; i ++ { + _elem27 := nebula0.NewHostAddr() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + p.Losts = append(p.Losts, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartItem) 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 *PartItem) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + 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 *PartItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *PartItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("losts", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:losts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Losts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Losts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:losts: ", p), err) } + return err +} + +func (p *PartItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartItem(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartIds +type ListPartsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartIds []nebula0.PartitionID `thrift:"part_ids,2" db:"part_ids" json:"part_ids"` +} + +func NewListPartsReq() *ListPartsReq { + return &ListPartsReq{} +} + + +func (p *ListPartsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ListPartsReq) GetPartIds() []nebula0.PartitionID { + return p.PartIds +} +func (p *ListPartsReq) 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 *ListPartsReq) 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 *ListPartsReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.PartIds = tSlice + for i := 0; i < size; i ++ { +var _elem28 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem28 = temp +} + p.PartIds = append(p.PartIds, _elem28) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsReq"); 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 *ListPartsReq) 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 *ListPartsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_ids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_ids: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_ids: ", p), err) } + return err +} + +func (p *ListPartsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListPartsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Parts +type ListPartsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts []*PartItem `thrift:"parts,3" db:"parts" json:"parts"` +} + +func NewListPartsResp() *ListPartsResp { + return &ListPartsResp{} +} + + +func (p *ListPartsResp) GetCode() ErrorCode { + return p.Code +} +var ListPartsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListPartsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListPartsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListPartsResp) GetParts() []*PartItem { + return p.Parts +} +func (p *ListPartsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListPartsResp) 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 *ListPartsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListPartsResp) 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 *ListPartsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartItem, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { + _elem29 := NewPartItem() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.Parts = append(p.Parts, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsResp"); 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *ListPartsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListPartsResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type GetPartsAllocReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetPartsAllocReq() *GetPartsAllocReq { + return &GetPartsAllocReq{} +} + + +func (p *GetPartsAllocReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetPartsAllocReq) 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocReq"); 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartsAllocReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Parts +type GetPartsAllocResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts map[nebula0.PartitionID][]*nebula0.HostAddr `thrift:"parts,3" db:"parts" json:"parts"` +} + +func NewGetPartsAllocResp() *GetPartsAllocResp { + return &GetPartsAllocResp{} +} + + +func (p *GetPartsAllocResp) GetCode() ErrorCode { + return p.Code +} +var GetPartsAllocResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetPartsAllocResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetPartsAllocResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetPartsAllocResp) GetParts() map[nebula0.PartitionID][]*nebula0.HostAddr { + return p.Parts +} +func (p *GetPartsAllocResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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.HostAddr, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key30 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key30 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + _val31 := tSlice + for i := 0; i < size; i ++ { + _elem32 := nebula0.NewHostAddr() + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + } + _val31 = append(_val31, _elem32) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key30] = _val31 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocResp"); 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartsAllocResp(%+v)", *p) +} + +// Attributes: +// - Segment +// - Pairs +type MultiPutReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Pairs []*nebula0.KeyValue `thrift:"pairs,2" db:"pairs" json:"pairs"` +} + +func NewMultiPutReq() *MultiPutReq { + return &MultiPutReq{} +} + + +func (p *MultiPutReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiPutReq) GetPairs() []*nebula0.KeyValue { + return p.Pairs +} +func (p *MultiPutReq) 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 *MultiPutReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *MultiPutReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + p.Pairs = tSlice + for i := 0; i < size; i ++ { + _elem33 := nebula0.NewKeyValue() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) + } + p.Pairs = append(p.Pairs, _elem33) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiPutReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiPutReq"); 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 *MultiPutReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *MultiPutReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("pairs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pairs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Pairs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Pairs { + 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:pairs: ", p), err) } + return err +} + +func (p *MultiPutReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiPutReq(%+v)", *p) +} + +// Attributes: +// - Segment +// - Key +type GetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewGetReq() *GetReq { + return &GetReq{} +} + + +func (p *GetReq) GetSegment() []byte { + return p.Segment +} + +func (p *GetReq) GetKey() []byte { + return p.Key +} +func (p *GetReq) 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 *GetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *GetReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *GetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetReq"); 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 *GetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *GetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) } + return err +} + +func (p *GetReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Value +type GetResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Value []byte `thrift:"value,3" db:"value" json:"value"` +} + +func NewGetResp() *GetResp { + return &GetResp{} +} + + +func (p *GetResp) GetCode() ErrorCode { + return p.Code +} +var GetResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetResp) GetValue() []byte { + return p.Value +} +func (p *GetResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetResp) 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 *GetResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetResp) 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 *GetResp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *GetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetResp"); 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 *GetResp) 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 *GetResp) 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 *GetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) } + return err +} + +func (p *GetResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetResp(%+v)", *p) +} + +// Attributes: +// - Segment +// - Keys +type MultiGetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Keys [][]byte `thrift:"keys,2" db:"keys" json:"keys"` +} + +func NewMultiGetReq() *MultiGetReq { + return &MultiGetReq{} +} + + +func (p *MultiGetReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiGetReq) GetKeys() [][]byte { + return p.Keys +} +func (p *MultiGetReq) 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 *MultiGetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *MultiGetReq) 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.Keys = tSlice + for i := 0; i < size; i ++ { +var _elem34 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem34 = v +} + p.Keys = append(p.Keys, _elem34) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetReq"); 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 *MultiGetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *MultiGetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:keys: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.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:keys: ", p), err) } + return err +} + +func (p *MultiGetReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiGetReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Values +type MultiGetResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewMultiGetResp() *MultiGetResp { + return &MultiGetResp{} +} + + +func (p *MultiGetResp) GetCode() ErrorCode { + return p.Code +} +var MultiGetResp_Leader_DEFAULT *nebula0.HostAddr +func (p *MultiGetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return MultiGetResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *MultiGetResp) GetValues() [][]byte { + return p.Values +} +func (p *MultiGetResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *MultiGetResp) 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 *MultiGetResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *MultiGetResp) 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 *MultiGetResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i ++ { +var _elem35 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem35 = v +} + p.Values = append(p.Values, _elem35) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetResp"); 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) } + return err +} + +func (p *MultiGetResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MultiGetResp(%+v)", *p) +} + +// Attributes: +// - Segment +// - Key +type RemoveReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewRemoveReq() *RemoveReq { + return &RemoveReq{} +} + + +func (p *RemoveReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveReq) GetKey() []byte { + return p.Key +} +func (p *RemoveReq) 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 *RemoveReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *RemoveReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *RemoveReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveReq"); 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 *RemoveReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *RemoveReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) } + return err +} + +func (p *RemoveReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveReq(%+v)", *p) +} + +// Attributes: +// - Segment +// - Start +// - End +type RemoveRangeReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewRemoveRangeReq() *RemoveRangeReq { + return &RemoveRangeReq{} +} + + +func (p *RemoveRangeReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveRangeReq) GetStart() []byte { + return p.Start +} + +func (p *RemoveRangeReq) GetEnd() []byte { + return p.End +} +func (p *RemoveRangeReq) 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 *RemoveRangeReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *RemoveRangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Start = v +} + return nil +} + +func (p *RemoveRangeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.End = v +} + return nil +} + +func (p *RemoveRangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveRangeReq"); 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 *RemoveRangeReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *RemoveRangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) } + return err +} + +func (p *RemoveRangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) } + return err +} + +func (p *RemoveRangeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveRangeReq(%+v)", *p) +} + +// Attributes: +// - Segment +// - Start +// - End +type ScanReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewScanReq() *ScanReq { + return &ScanReq{} +} + + +func (p *ScanReq) GetSegment() []byte { + return p.Segment +} + +func (p *ScanReq) GetStart() []byte { + return p.Start +} + +func (p *ScanReq) GetEnd() []byte { + return p.End +} +func (p *ScanReq) 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 *ScanReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *ScanReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Start = v +} + return nil +} + +func (p *ScanReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.End = v +} + return nil +} + +func (p *ScanReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanReq"); 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 *ScanReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *ScanReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) } + return err +} + +func (p *ScanReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) } + return err +} + +func (p *ScanReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Values +type ScanResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewScanResp() *ScanResp { + return &ScanResp{} +} + + +func (p *ScanResp) GetCode() ErrorCode { + return p.Code +} +var ScanResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ScanResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ScanResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ScanResp) GetValues() [][]byte { + return p.Values +} +func (p *ScanResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ScanResp) 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 *ScanResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ScanResp) 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 *ScanResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i ++ { +var _elem36 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem36 = v +} + p.Values = append(p.Values, _elem36) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanResp"); 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) } + return err +} + +func (p *ScanResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanResp(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - ClusterID +// - LastUpdateTimeInMs +type HBResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LastUpdateTimeInMs int64 `thrift:"last_update_time_in_ms,4" db:"last_update_time_in_ms" json:"last_update_time_in_ms"` +} + +func NewHBResp() *HBResp { + return &HBResp{} +} + + +func (p *HBResp) GetCode() ErrorCode { + return p.Code +} +var HBResp_Leader_DEFAULT *nebula0.HostAddr +func (p *HBResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return HBResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *HBResp) GetClusterID() ClusterID { + return p.ClusterID +} + +func (p *HBResp) GetLastUpdateTimeInMs() int64 { + return p.LastUpdateTimeInMs +} +func (p *HBResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *HBResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.LastUpdateTimeInMs = v +} + return nil +} + +func (p *HBResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("last_update_time_in_ms", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:last_update_time_in_ms: ", p), err) } + if err := oprot.WriteI64(int64(p.LastUpdateTimeInMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_update_time_in_ms (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:last_update_time_in_ms: ", p), err) } + return err +} + +func (p *HBResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HBResp(%+v)", *p) +} + +// Attributes: +// - Role +// - Host +// - ClusterID +// - LeaderPartIds +// - GitInfoSha +type HBReq struct { + Role HostRole `thrift:"role,1" db:"role" json:"role"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LeaderPartIds map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_partIds,4" db:"leader_partIds" json:"leader_partIds,omitempty"` + GitInfoSha []byte `thrift:"git_info_sha,5" db:"git_info_sha" json:"git_info_sha"` +} + +func NewHBReq() *HBReq { + return &HBReq{} +} + + +func (p *HBReq) GetRole() HostRole { + return p.Role +} +var HBReq_Host_DEFAULT *nebula0.HostAddr +func (p *HBReq) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return HBReq_Host_DEFAULT + } +return p.Host +} + +func (p *HBReq) GetClusterID() ClusterID { + return p.ClusterID +} +var HBReq_LeaderPartIds_DEFAULT map[nebula0.GraphSpaceID][]nebula0.PartitionID + +func (p *HBReq) GetLeaderPartIds() map[nebula0.GraphSpaceID][]nebula0.PartitionID { + return p.LeaderPartIds +} + +func (p *HBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} +func (p *HBReq) IsSetHost() bool { + return p.Host != nil +} + +func (p *HBReq) IsSetLeaderPartIds() bool { + return p.LeaderPartIds != nil +} + +func (p *HBReq) 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 + } + 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 *HBReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HBReq) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HBReq) 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 *HBReq) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) + p.LeaderPartIds = tMap + for i := 0; i < size; i ++ { +var _key37 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key37 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val38 := tSlice + for i := 0; i < size; i ++ { +var _elem39 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem39 = temp +} + _val38 = append(_val38, _elem39) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderPartIds[_key37] = _val38 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HBReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBReq"); 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 *HBReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) } + return err +} + +func (p *HBReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *HBReq) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetLeaderPartIds() { + if err := oprot.WriteFieldBegin("leader_partIds", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:leader_partIds: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderPartIds)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderPartIds { + 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.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 4:leader_partIds: ", p), err) } + } + return err +} + +func (p *HBReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:git_info_sha: ", p), err) } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:git_info_sha: ", p), err) } + return err +} + +func (p *HBReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HBReq(%+v)", *p) +} + +// Attributes: +// - Name +// - TypeLength +type IndexFieldDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + TypeLength *int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewIndexFieldDef() *IndexFieldDef { + return &IndexFieldDef{} +} + + +func (p *IndexFieldDef) GetName() []byte { + return p.Name +} +var IndexFieldDef_TypeLength_DEFAULT int16 +func (p *IndexFieldDef) GetTypeLength() int16 { + if !p.IsSetTypeLength() { + return IndexFieldDef_TypeLength_DEFAULT + } +return *p.TypeLength +} +func (p *IndexFieldDef) IsSetTypeLength() bool { + return p.TypeLength != nil +} + +func (p *IndexFieldDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName 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 + } + issetName = 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + return nil +} + +func (p *IndexFieldDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexFieldDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = &v +} + return nil +} + +func (p *IndexFieldDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexFieldDef"); 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 *IndexFieldDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexFieldDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) } + if err := oprot.WriteI16(int16(*p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *IndexFieldDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexFieldDef(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +// - TagName +// - Fields +// - IfNotExists +type CreateTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + TagName []byte `thrift:"tag_name,3" db:"tag_name" json:"tag_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateTagIndexReq() *CreateTagIndexReq { + return &CreateTagIndexReq{} +} + + +func (p *CreateTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateTagIndexReq) GetTagName() []byte { + return p.TagName +} + +func (p *CreateTagIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateTagIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateTagIndexReq) 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 + } + 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 *CreateTagIndexReq) 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 *CreateTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem40 := NewIndexFieldDef() + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + p.Fields = append(p.Fields, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *CreateTagIndexReq) 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 *CreateTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTagIndexReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagIndexReq() *DropTagIndexReq { + return &DropTagIndexReq{} +} + + +func (p *DropTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropTagIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagIndexReq) 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 *DropTagIndexReq) 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 *DropTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagIndexReq"); 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 *DropTagIndexReq) 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 *DropTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropTagIndexReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetTagIndexReq() *GetTagIndexReq { + return &GetTagIndexReq{} +} + + +func (p *GetTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetTagIndexReq) 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 *GetTagIndexReq) 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 *GetTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexReq"); 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 *GetTagIndexReq) 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 *GetTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagIndexReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetTagIndexResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetTagIndexResp() *GetTagIndexResp { + return &GetTagIndexResp{} +} + + +func (p *GetTagIndexResp) GetCode() ErrorCode { + return p.Code +} +var GetTagIndexResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetTagIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagIndexResp_Leader_DEFAULT + } +return p.Leader +} +var GetTagIndexResp_Item_DEFAULT *IndexItem +func (p *GetTagIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetTagIndexResp_Item_DEFAULT + } +return p.Item +} +func (p *GetTagIndexResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetTagIndexResp) IsSetItem() bool { + return p.Item != nil +} + +func (p *GetTagIndexResp) 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 *GetTagIndexResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetTagIndexResp) 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 *GetTagIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetTagIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexResp"); 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetTagIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagIndexResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListTagIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagIndexesReq() *ListTagIndexesReq { + return &ListTagIndexesReq{} +} + + +func (p *ListTagIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagIndexesReq) 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesReq"); 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagIndexesReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListTagIndexesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListTagIndexesResp() *ListTagIndexesResp { + return &ListTagIndexesResp{} +} + + +func (p *ListTagIndexesResp) GetCode() ErrorCode { + return p.Code +} +var ListTagIndexesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListTagIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagIndexesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListTagIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListTagIndexesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListTagIndexesResp) 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 *ListTagIndexesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListTagIndexesResp) 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 *ListTagIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem41 := NewIndexItem() + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.Items = append(p.Items, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesResp"); 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListTagIndexesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagIndexesResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +// - EdgeName +// - Fields +// - IfNotExists +type CreateEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + EdgeName []byte `thrift:"edge_name,3" db:"edge_name" json:"edge_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { + return &CreateEdgeIndexReq{} +} + + +func (p *CreateEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateEdgeIndexReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *CreateEdgeIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateEdgeIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateEdgeIndexReq) 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 + } + 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 *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem42 := NewIndexFieldDef() + if err := _elem42.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) + } + p.Fields = append(p.Fields, _elem42) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + 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 *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateEdgeIndexReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeIndexReq() *DropEdgeIndexReq { + return &DropEdgeIndexReq{} +} + + +func (p *DropEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropEdgeIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeIndexReq) 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeIndexReq"); 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropEdgeIndexReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetEdgeIndexReq() *GetEdgeIndexReq { + return &GetEdgeIndexReq{} +} + + +func (p *GetEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetEdgeIndexReq) 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexReq"); 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeIndexReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetEdgeIndexResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetEdgeIndexResp() *GetEdgeIndexResp { + return &GetEdgeIndexResp{} +} + + +func (p *GetEdgeIndexResp) GetCode() ErrorCode { + return p.Code +} +var GetEdgeIndexResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetEdgeIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeIndexResp_Leader_DEFAULT + } +return p.Leader +} +var GetEdgeIndexResp_Item_DEFAULT *IndexItem +func (p *GetEdgeIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetEdgeIndexResp_Item_DEFAULT + } +return p.Item +} +func (p *GetEdgeIndexResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetEdgeIndexResp) IsSetItem() bool { + return p.Item != nil +} + +func (p *GetEdgeIndexResp) 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 *GetEdgeIndexResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetEdgeIndexResp) 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 *GetEdgeIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetEdgeIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexResp"); 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetEdgeIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeIndexResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListEdgeIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgeIndexesReq() *ListEdgeIndexesReq { + return &ListEdgeIndexesReq{} +} + + +func (p *ListEdgeIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesReq"); 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgeIndexesReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListEdgeIndexesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListEdgeIndexesResp() *ListEdgeIndexesResp { + return &ListEdgeIndexesResp{} +} + + +func (p *ListEdgeIndexesResp) GetCode() ErrorCode { + return p.Code +} +var ListEdgeIndexesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListEdgeIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgeIndexesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListEdgeIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListEdgeIndexesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem43 := NewIndexItem() + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + } + p.Items = append(p.Items, _elem43) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgeIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesResp"); 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListEdgeIndexesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgeIndexesResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - IndexName +type RebuildIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewRebuildIndexReq() *RebuildIndexReq { + return &RebuildIndexReq{} +} + + +func (p *RebuildIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *RebuildIndexReq) 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 *RebuildIndexReq) 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 *RebuildIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *RebuildIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexReq"); 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 *RebuildIndexReq) 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 *RebuildIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *RebuildIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RebuildIndexReq(%+v)", *p) +} + +// Attributes: +// - Account +// - EncodedPwd +// - IfNotExists +type CreateUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` + IfNotExists bool `thrift:"if_not_exists,3" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateUserReq() *CreateUserReq { + return &CreateUserReq{} +} + + +func (p *CreateUserReq) GetAccount() []byte { + return p.Account +} + +func (p *CreateUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} + +func (p *CreateUserReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateUserReq) 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 *CreateUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *CreateUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *CreateUserReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateUserReq"); 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 *CreateUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) } + return err +} + +func (p *CreateUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateUserReq(%+v)", *p) +} + +// Attributes: +// - Account +// - IfExists +type DropUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropUserReq() *DropUserReq { + return &DropUserReq{} +} + + +func (p *DropUserReq) GetAccount() []byte { + return p.Account +} + +func (p *DropUserReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropUserReq) 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 *DropUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *DropUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropUserReq"); 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 *DropUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *DropUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropUserReq(%+v)", *p) +} + +// Attributes: +// - Account +// - EncodedPwd +type AlterUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` +} + +func NewAlterUserReq() *AlterUserReq { + return &AlterUserReq{} +} + + +func (p *AlterUserReq) GetAccount() []byte { + return p.Account +} + +func (p *AlterUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} +func (p *AlterUserReq) 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 *AlterUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *AlterUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *AlterUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterUserReq"); 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 *AlterUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *AlterUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *AlterUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterUserReq(%+v)", *p) +} + +// Attributes: +// - RoleItem +type GrantRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewGrantRoleReq() *GrantRoleReq { + return &GrantRoleReq{} +} + +var GrantRoleReq_RoleItem_DEFAULT *RoleItem +func (p *GrantRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return GrantRoleReq_RoleItem_DEFAULT + } +return p.RoleItem +} +func (p *GrantRoleReq) IsSetRoleItem() bool { + return p.RoleItem != nil +} + +func (p *GrantRoleReq) 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 *GrantRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *GrantRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GrantRoleReq"); 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 *GrantRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *GrantRoleReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GrantRoleReq(%+v)", *p) +} + +// Attributes: +// - RoleItem +type RevokeRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewRevokeRoleReq() *RevokeRoleReq { + return &RevokeRoleReq{} +} + +var RevokeRoleReq_RoleItem_DEFAULT *RoleItem +func (p *RevokeRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return RevokeRoleReq_RoleItem_DEFAULT + } +return p.RoleItem +} +func (p *RevokeRoleReq) IsSetRoleItem() bool { + return p.RoleItem != nil +} + +func (p *RevokeRoleReq) 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 *RevokeRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *RevokeRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RevokeRoleReq"); 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 *RevokeRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *RevokeRoleReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RevokeRoleReq(%+v)", *p) +} + +type ListUsersReq struct { +} + +func NewListUsersReq() *ListUsersReq { + return &ListUsersReq{} +} + +func (p *ListUsersReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListUsersReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListUsersReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Users +type ListUsersResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Users map[string][]byte `thrift:"users,3" db:"users" json:"users"` +} + +func NewListUsersResp() *ListUsersResp { + return &ListUsersResp{} +} + + +func (p *ListUsersResp) GetCode() ErrorCode { + return p.Code +} +var ListUsersResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListUsersResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListUsersResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListUsersResp) GetUsers() map[string][]byte { + return p.Users +} +func (p *ListUsersResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListUsersResp) 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 *ListUsersResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListUsersResp) 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 *ListUsersResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.Users = tMap + for i := 0; i < size; i ++ { +var _key44 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key44 = v +} +var _val45 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val45 = v +} + p.Users[_key44] = _val45 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListUsersResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersResp"); 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("users", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:users: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Users)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Users { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:users: ", p), err) } + return err +} + +func (p *ListUsersResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListUsersResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListRolesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListRolesReq() *ListRolesReq { + return &ListRolesReq{} +} + + +func (p *ListRolesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListRolesReq) 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 *ListRolesReq) 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 *ListRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesReq"); 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 *ListRolesReq) 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 *ListRolesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListRolesReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Roles +type ListRolesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Roles []*RoleItem `thrift:"roles,3" db:"roles" json:"roles"` +} + +func NewListRolesResp() *ListRolesResp { + return &ListRolesResp{} +} + + +func (p *ListRolesResp) GetCode() ErrorCode { + return p.Code +} +var ListRolesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListRolesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListRolesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListRolesResp) GetRoles() []*RoleItem { + return p.Roles +} +func (p *ListRolesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListRolesResp) 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 *ListRolesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListRolesResp) 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 *ListRolesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*RoleItem, 0, size) + p.Roles = tSlice + for i := 0; i < size; i ++ { + _elem46 := NewRoleItem() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Roles = append(p.Roles, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListRolesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesResp"); 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("roles", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:roles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Roles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Roles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:roles: ", p), err) } + return err +} + +func (p *ListRolesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListRolesResp(%+v)", *p) +} + +// Attributes: +// - Account +type GetUserRolesReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` +} + +func NewGetUserRolesReq() *GetUserRolesReq { + return &GetUserRolesReq{} +} + + +func (p *GetUserRolesReq) GetAccount() []byte { + return p.Account +} +func (p *GetUserRolesReq) 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 *GetUserRolesReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *GetUserRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUserRolesReq"); 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 *GetUserRolesReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *GetUserRolesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserRolesReq(%+v)", *p) +} + +// Attributes: +// - Account +// - NewEncodedPwd_ +// - OldEncodedPwd +type ChangePasswordReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + NewEncodedPwd_ []byte `thrift:"new_encoded_pwd,2" db:"new_encoded_pwd" json:"new_encoded_pwd"` + OldEncodedPwd []byte `thrift:"old_encoded_pwd,3" db:"old_encoded_pwd" json:"old_encoded_pwd"` +} + +func NewChangePasswordReq() *ChangePasswordReq { + return &ChangePasswordReq{} +} + + +func (p *ChangePasswordReq) GetAccount() []byte { + return p.Account +} + +func (p *ChangePasswordReq) GetNewEncodedPwd_() []byte { + return p.NewEncodedPwd_ +} + +func (p *ChangePasswordReq) GetOldEncodedPwd() []byte { + return p.OldEncodedPwd +} +func (p *ChangePasswordReq) 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 *ChangePasswordReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.NewEncodedPwd_ = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OldEncodedPwd = v +} + return nil +} + +func (p *ChangePasswordReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChangePasswordReq"); 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 *ChangePasswordReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.NewEncodedPwd_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("old_encoded_pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:old_encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.OldEncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_encoded_pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:old_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangePasswordReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Id +// - HostDel +// - Stop +// - Reset +type BalanceReq struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + Id *int64 `thrift:"id,2" db:"id" json:"id,omitempty"` + HostDel []*nebula0.HostAddr `thrift:"host_del,3" db:"host_del" json:"host_del,omitempty"` + Stop *bool `thrift:"stop,4" db:"stop" json:"stop,omitempty"` + Reset *bool `thrift:"reset,5" db:"reset" json:"reset,omitempty"` +} + +func NewBalanceReq() *BalanceReq { + return &BalanceReq{} +} + +var BalanceReq_SpaceID_DEFAULT nebula0.GraphSpaceID +func (p *BalanceReq) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return BalanceReq_SpaceID_DEFAULT + } +return *p.SpaceID +} +var BalanceReq_Id_DEFAULT int64 +func (p *BalanceReq) GetId() int64 { + if !p.IsSetId() { + return BalanceReq_Id_DEFAULT + } +return *p.Id +} +var BalanceReq_HostDel_DEFAULT []*nebula0.HostAddr + +func (p *BalanceReq) GetHostDel() []*nebula0.HostAddr { + return p.HostDel +} +var BalanceReq_Stop_DEFAULT bool +func (p *BalanceReq) GetStop() bool { + if !p.IsSetStop() { + return BalanceReq_Stop_DEFAULT + } +return *p.Stop +} +var BalanceReq_Reset_DEFAULT bool +func (p *BalanceReq) GetReset() bool { + if !p.IsSetReset() { + return BalanceReq_Reset_DEFAULT + } +return *p.Reset +} +func (p *BalanceReq) IsSetSpaceID() bool { + return p.SpaceID != nil +} + +func (p *BalanceReq) IsSetId() bool { + return p.Id != nil +} + +func (p *BalanceReq) IsSetHostDel() bool { + return p.HostDel != nil +} + +func (p *BalanceReq) IsSetStop() bool { + return p.Stop != nil +} + +func (p *BalanceReq) IsSetReset() bool { + return p.Reset != nil +} + +func (p *BalanceReq) 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 + } + 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 *BalanceReq) 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 *BalanceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = &v +} + return nil +} + +func (p *BalanceReq) ReadField3(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.HostDel = tSlice + for i := 0; i < size; i ++ { + _elem47 := nebula0.NewHostAddr() + if err := _elem47.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + } + p.HostDel = append(p.HostDel, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Stop = &v +} + return nil +} + +func (p *BalanceReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Reset = &v +} + return nil +} + +func (p *BalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceReq"); 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 *BalanceReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *BalanceReq) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetId() { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(*p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetHostDel() { + if err := oprot.WriteFieldBegin("host_del", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_del: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HostDel)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HostDel { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host_del: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStop() { + if err := oprot.WriteFieldBegin("stop", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop: ", p), err) } + if err := oprot.WriteBool(bool(*p.Stop)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetReset() { + if err := oprot.WriteFieldBegin("reset", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:reset: ", p), err) } + if err := oprot.WriteBool(bool(*p.Reset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reset (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:reset: ", p), err) } + } + return err +} + +func (p *BalanceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BalanceReq(%+v)", *p) +} + +// Attributes: +// - Id +// - Result_ +type BalanceTask struct { + Id []byte `thrift:"id,1" db:"id" json:"id"` + Result_ TaskResult_ `thrift:"result,2" db:"result" json:"result"` +} + +func NewBalanceTask() *BalanceTask { + return &BalanceTask{} +} + + +func (p *BalanceTask) GetId() []byte { + return p.Id +} + +func (p *BalanceTask) GetResult_() TaskResult_ { + return p.Result_ +} +func (p *BalanceTask) 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 *BalanceTask) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *BalanceTask) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TaskResult_(v) + p.Result_ = temp +} + return nil +} + +func (p *BalanceTask) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceTask"); 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 *BalanceTask) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := oprot.WriteBinary(p.Id); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *BalanceTask) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:result: ", p), err) } + if err := oprot.WriteI32(int32(p.Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.result (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:result: ", p), err) } + return err +} + +func (p *BalanceTask) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BalanceTask(%+v)", *p) +} + +// Attributes: +// - Code +// - Id +// - Leader +// - Tasks +type BalanceResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id int64 `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` + Tasks []*BalanceTask `thrift:"tasks,4" db:"tasks" json:"tasks"` +} + +func NewBalanceResp() *BalanceResp { + return &BalanceResp{} +} + + +func (p *BalanceResp) GetCode() ErrorCode { + return p.Code +} + +func (p *BalanceResp) GetId() int64 { + return p.Id +} +var BalanceResp_Leader_DEFAULT *nebula0.HostAddr +func (p *BalanceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return BalanceResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *BalanceResp) GetTasks() []*BalanceTask { + return p.Tasks +} +func (p *BalanceResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *BalanceResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BalanceResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *BalanceResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *BalanceResp) ReadField3(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 *BalanceResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BalanceTask, 0, size) + p.Tasks = tSlice + for i := 0; i < size; i ++ { + _elem48 := NewBalanceTask() + if err := _elem48.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.Tasks = append(p.Tasks, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *BalanceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + return err +} + +func (p *BalanceResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tasks", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tasks: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tasks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tasks { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tasks: ", p), err) } + return err +} + +func (p *BalanceResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BalanceResp(%+v)", *p) +} + +type LeaderBalanceReq struct { +} + +func NewLeaderBalanceReq() *LeaderBalanceReq { + return &LeaderBalanceReq{} +} + +func (p *LeaderBalanceReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LeaderBalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderBalanceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LeaderBalanceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LeaderBalanceReq(%+v)", *p) +} + +// Attributes: +// - Module +// - Name +// - Mode +// - Value +type ConfigItem struct { + Module ConfigModule `thrift:"module,1" db:"module" json:"module"` + Name []byte `thrift:"name,2" db:"name" json:"name"` + Mode ConfigMode `thrift:"mode,3" db:"mode" json:"mode"` + Value *nebula0.Value `thrift:"value,4" db:"value" json:"value"` +} + +func NewConfigItem() *ConfigItem { + return &ConfigItem{} +} + + +func (p *ConfigItem) GetModule() ConfigModule { + return p.Module +} + +func (p *ConfigItem) GetName() []byte { + return p.Name +} + +func (p *ConfigItem) GetMode() ConfigMode { + return p.Mode +} +var ConfigItem_Value_DEFAULT *nebula0.Value +func (p *ConfigItem) GetValue() *nebula0.Value { + if !p.IsSetValue() { + return ConfigItem_Value_DEFAULT + } +return p.Value +} +func (p *ConfigItem) IsSetValue() bool { + return p.Value != nil +} + +func (p *ConfigItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ConfigItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ConfigItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ConfigItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ConfigMode(v) + p.Mode = temp +} + return nil +} + +func (p *ConfigItem) ReadField4(iprot thrift.Protocol) error { + p.Value = nebula0.NewValue() + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ConfigItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ConfigItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ConfigItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:module: ", p), err) } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:module: ", p), err) } + return err +} + +func (p *ConfigItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *ConfigItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err) } + if err := oprot.WriteI32(int32(p.Mode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err) } + return err +} + +func (p *ConfigItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) } + return err +} + +func (p *ConfigItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigItem(%+v)", *p) +} + +// Attributes: +// - Items +type RegConfigReq struct { + Items []*ConfigItem `thrift:"items,1" db:"items" json:"items"` +} + +func NewRegConfigReq() *RegConfigReq { + return &RegConfigReq{} +} + + +func (p *RegConfigReq) GetItems() []*ConfigItem { + return p.Items +} +func (p *RegConfigReq) 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 *RegConfigReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem49 := NewConfigItem() + if err := _elem49.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem49), err) + } + p.Items = append(p.Items, _elem49) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RegConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RegConfigReq"); 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 *RegConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:items: ", p), err) } + return err +} + +func (p *RegConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegConfigReq(%+v)", *p) +} + +// Attributes: +// - Item +type GetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewGetConfigReq() *GetConfigReq { + return &GetConfigReq{} +} + +var GetConfigReq_Item_DEFAULT *ConfigItem +func (p *GetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return GetConfigReq_Item_DEFAULT + } +return p.Item +} +func (p *GetConfigReq) IsSetItem() bool { + return p.Item != nil +} + +func (p *GetConfigReq) 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 *GetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigReq"); 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 *GetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *GetConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetConfigReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Items +type GetConfigResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewGetConfigResp() *GetConfigResp { + return &GetConfigResp{} +} + + +func (p *GetConfigResp) GetCode() ErrorCode { + return p.Code +} +var GetConfigResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetConfigResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetConfigResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetConfigResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *GetConfigResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetConfigResp) 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 *GetConfigResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetConfigResp) 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 *GetConfigResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem50 := NewConfigItem() + if err := _elem50.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) + } + p.Items = append(p.Items, _elem50) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetConfigResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigResp"); 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *GetConfigResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetConfigResp(%+v)", *p) +} + +// Attributes: +// - Item +type SetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewSetConfigReq() *SetConfigReq { + return &SetConfigReq{} +} + +var SetConfigReq_Item_DEFAULT *ConfigItem +func (p *SetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return SetConfigReq_Item_DEFAULT + } +return p.Item +} +func (p *SetConfigReq) IsSetItem() bool { + return p.Item != nil +} + +func (p *SetConfigReq) 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 *SetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *SetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SetConfigReq"); 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 *SetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *SetConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SetConfigReq(%+v)", *p) +} + +// Attributes: +// - Space +// - Module +type ListConfigsReq struct { + Space []byte `thrift:"space,1" db:"space" json:"space"` + Module ConfigModule `thrift:"module,2" db:"module" json:"module"` +} + +func NewListConfigsReq() *ListConfigsReq { + return &ListConfigsReq{} +} + + +func (p *ListConfigsReq) GetSpace() []byte { + return p.Space +} + +func (p *ListConfigsReq) GetModule() ConfigModule { + return p.Module +} +func (p *ListConfigsReq) 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 *ListConfigsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Space = v +} + return nil +} + +func (p *ListConfigsReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ListConfigsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsReq"); 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 *ListConfigsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) } + if err := oprot.WriteBinary(p.Space); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *ListConfigsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:module: ", p), err) } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:module: ", p), err) } + return err +} + +func (p *ListConfigsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListConfigsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListConfigsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListConfigsResp() *ListConfigsResp { + return &ListConfigsResp{} +} + + +func (p *ListConfigsResp) GetCode() ErrorCode { + return p.Code +} +var ListConfigsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListConfigsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListConfigsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListConfigsResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *ListConfigsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListConfigsResp) 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 *ListConfigsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListConfigsResp) 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 *ListConfigsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem51 := NewConfigItem() + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + } + p.Items = append(p.Items, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListConfigsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsResp"); 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListConfigsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListConfigsResp(%+v)", *p) +} + +type CreateSnapshotReq struct { +} + +func NewCreateSnapshotReq() *CreateSnapshotReq { + return &CreateSnapshotReq{} +} + +func (p *CreateSnapshotReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSnapshotReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSnapshotReq(%+v)", *p) +} + +// Attributes: +// - Name +type DropSnapshotReq struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` +} + +func NewDropSnapshotReq() *DropSnapshotReq { + return &DropSnapshotReq{} +} + + +func (p *DropSnapshotReq) GetName() []byte { + return p.Name +} +func (p *DropSnapshotReq) 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 *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 +} + return nil +} + +func (p *DropSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSnapshotReq"); 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 *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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *DropSnapshotReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropSnapshotReq(%+v)", *p) +} + +type ListSnapshotsReq struct { +} + +func NewListSnapshotsReq() *ListSnapshotsReq { + return &ListSnapshotsReq{} +} + +func (p *ListSnapshotsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSnapshotsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSnapshotsReq(%+v)", *p) +} + +// Attributes: +// - Name +// - Status +// - Hosts +type Snapshot struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status SnapshotStatus `thrift:"status,2" db:"status" json:"status"` + Hosts []byte `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewSnapshot() *Snapshot { + return &Snapshot{} +} + + +func (p *Snapshot) GetName() []byte { + return p.Name +} + +func (p *Snapshot) GetStatus() SnapshotStatus { + return p.Status +} + +func (p *Snapshot) GetHosts() []byte { + return p.Hosts +} +func (p *Snapshot) 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 *Snapshot) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Snapshot) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := SnapshotStatus(v) + p.Status = temp +} + return nil +} + +func (p *Snapshot) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Hosts = v +} + return nil +} + +func (p *Snapshot) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Snapshot"); 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 *Snapshot) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Snapshot) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *Snapshot) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteBinary(p.Hosts); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hosts (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *Snapshot) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Snapshot(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Snapshots +type ListSnapshotsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Snapshots []*Snapshot `thrift:"snapshots,3" db:"snapshots" json:"snapshots"` +} + +func NewListSnapshotsResp() *ListSnapshotsResp { + return &ListSnapshotsResp{} +} + + +func (p *ListSnapshotsResp) GetCode() ErrorCode { + return p.Code +} +var ListSnapshotsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSnapshotsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSnapshotsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSnapshotsResp) GetSnapshots() []*Snapshot { + return p.Snapshots +} +func (p *ListSnapshotsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListSnapshotsResp) 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 *ListSnapshotsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSnapshotsResp) 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 *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Snapshot, 0, size) + p.Snapshots = tSlice + for i := 0; i < size; i ++ { + _elem52 := NewSnapshot() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Snapshots = append(p.Snapshots, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSnapshotsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsResp"); 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("snapshots", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:snapshots: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Snapshots)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Snapshots { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:snapshots: ", p), err) } + return err +} + +func (p *ListSnapshotsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSnapshotsResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListIndexStatusReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListIndexStatusReq() *ListIndexStatusReq { + return &ListIndexStatusReq{} +} + + +func (p *ListIndexStatusReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListIndexStatusReq) 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusReq"); 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListIndexStatusReq(%+v)", *p) +} + +// Attributes: +// - Name +// - Status +type IndexStatus struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status []byte `thrift:"status,2" db:"status" json:"status"` +} + +func NewIndexStatus() *IndexStatus { + return &IndexStatus{} +} + + +func (p *IndexStatus) GetName() []byte { + return p.Name +} + +func (p *IndexStatus) GetStatus() []byte { + return p.Status +} +func (p *IndexStatus) 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 *IndexStatus) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexStatus) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Status = v +} + return nil +} + +func (p *IndexStatus) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexStatus"); 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 *IndexStatus) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexStatus) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteBinary(p.Status); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *IndexStatus) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexStatus(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Statuses +type ListIndexStatusResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statuses []*IndexStatus `thrift:"statuses,3" db:"statuses" json:"statuses"` +} + +func NewListIndexStatusResp() *ListIndexStatusResp { + return &ListIndexStatusResp{} +} + + +func (p *ListIndexStatusResp) GetCode() ErrorCode { + return p.Code +} +var ListIndexStatusResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListIndexStatusResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListIndexStatusResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListIndexStatusResp) GetStatuses() []*IndexStatus { + return p.Statuses +} +func (p *ListIndexStatusResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListIndexStatusResp) 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 *ListIndexStatusResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListIndexStatusResp) 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 *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexStatus, 0, size) + p.Statuses = tSlice + for i := 0; i < size; i ++ { + _elem53 := NewIndexStatus() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) + } + p.Statuses = append(p.Statuses, _elem53) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListIndexStatusResp(%+v)", *p) +} + +// Attributes: +// - ZoneName +// - Nodes +type AddZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewAddZoneReq() *AddZoneReq { + return &AddZoneReq{} +} + + +func (p *AddZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneReq) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *AddZoneReq) 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 *AddZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddZoneReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i ++ { + _elem54 := nebula0.NewHostAddr() + if err := _elem54.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.Nodes = append(p.Nodes, _elem54) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneReq"); err != nil { + 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 *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *AddZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) } + return err +} + +func (p *AddZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddZoneReq(%+v)", *p) +} + +// Attributes: +// - ZoneName +type DropZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewDropZoneReq() *DropZoneReq { + return &DropZoneReq{} +} + + +func (p *DropZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropZoneReq) 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 *DropZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DropZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropZoneReq(%+v)", *p) +} + +// Attributes: +// - Node +// - ZoneName +type AddHostIntoZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewAddHostIntoZoneReq() *AddHostIntoZoneReq { + return &AddHostIntoZoneReq{} +} + +var AddHostIntoZoneReq_Node_DEFAULT *nebula0.HostAddr +func (p *AddHostIntoZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return AddHostIntoZoneReq_Node_DEFAULT + } +return p.Node +} + +func (p *AddHostIntoZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *AddHostIntoZoneReq) IsSetNode() bool { + return p.Node != nil +} + +func (p *AddHostIntoZoneReq) 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 *AddHostIntoZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostIntoZoneReq"); 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 *AddHostIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) } + return err +} + +func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *AddHostIntoZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddHostIntoZoneReq(%+v)", *p) +} + +// Attributes: +// - Node +// - ZoneName +type DropHostFromZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewDropHostFromZoneReq() *DropHostFromZoneReq { + return &DropHostFromZoneReq{} +} + +var DropHostFromZoneReq_Node_DEFAULT *nebula0.HostAddr +func (p *DropHostFromZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return DropHostFromZoneReq_Node_DEFAULT + } +return p.Node +} + +func (p *DropHostFromZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropHostFromZoneReq) IsSetNode() bool { + return p.Node != nil +} + +func (p *DropHostFromZoneReq) 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 *DropHostFromZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropHostFromZoneReq"); 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 *DropHostFromZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) } + return err +} + +func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *DropHostFromZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropHostFromZoneReq(%+v)", *p) +} + +// Attributes: +// - ZoneName +type GetZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewGetZoneReq() *GetZoneReq { + return &GetZoneReq{} +} + + +func (p *GetZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *GetZoneReq) 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 *GetZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *GetZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneReq"); 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 *GetZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *GetZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetZoneReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type GetZoneResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewGetZoneResp() *GetZoneResp { + return &GetZoneResp{} +} + + +func (p *GetZoneResp) GetCode() ErrorCode { + return p.Code +} +var GetZoneResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetZoneResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetZoneResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetZoneResp) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *GetZoneResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetZoneResp) 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 *GetZoneResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetZoneResp) 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 *GetZoneResp) ReadField3(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 ++ { + _elem55 := nebula0.NewHostAddr() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) + } + p.Hosts = append(p.Hosts, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetZoneResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneResp"); 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *GetZoneResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetZoneResp(%+v)", *p) +} + +type ListZonesReq struct { +} + +func NewListZonesReq() *ListZonesReq { + return &ListZonesReq{} +} + +func (p *ListZonesReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListZonesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListZonesReq(%+v)", *p) +} + +// Attributes: +// - ZoneName +// - Nodes +type Zone struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewZone() *Zone { + return &Zone{} +} + + +func (p *Zone) GetZoneName() []byte { + return p.ZoneName +} + +func (p *Zone) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *Zone) 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 *Zone) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *Zone) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i ++ { + _elem56 := nebula0.NewHostAddr() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Nodes = append(p.Nodes, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Zone) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Zone"); 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 *Zone) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *Zone) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) } + return err +} + +func (p *Zone) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Zone(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Zones +type ListZonesResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Zones []*Zone `thrift:"zones,3" db:"zones" json:"zones"` +} + +func NewListZonesResp() *ListZonesResp { + return &ListZonesResp{} +} + + +func (p *ListZonesResp) GetCode() ErrorCode { + return p.Code +} +var ListZonesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListZonesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListZonesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListZonesResp) GetZones() []*Zone { + return p.Zones +} +func (p *ListZonesResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListZonesResp) 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 *ListZonesResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListZonesResp) 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 *ListZonesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Zone, 0, size) + p.Zones = tSlice + for i := 0; i < size; i ++ { + _elem57 := NewZone() + if err := _elem57.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) + } + p.Zones = append(p.Zones, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListZonesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesResp"); 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zones", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zones: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zones: ", p), err) } + return err +} + +func (p *ListZonesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListZonesResp(%+v)", *p) +} + +// Attributes: +// - GroupName +// - ZoneNames +type AddGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewAddGroupReq() *AddGroupReq { + return &AddGroupReq{} +} + + +func (p *AddGroupReq) GetGroupName() []byte { + return p.GroupName +} + +func (p *AddGroupReq) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *AddGroupReq) 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 *AddGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *AddGroupReq) 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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem58 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem58 = v +} + p.ZoneNames = append(p.ZoneNames, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddGroupReq"); 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 *AddGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *AddGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) } + return err +} + +func (p *AddGroupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddGroupReq(%+v)", *p) +} + +// Attributes: +// - GroupName +type DropGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewDropGroupReq() *DropGroupReq { + return &DropGroupReq{} +} + + +func (p *DropGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropGroupReq) 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 *DropGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *DropGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropGroupReq"); 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 *DropGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *DropGroupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropGroupReq(%+v)", *p) +} + +// Attributes: +// - ZoneName +// - GroupName +type AddZoneIntoGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewAddZoneIntoGroupReq() *AddZoneIntoGroupReq { + return &AddZoneIntoGroupReq{} +} + + +func (p *AddZoneIntoGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneIntoGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *AddZoneIntoGroupReq) 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 *AddZoneIntoGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddZoneIntoGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *AddZoneIntoGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneIntoGroupReq"); 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 *AddZoneIntoGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *AddZoneIntoGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) } + return err +} + +func (p *AddZoneIntoGroupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddZoneIntoGroupReq(%+v)", *p) +} + +// Attributes: +// - ZoneName +// - GroupName +type DropZoneFromGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewDropZoneFromGroupReq() *DropZoneFromGroupReq { + return &DropZoneFromGroupReq{} +} + + +func (p *DropZoneFromGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *DropZoneFromGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropZoneFromGroupReq) 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 *DropZoneFromGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropZoneFromGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *DropZoneFromGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneFromGroupReq"); 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 *DropZoneFromGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DropZoneFromGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) } + return err +} + +func (p *DropZoneFromGroupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropZoneFromGroupReq(%+v)", *p) +} + +// Attributes: +// - GroupName +type GetGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewGetGroupReq() *GetGroupReq { + return &GetGroupReq{} +} + + +func (p *GetGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *GetGroupReq) 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 *GetGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *GetGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupReq"); 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 *GetGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *GetGroupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetGroupReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - ZoneNames +type GetGroupResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ZoneNames [][]byte `thrift:"zone_names,3" db:"zone_names" json:"zone_names"` +} + +func NewGetGroupResp() *GetGroupResp { + return &GetGroupResp{} +} + + +func (p *GetGroupResp) GetCode() ErrorCode { + return p.Code +} +var GetGroupResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetGroupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetGroupResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetGroupResp) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *GetGroupResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetGroupResp) 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 *GetGroupResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetGroupResp) 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 *GetGroupResp) ReadField3(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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem59 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem59 = v +} + p.ZoneNames = append(p.ZoneNames, _elem59) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetGroupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupResp"); 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zone_names: ", p), err) } + return err +} + +func (p *GetGroupResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetGroupResp(%+v)", *p) +} + +type ListGroupsReq struct { +} + +func NewListGroupsReq() *ListGroupsReq { + return &ListGroupsReq{} +} + +func (p *ListGroupsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListGroupsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListGroupsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListGroupsReq(%+v)", *p) +} + +// Attributes: +// - GroupName +// - ZoneNames +type Group struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewGroup() *Group { + return &Group{} +} + + +func (p *Group) GetGroupName() []byte { + return p.GroupName +} + +func (p *Group) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *Group) 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 *Group) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *Group) 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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem60 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem60 = v +} + p.ZoneNames = append(p.ZoneNames, _elem60) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Group) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Group"); 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 *Group) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *Group) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) } + return err +} + +func (p *Group) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Group(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Groups +type ListGroupsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Groups []*Group `thrift:"groups,3" db:"groups" json:"groups"` +} + +func NewListGroupsResp() *ListGroupsResp { + return &ListGroupsResp{} +} + + +func (p *ListGroupsResp) GetCode() ErrorCode { + return p.Code +} +var ListGroupsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListGroupsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListGroupsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListGroupsResp) GetGroups() []*Group { + return p.Groups +} +func (p *ListGroupsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListGroupsResp) 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 *ListGroupsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListGroupsResp) 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 *ListGroupsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Group, 0, size) + p.Groups = tSlice + for i := 0; i < size; i ++ { + _elem61 := NewGroup() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + } + p.Groups = append(p.Groups, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListGroupsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsResp"); 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("groups", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:groups: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Groups)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Groups { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:groups: ", p), err) } + return err +} + +func (p *ListGroupsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListGroupsResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Type +// - Hosts +type AddListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewAddListenerReq() *AddListenerReq { + return &AddListenerReq{} +} + + +func (p *AddListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddListenerReq) GetType() ListenerType { + return p.Type +} + +func (p *AddListenerReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *AddListenerReq) 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 *AddListenerReq) 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 *AddListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *AddListenerReq) ReadField3(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 ++ { + _elem62 := nebula0.NewHostAddr() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Hosts = append(p.Hosts, _elem62) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddListenerReq"); 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 *AddListenerReq) 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 *AddListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *AddListenerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *AddListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddListenerReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Type +type RemoveListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` +} + +func NewRemoveListenerReq() *RemoveListenerReq { + return &RemoveListenerReq{} +} + + +func (p *RemoveListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemoveListenerReq) GetType() ListenerType { + return p.Type +} +func (p *RemoveListenerReq) 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 *RemoveListenerReq) 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 *RemoveListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *RemoveListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveListenerReq"); 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 *RemoveListenerReq) 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 *RemoveListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *RemoveListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveListenerReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +type ListListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListListenerReq() *ListListenerReq { + return &ListListenerReq{} +} + + +func (p *ListListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListListenerReq) 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 *ListListenerReq) 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 *ListListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerReq"); 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 *ListListenerReq) 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 *ListListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListListenerReq(%+v)", *p) +} + +// Attributes: +// - Type +// - Host +// - PartID +// - Status +type ListenerInfo struct { + Type ListenerType `thrift:"type,1" db:"type" json:"type"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + PartID nebula0.PartitionID `thrift:"part_id,3" db:"part_id" json:"part_id"` + Status HostStatus `thrift:"status,4" db:"status" json:"status"` +} + +func NewListenerInfo() *ListenerInfo { + return &ListenerInfo{} +} + + +func (p *ListenerInfo) GetType() ListenerType { + return p.Type +} +var ListenerInfo_Host_DEFAULT *nebula0.HostAddr +func (p *ListenerInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return ListenerInfo_Host_DEFAULT + } +return p.Host +} + +func (p *ListenerInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *ListenerInfo) GetStatus() HostStatus { + return p.Status +} +func (p *ListenerInfo) IsSetHost() bool { + return p.Host != nil +} + +func (p *ListenerInfo) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListenerInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *ListenerInfo) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ListenerInfo) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ListenerInfo) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *ListenerInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListenerInfo"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListenerInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *ListenerInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListenerInfo(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Listeners +type ListListenerResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Listeners []*ListenerInfo `thrift:"listeners,3" db:"listeners" json:"listeners"` +} + +func NewListListenerResp() *ListListenerResp { + return &ListListenerResp{} +} + + +func (p *ListListenerResp) GetCode() ErrorCode { + return p.Code +} +var ListListenerResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListListenerResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListListenerResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListListenerResp) GetListeners() []*ListenerInfo { + return p.Listeners +} +func (p *ListListenerResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListListenerResp) 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 *ListListenerResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListListenerResp) 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 *ListListenerResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ListenerInfo, 0, size) + p.Listeners = tSlice + for i := 0; i < size; i ++ { + _elem63 := NewListenerInfo() + if err := _elem63.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) + } + p.Listeners = append(p.Listeners, _elem63) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListListenerResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerResp"); 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("listeners", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:listeners: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Listeners { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:listeners: ", p), err) } + return err +} + +func (p *ListListenerResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListListenerResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +type GetStatisReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetStatisReq() *GetStatisReq { + return &GetStatisReq{} +} + + +func (p *GetStatisReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetStatisReq) 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 *GetStatisReq) 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 *GetStatisReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisReq"); 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 *GetStatisReq) 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 *GetStatisReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetStatisReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Statis +type GetStatisResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statis *StatisItem `thrift:"statis,3" db:"statis" json:"statis"` +} + +func NewGetStatisResp() *GetStatisResp { + return &GetStatisResp{} +} + + +func (p *GetStatisResp) GetCode() ErrorCode { + return p.Code +} +var GetStatisResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetStatisResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetStatisResp_Leader_DEFAULT + } +return p.Leader +} +var GetStatisResp_Statis_DEFAULT *StatisItem +func (p *GetStatisResp) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return GetStatisResp_Statis_DEFAULT + } +return p.Statis +} +func (p *GetStatisResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetStatisResp) IsSetStatis() bool { + return p.Statis != nil +} + +func (p *GetStatisResp) 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 *GetStatisResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetStatisResp) 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 *GetStatisResp) ReadField3(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *GetStatisResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisResp"); 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 *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statis: ", p), err) } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statis: ", p), err) } + return err +} + +func (p *GetStatisResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetStatisResp(%+v)", *p) +} + +// Attributes: +// - Host +// - CheckpointDir +type CheckpointInfo struct { + Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` + CheckpointDir []byte `thrift:"checkpoint_dir,2" db:"checkpoint_dir" json:"checkpoint_dir"` +} + +func NewCheckpointInfo() *CheckpointInfo { + return &CheckpointInfo{} +} + +var CheckpointInfo_Host_DEFAULT *nebula0.HostAddr +func (p *CheckpointInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return CheckpointInfo_Host_DEFAULT + } +return p.Host +} + +func (p *CheckpointInfo) GetCheckpointDir() []byte { + return p.CheckpointDir +} +func (p *CheckpointInfo) IsSetHost() bool { + return p.Host != nil +} + +func (p *CheckpointInfo) 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 *CheckpointInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *CheckpointInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.CheckpointDir = v +} + return nil +} + +func (p *CheckpointInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckpointInfo"); 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 *CheckpointInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("checkpoint_dir", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:checkpoint_dir: ", p), err) } + if err := oprot.WriteBinary(p.CheckpointDir); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.checkpoint_dir (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:checkpoint_dir: ", p), err) } + return err +} + +func (p *CheckpointInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckpointInfo(%+v)", *p) +} + +// Attributes: +// - Space +// - PartitionInfo +// - CpDirs +type SpaceBackupInfo struct { + Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` + PartitionInfo *nebula0.PartitionBackupInfo `thrift:"partition_info,2" db:"partition_info" json:"partition_info"` + CpDirs []*CheckpointInfo `thrift:"cp_dirs,3" db:"cp_dirs" json:"cp_dirs"` +} + +func NewSpaceBackupInfo() *SpaceBackupInfo { + return &SpaceBackupInfo{} +} + +var SpaceBackupInfo_Space_DEFAULT *SpaceDesc +func (p *SpaceBackupInfo) GetSpace() *SpaceDesc { + if !p.IsSetSpace() { + return SpaceBackupInfo_Space_DEFAULT + } +return p.Space +} +var SpaceBackupInfo_PartitionInfo_DEFAULT *nebula0.PartitionBackupInfo +func (p *SpaceBackupInfo) GetPartitionInfo() *nebula0.PartitionBackupInfo { + if !p.IsSetPartitionInfo() { + return SpaceBackupInfo_PartitionInfo_DEFAULT + } +return p.PartitionInfo +} + +func (p *SpaceBackupInfo) GetCpDirs() []*CheckpointInfo { + return p.CpDirs +} +func (p *SpaceBackupInfo) IsSetSpace() bool { + return p.Space != nil +} + +func (p *SpaceBackupInfo) IsSetPartitionInfo() bool { + return p.PartitionInfo != nil +} + +func (p *SpaceBackupInfo) 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 *SpaceBackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Space = NewSpaceDesc() + if err := p.Space.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Space), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { + p.PartitionInfo = nebula0.NewPartitionBackupInfo() + if err := p.PartitionInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionInfo), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*CheckpointInfo, 0, size) + p.CpDirs = tSlice + for i := 0; i < size; i ++ { + _elem64 := NewCheckpointInfo() + if err := _elem64.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.CpDirs = append(p.CpDirs, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceBackupInfo"); 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 *SpaceBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) } + if err := p.Space.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Space), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_info", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_info: ", p), err) } + if err := p.PartitionInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_info: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cp_dirs", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cp_dirs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CpDirs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.CpDirs { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cp_dirs: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceBackupInfo(%+v)", *p) +} + +// Attributes: +// - BackupInfo +// - MetaFiles +// - BackupName +type BackupMeta struct { + BackupInfo map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"backup_info,1" db:"backup_info" json:"backup_info"` + MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` + BackupName []byte `thrift:"backup_name,3" db:"backup_name" json:"backup_name"` +} + +func NewBackupMeta() *BackupMeta { + return &BackupMeta{} +} + + +func (p *BackupMeta) GetBackupInfo() map[nebula0.GraphSpaceID]*SpaceBackupInfo { + return p.BackupInfo +} + +func (p *BackupMeta) GetMetaFiles() [][]byte { + return p.MetaFiles +} + +func (p *BackupMeta) GetBackupName() []byte { + return p.BackupName +} +func (p *BackupMeta) 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 *BackupMeta) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) + p.BackupInfo = tMap + for i := 0; i < size; i ++ { +var _key65 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key65 = temp +} + _val66 := NewSpaceBackupInfo() + if err := _val66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val66), err) + } + p.BackupInfo[_key65] = _val66 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BackupMeta) 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.MetaFiles = tSlice + for i := 0; i < size; i ++ { +var _elem67 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem67 = v +} + p.MetaFiles = append(p.MetaFiles, _elem67) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BackupName = v +} + 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) } + 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 *BackupMeta) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.BackupInfo)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.BackupInfo { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_info: ", p), err) } + return err +} + +func (p *BackupMeta) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_files", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:meta_files: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.MetaFiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaFiles { + 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:meta_files: ", p), err) } + return err +} + +func (p *BackupMeta) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_name: ", p), err) } + return err +} + +func (p *BackupMeta) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupMeta(%+v)", *p) +} + +// Attributes: +// - Spaces +type CreateBackupReq struct { + Spaces [][]byte `thrift:"spaces,1" db:"spaces" json:"spaces,omitempty"` +} + +func NewCreateBackupReq() *CreateBackupReq { + return &CreateBackupReq{} +} + +var CreateBackupReq_Spaces_DEFAULT [][]byte + +func (p *CreateBackupReq) GetSpaces() [][]byte { + return p.Spaces +} +func (p *CreateBackupReq) IsSetSpaces() bool { + return p.Spaces != nil +} + +func (p *CreateBackupReq) 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 *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i ++ { +var _elem68 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem68 = v +} + p.Spaces = append(p.Spaces, _elem68) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateBackupReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaces() { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spaces: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + 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:spaces: ", p), err) } + } + return err +} + +func (p *CreateBackupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateBackupReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Meta +type CreateBackupResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Meta *BackupMeta `thrift:"meta,3" db:"meta" json:"meta"` +} + +func NewCreateBackupResp() *CreateBackupResp { + return &CreateBackupResp{} +} + + +func (p *CreateBackupResp) GetCode() ErrorCode { + return p.Code +} +var CreateBackupResp_Leader_DEFAULT *nebula0.HostAddr +func (p *CreateBackupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateBackupResp_Leader_DEFAULT + } +return p.Leader +} +var CreateBackupResp_Meta_DEFAULT *BackupMeta +func (p *CreateBackupResp) GetMeta() *BackupMeta { + if !p.IsSetMeta() { + return CreateBackupResp_Meta_DEFAULT + } +return p.Meta +} +func (p *CreateBackupResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *CreateBackupResp) IsSetMeta() bool { + return p.Meta != nil +} + +func (p *CreateBackupResp) 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 *CreateBackupResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *CreateBackupResp) 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 *CreateBackupResp) ReadField3(iprot thrift.Protocol) error { + p.Meta = NewBackupMeta() + if err := p.Meta.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Meta), err) + } + return nil +} + +func (p *CreateBackupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateBackupResp"); 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta: ", p), err) } + if err := p.Meta.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Meta), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta: ", p), err) } + return err +} + +func (p *CreateBackupResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateBackupResp(%+v)", *p) +} + +// Attributes: +// - FromHost +// - ToHost +type HostPair struct { + FromHost *nebula0.HostAddr `thrift:"from_host,1" db:"from_host" json:"from_host"` + ToHost *nebula0.HostAddr `thrift:"to_host,2" db:"to_host" json:"to_host"` +} + +func NewHostPair() *HostPair { + return &HostPair{} +} + +var HostPair_FromHost_DEFAULT *nebula0.HostAddr +func (p *HostPair) GetFromHost() *nebula0.HostAddr { + if !p.IsSetFromHost() { + return HostPair_FromHost_DEFAULT + } +return p.FromHost +} +var HostPair_ToHost_DEFAULT *nebula0.HostAddr +func (p *HostPair) GetToHost() *nebula0.HostAddr { + if !p.IsSetToHost() { + return HostPair_ToHost_DEFAULT + } +return p.ToHost +} +func (p *HostPair) IsSetFromHost() bool { + return p.FromHost != nil +} + +func (p *HostPair) IsSetToHost() bool { + return p.ToHost != nil +} + +func (p *HostPair) 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 *HostPair) ReadField1(iprot thrift.Protocol) error { + p.FromHost = nebula0.NewHostAddr() + if err := p.FromHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.FromHost), err) + } + return nil +} + +func (p *HostPair) ReadField2(iprot thrift.Protocol) error { + p.ToHost = nebula0.NewHostAddr() + if err := p.ToHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ToHost), err) + } + return nil +} + +func (p *HostPair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostPair"); 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 *HostPair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("from_host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:from_host: ", p), err) } + if err := p.FromHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.FromHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:from_host: ", p), err) } + return err +} + +func (p *HostPair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("to_host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:to_host: ", p), err) } + if err := p.ToHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ToHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:to_host: ", p), err) } + return err +} + +func (p *HostPair) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostPair(%+v)", *p) +} + +// Attributes: +// - Files +// - Hosts +type RestoreMetaReq struct { + Files [][]byte `thrift:"files,1" db:"files" json:"files"` + Hosts []*HostPair `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewRestoreMetaReq() *RestoreMetaReq { + return &RestoreMetaReq{} +} + + +func (p *RestoreMetaReq) GetFiles() [][]byte { + return p.Files +} + +func (p *RestoreMetaReq) GetHosts() []*HostPair { + return p.Hosts +} +func (p *RestoreMetaReq) 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 *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Files = tSlice + for i := 0; i < size; i ++ { +var _elem69 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem69 = v +} + p.Files = append(p.Files, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostPair, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem70 := NewHostPair() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) + } + p.Hosts = append(p.Hosts, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RestoreMetaReq"); 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 *RestoreMetaReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + 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:files: ", p), err) } + return err +} + +func (p *RestoreMetaReq) 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 *RestoreMetaReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RestoreMetaReq(%+v)", *p) +} + +// Attributes: +// - Host +// - User +// - Pwd +type FTClient struct { + Host *nebula0.HostAddr `thrift:"host,1,required" db:"host" json:"host"` + User []byte `thrift:"user,2" db:"user" json:"user,omitempty"` + Pwd []byte `thrift:"pwd,3" db:"pwd" json:"pwd,omitempty"` +} + +func NewFTClient() *FTClient { + return &FTClient{} +} + +var FTClient_Host_DEFAULT *nebula0.HostAddr +func (p *FTClient) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return FTClient_Host_DEFAULT + } +return p.Host +} +var FTClient_User_DEFAULT []byte + +func (p *FTClient) GetUser() []byte { + return p.User +} +var FTClient_Pwd_DEFAULT []byte + +func (p *FTClient) GetPwd() []byte { + return p.Pwd +} +func (p *FTClient) IsSetHost() bool { + return p.Host != nil +} + +func (p *FTClient) IsSetUser() bool { + return p.User != nil +} + +func (p *FTClient) IsSetPwd() bool { + return p.Pwd != nil +} + +func (p *FTClient) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHost 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 + } + issetHost = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHost{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")); + } + return nil +} + +func (p *FTClient) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *FTClient) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.User = v +} + return nil +} + +func (p *FTClient) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Pwd = v +} + return nil +} + +func (p *FTClient) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTClient"); 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 *FTClient) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *FTClient) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetUser() { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err) } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err) } + } + return err +} + +func (p *FTClient) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetPwd() { + if err := oprot.WriteFieldBegin("pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pwd: ", p), err) } + if err := oprot.WriteBinary(p.Pwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pwd: ", p), err) } + } + return err +} + +func (p *FTClient) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FTClient(%+v)", *p) +} + +// Attributes: +// - Type +// - Clients +type SignInFTServiceReq struct { + Type FTServiceType `thrift:"type,1" db:"type" json:"type"` + Clients []*FTClient `thrift:"clients,2" db:"clients" json:"clients"` +} + +func NewSignInFTServiceReq() *SignInFTServiceReq { + return &SignInFTServiceReq{} +} + + +func (p *SignInFTServiceReq) GetType() FTServiceType { + return p.Type +} + +func (p *SignInFTServiceReq) GetClients() []*FTClient { + return p.Clients +} +func (p *SignInFTServiceReq) 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 *SignInFTServiceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := FTServiceType(v) + p.Type = temp +} + return nil +} + +func (p *SignInFTServiceReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i ++ { + _elem71 := NewFTClient() + if err := _elem71.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem71), err) + } + p.Clients = append(p.Clients, _elem71) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SignInFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignInFTServiceReq"); 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 *SignInFTServiceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *SignInFTServiceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:clients: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + 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:clients: ", p), err) } + return err +} + +func (p *SignInFTServiceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SignInFTServiceReq(%+v)", *p) +} + +type SignOutFTServiceReq struct { +} + +func NewSignOutFTServiceReq() *SignOutFTServiceReq { + return &SignOutFTServiceReq{} +} + +func (p *SignOutFTServiceReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignOutFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignOutFTServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SignOutFTServiceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SignOutFTServiceReq(%+v)", *p) +} + +type ListFTClientsReq struct { +} + +func NewListFTClientsReq() *ListFTClientsReq { + return &ListFTClientsReq{} +} + +func (p *ListFTClientsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTClientsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListFTClientsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListFTClientsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Clients +type ListFTClientsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Clients []*FTClient `thrift:"clients,3" db:"clients" json:"clients"` +} + +func NewListFTClientsResp() *ListFTClientsResp { + return &ListFTClientsResp{} +} + + +func (p *ListFTClientsResp) GetCode() ErrorCode { + return p.Code +} +var ListFTClientsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListFTClientsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTClientsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListFTClientsResp) GetClients() []*FTClient { + return p.Clients +} +func (p *ListFTClientsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListFTClientsResp) 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 *ListFTClientsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListFTClientsResp) 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 *ListFTClientsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i ++ { + _elem72 := NewFTClient() + if err := _elem72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) + } + p.Clients = append(p.Clients, _elem72) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListFTClientsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsResp"); 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:clients: ", p), err) } + return err +} + +func (p *ListFTClientsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListFTClientsResp(%+v)", *p) +} + +// Attributes: +// - SessionID +// - CreateTime +// - UpdateTime +// - UserName +// - SpaceName +// - GraphAddr +// - Timezone +// - ClientIP +// - Configs +type Session struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` + CreateTime nebula0.Timestamp `thrift:"create_time,2" db:"create_time" json:"create_time"` + UpdateTime nebula0.Timestamp `thrift:"update_time,3" db:"update_time" json:"update_time"` + UserName []byte `thrift:"user_name,4" db:"user_name" json:"user_name"` + SpaceName []byte `thrift:"space_name,5" db:"space_name" json:"space_name"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,6" db:"graph_addr" json:"graph_addr"` + Timezone int32 `thrift:"timezone,7" db:"timezone" json:"timezone"` + ClientIP []byte `thrift:"client_ip,8" db:"client_ip" json:"client_ip"` + Configs map[string]*nebula0.Value `thrift:"configs,9" db:"configs" json:"configs"` +} + +func NewSession() *Session { + return &Session{} +} + + +func (p *Session) GetSessionID() nebula0.SessionID { + return p.SessionID +} + +func (p *Session) GetCreateTime() nebula0.Timestamp { + return p.CreateTime +} + +func (p *Session) GetUpdateTime() nebula0.Timestamp { + return p.UpdateTime +} + +func (p *Session) GetUserName() []byte { + return p.UserName +} + +func (p *Session) GetSpaceName() []byte { + return p.SpaceName +} +var Session_GraphAddr_DEFAULT *nebula0.HostAddr +func (p *Session) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return Session_GraphAddr_DEFAULT + } +return p.GraphAddr +} + +func (p *Session) GetTimezone() int32 { + return p.Timezone +} + +func (p *Session) GetClientIP() []byte { + return p.ClientIP +} + +func (p *Session) GetConfigs() map[string]*nebula0.Value { + return p.Configs +} +func (p *Session) IsSetGraphAddr() bool { + return p.GraphAddr != nil +} + +func (p *Session) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Session) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *Session) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.Timestamp(v) + p.CreateTime = temp +} + return nil +} + +func (p *Session) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.Timestamp(v) + p.UpdateTime = temp +} + return nil +} + +func (p *Session) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.UserName = v +} + return nil +} + +func (p *Session) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *Session) ReadField6(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *Session) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Timezone = v +} + return nil +} + +func (p *Session) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *Session) ReadField9(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula0.Value, size) + p.Configs = tMap + for i := 0; i < size; i ++ { +var _key73 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key73 = v +} + _val74 := nebula0.NewValue() + if err := _val74.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val74), err) + } + p.Configs[_key73] = _val74 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Session"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Session) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *Session) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:create_time: ", p), err) } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:create_time: ", p), err) } + return err +} + +func (p *Session) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("update_time", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:update_time: ", p), err) } + if err := oprot.WriteI64(int64(p.UpdateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_time (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update_time: ", p), err) } + return err +} + +func (p *Session) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) } + if err := oprot.WriteBinary(p.UserName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) } + return err +} + +func (p *Session) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:space_name: ", p), err) } + return err +} + +func (p *Session) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:graph_addr: ", p), err) } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:graph_addr: ", p), err) } + return err +} + +func (p *Session) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("timezone", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timezone: ", p), err) } + if err := oprot.WriteI32(int32(p.Timezone)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timezone (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timezone: ", p), err) } + return err +} + +func (p *Session) writeField8(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:client_ip: ", p), err) } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:client_ip: ", p), err) } + return err +} + +func (p *Session) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("configs", thrift.MAP, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:configs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Configs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:configs: ", p), err) } + return err +} + +func (p *Session) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Session(%+v)", *p) +} + +// Attributes: +// - User +// - GraphAddr +// - ClientIP +type CreateSessionReq struct { + User []byte `thrift:"user,1" db:"user" json:"user"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,2" db:"graph_addr" json:"graph_addr"` + ClientIP []byte `thrift:"client_ip,3" db:"client_ip" json:"client_ip"` +} + +func NewCreateSessionReq() *CreateSessionReq { + return &CreateSessionReq{} +} + + +func (p *CreateSessionReq) GetUser() []byte { + return p.User +} +var CreateSessionReq_GraphAddr_DEFAULT *nebula0.HostAddr +func (p *CreateSessionReq) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return CreateSessionReq_GraphAddr_DEFAULT + } +return p.GraphAddr +} + +func (p *CreateSessionReq) GetClientIP() []byte { + return p.ClientIP +} +func (p *CreateSessionReq) IsSetGraphAddr() bool { + return p.GraphAddr != nil +} + +func (p *CreateSessionReq) 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 *CreateSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.User = v +} + return nil +} + +func (p *CreateSessionReq) ReadField2(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *CreateSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionReq"); 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 *CreateSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user: ", p), err) } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:graph_addr: ", p), err) } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:graph_addr: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_ip: ", p), err) } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_ip: ", p), err) } + return err +} + +func (p *CreateSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSessionReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Session +type CreateSessionResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewCreateSessionResp() *CreateSessionResp { + return &CreateSessionResp{} +} + + +func (p *CreateSessionResp) GetCode() ErrorCode { + return p.Code +} +var CreateSessionResp_Leader_DEFAULT *nebula0.HostAddr +func (p *CreateSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateSessionResp_Leader_DEFAULT + } +return p.Leader +} +var CreateSessionResp_Session_DEFAULT *Session +func (p *CreateSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return CreateSessionResp_Session_DEFAULT + } +return p.Session +} +func (p *CreateSessionResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *CreateSessionResp) IsSetSession() bool { + return p.Session != nil +} + +func (p *CreateSessionResp) 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 *CreateSessionResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *CreateSessionResp) 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 *CreateSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *CreateSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionResp"); 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *CreateSessionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSessionResp(%+v)", *p) +} + +// Attributes: +// - Sessions +type UpdateSessionsReq struct { + Sessions []*Session `thrift:"sessions,1" db:"sessions" json:"sessions"` +} + +func NewUpdateSessionsReq() *UpdateSessionsReq { + return &UpdateSessionsReq{} +} + + +func (p *UpdateSessionsReq) GetSessions() []*Session { + return p.Sessions +} +func (p *UpdateSessionsReq) 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 *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i ++ { + _elem75 := NewSession() + if err := _elem75.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem75), err) + } + p.Sessions = append(p.Sessions, _elem75) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsReq"); 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 *UpdateSessionsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessions: ", p), err) } + return err +} + +func (p *UpdateSessionsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateSessionsReq(%+v)", *p) +} + +type ListSessionsReq struct { +} + +func NewListSessionsReq() *ListSessionsReq { + return &ListSessionsReq{} +} + +func (p *ListSessionsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSessionsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSessionsReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Sessions +type ListSessionsResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Sessions []*Session `thrift:"sessions,3" db:"sessions" json:"sessions"` +} + +func NewListSessionsResp() *ListSessionsResp { + return &ListSessionsResp{} +} + + +func (p *ListSessionsResp) GetCode() ErrorCode { + return p.Code +} +var ListSessionsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSessionsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSessionsResp) GetSessions() []*Session { + return p.Sessions +} +func (p *ListSessionsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListSessionsResp) 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 *ListSessionsResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSessionsResp) 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 *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i ++ { + _elem76 := NewSession() + if err := _elem76.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem76), err) + } + p.Sessions = append(p.Sessions, _elem76) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsResp"); 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessions: ", p), err) } + return err +} + +func (p *ListSessionsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSessionsResp(%+v)", *p) +} + +// Attributes: +// - SessionID +type GetSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewGetSessionReq() *GetSessionReq { + return &GetSessionReq{} +} + + +func (p *GetSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *GetSessionReq) 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 *GetSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *GetSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionReq"); 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 *GetSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *GetSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSessionReq(%+v)", *p) +} + +// Attributes: +// - Code +// - Leader +// - Session +type GetSessionResp struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewGetSessionResp() *GetSessionResp { + return &GetSessionResp{} +} + + +func (p *GetSessionResp) GetCode() ErrorCode { + return p.Code +} +var GetSessionResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSessionResp_Leader_DEFAULT + } +return p.Leader +} +var GetSessionResp_Session_DEFAULT *Session +func (p *GetSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return GetSessionResp_Session_DEFAULT + } +return p.Session +} +func (p *GetSessionResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetSessionResp) IsSetSession() bool { + return p.Session != nil +} + +func (p *GetSessionResp) 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 *GetSessionResp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetSessionResp) 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 *GetSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *GetSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionResp"); 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *GetSessionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSessionResp(%+v)", *p) +} + +// Attributes: +// - SessionID +type RemoveSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewRemoveSessionReq() *RemoveSessionReq { + return &RemoveSessionReq{} +} + + +func (p *RemoveSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *RemoveSessionReq) 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 *RemoveSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *RemoveSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveSessionReq"); 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 *RemoveSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *RemoveSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveSessionReq(%+v)", *p) +} + +// Attributes: +// - Code +// - JobID +// - TaskID +// - Statis +type ReportTaskReq struct { + Code ErrorCode `thrift:"code,1" db:"code" json:"code"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Statis *StatisItem `thrift:"statis,4" db:"statis" json:"statis,omitempty"` +} + +func NewReportTaskReq() *ReportTaskReq { + return &ReportTaskReq{} +} + + +func (p *ReportTaskReq) GetCode() ErrorCode { + return p.Code +} + +func (p *ReportTaskReq) GetJobID() int32 { + return p.JobID +} + +func (p *ReportTaskReq) GetTaskID() int32 { + return p.TaskID +} +var ReportTaskReq_Statis_DEFAULT *StatisItem +func (p *ReportTaskReq) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return ReportTaskReq_Statis_DEFAULT + } +return p.Statis +} +func (p *ReportTaskReq) IsSetStatis() bool { + return p.Statis != nil +} + +func (p *ReportTaskReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReportTaskReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ReportTaskReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField4(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *ReportTaskReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ReportTaskReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:statis: ", p), err) } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:statis: ", p), err) } + } + return err +} + +func (p *ReportTaskReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReportTaskReq(%+v)", *p) +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/constants.go b/ccore/nebula/internal/thrift/v2_0_0/storage/constants.go new file mode 100644 index 0000000..fbb2e9a --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/constants.go @@ -0,0 +1,28 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/general_storage_service-remote/general_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_0_0/storage/general_storage_service-remote/general_storage_service-remote.go new file mode 100755 index 0000000..3be657d --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/general_storage_service-remote/general_storage_service-remote.go @@ -0,0 +1,202 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " KVGetResponse get(KVGetRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse put(KVPutRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse remove(KVRemoveRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGeneralStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg379 := flag.Arg(1) + mbTrans380 := thrift.NewMemoryBufferLen(len(arg379)) + defer mbTrans380.Close() + _, err381 := mbTrans380.WriteString(arg379) + if err381 != nil { + Usage() + return + } + factory382 := thrift.NewSimpleJSONProtocolFactory() + jsProt383 := factory382.GetProtocol(mbTrans380) + argvalue0 := storage.NewKVGetRequest() + err384 := argvalue0.Read(jsProt383) + if err384 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "put": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg385 := flag.Arg(1) + mbTrans386 := thrift.NewMemoryBufferLen(len(arg385)) + defer mbTrans386.Close() + _, err387 := mbTrans386.WriteString(arg385) + if err387 != nil { + Usage() + return + } + factory388 := thrift.NewSimpleJSONProtocolFactory() + jsProt389 := factory388.GetProtocol(mbTrans386) + argvalue0 := storage.NewKVPutRequest() + err390 := argvalue0.Read(jsProt389) + if err390 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg391 := flag.Arg(1) + mbTrans392 := thrift.NewMemoryBufferLen(len(arg391)) + defer mbTrans392.Close() + _, err393 := mbTrans392.WriteString(arg391) + if err393 != nil { + Usage() + return + } + factory394 := thrift.NewSimpleJSONProtocolFactory() + jsProt395 := factory394.GetProtocol(mbTrans392) + argvalue0 := storage.NewKVRemoveRequest() + err396 := argvalue0.Read(jsProt395) + if err396 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/generalstorageservice.go b/ccore/nebula/internal/thrift/v2_0_0/storage/generalstorageservice.go new file mode 100644 index 0000000..0a039c1 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/generalstorageservice.go @@ -0,0 +1,1287 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GeneralStorageService interface { + // Parameters: + // - Req + Get(req *KVGetRequest) (r *KVGetResponse, err error) + // Parameters: + // - Req + Put(req *KVPutRequest) (r *ExecResponse, err error) + // Parameters: + // - Req + Remove(req *KVRemoveRequest) (r *ExecResponse, err error) +} + +type GeneralStorageServiceClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 +} + +func (client *GeneralStorageServiceClient) Close() error { + return client.Transport.Close() +} + +func NewGeneralStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGeneralStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Get(req *KVGetRequest) (r *KVGetResponse, err error) { + if err = p.sendGet(req); err != nil { return } + return p.recvGet() +} + +func (p *GeneralStorageServiceClient) sendGet(req *KVGetRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("get", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServiceGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceClient) recvGet() (value *KVGetResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "get" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "get failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "get failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error365 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error366 error + error366, err = error365.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error366 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "get failed: invalid message type") + return + } + result := GeneralStorageServiceGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Put(req *KVPutRequest) (r *ExecResponse, err error) { + if err = p.sendPut(req); err != nil { return } + return p.recvPut() +} + +func (p *GeneralStorageServiceClient) sendPut(req *KVPutRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("put", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServicePutArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceClient) recvPut() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "put" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "put failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "put failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error367 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error368 error + error368, err = error367.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error368 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "put failed: invalid message type") + return + } + result := GeneralStorageServicePutResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Remove(req *KVRemoveRequest) (r *ExecResponse, err error) { + if err = p.sendRemove(req); err != nil { return } + return p.recvRemove() +} + +func (p *GeneralStorageServiceClient) sendRemove(req *KVRemoveRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("remove", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceClient) recvRemove() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "remove" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "remove failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "remove failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error369 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error370 error + error370, err = error369.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error370 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "remove failed: invalid message type") + return + } + result := GeneralStorageServiceRemoveResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GeneralStorageServiceThreadsafeClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 + Mu sync.Mutex +} + +func NewGeneralStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGeneralStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +func (p *GeneralStorageServiceThreadsafeClient) Threadsafe() {} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Get(req *KVGetRequest) (r *KVGetResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGet(req); err != nil { return } + return p.recvGet() +} + +func (p *GeneralStorageServiceThreadsafeClient) sendGet(req *KVGetRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("get", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServiceGetArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "get" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "get failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "get failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error371 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error372 error + error372, err = error371.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error372 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "get failed: invalid message type") + return + } + result := GeneralStorageServiceGetResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Put(req *KVPutRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendPut(req); err != nil { return } + return p.recvPut() +} + +func (p *GeneralStorageServiceThreadsafeClient) sendPut(req *KVPutRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("put", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServicePutArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "put" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "put failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "put failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error373 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error374 error + error374, err = error373.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error374 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "put failed: invalid message type") + return + } + result := GeneralStorageServicePutResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemove(req); err != nil { return } + return p.recvRemove() +} + +func (p *GeneralStorageServiceThreadsafeClient) sendRemove(req *KVRemoveRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("remove", thrift.CALL, p.SeqId); err != nil { + return + } + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "remove" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "remove failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "remove failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error375 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error376 error + error376, err = error375.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error376 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "remove failed: invalid message type") + return + } + result := GeneralStorageServiceRemoveResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GeneralStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunction + handler GeneralStorageService +} + +func (p *GeneralStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *GeneralStorageServiceProcessor) GetProcessorFunction(key string) (processor thrift.ProcessorFunction, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GeneralStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunction { + return p.processorMap +} + +func NewGeneralStorageServiceProcessor(handler GeneralStorageService) *GeneralStorageServiceProcessor { + self377 := &GeneralStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunction)} + self377.processorMap["get"] = &generalStorageServiceProcessorGet{handler:handler} + self377.processorMap["put"] = &generalStorageServiceProcessorPut{handler:handler} + self377.processorMap["remove"] = &generalStorageServiceProcessorRemove{handler:handler} + return self377 +} + +type generalStorageServiceProcessorGet struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorGet) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceGetArgs) + var result GeneralStorageServiceGetResult + if retval, err := p.handler.Get(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorPut struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServicePutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("put", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorPut) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServicePutArgs) + var result GeneralStorageServicePutResult + if retval, err := p.handler.Put(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorRemove struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorRemove) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceRemoveArgs) + var result GeneralStorageServiceRemoveResult + if retval, err := p.handler.Remove(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GeneralStorageServiceGetArgs struct { + Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceGetArgs() *GeneralStorageServiceGetArgs { + return &GeneralStorageServiceGetArgs{} +} + +var GeneralStorageServiceGetArgs_Req_DEFAULT *KVGetRequest +func (p *GeneralStorageServiceGetArgs) GetReq() *KVGetRequest { + if !p.IsSetReq() { + return GeneralStorageServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceGetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GeneralStorageServiceGetArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVGetRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServiceGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GeneralStorageServiceGetResult struct { + Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceGetResult() *GeneralStorageServiceGetResult { + return &GeneralStorageServiceGetResult{} +} + +var GeneralStorageServiceGetResult_Success_DEFAULT *KVGetResponse +func (p *GeneralStorageServiceGetResult) GetSuccess() *KVGetResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GeneralStorageServiceGetResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewKVGetResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServiceGetResult(%+v)", *p) +} + +// Attributes: +// - Req +type GeneralStorageServicePutArgs struct { + Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServicePutArgs() *GeneralStorageServicePutArgs { + return &GeneralStorageServicePutArgs{} +} + +var GeneralStorageServicePutArgs_Req_DEFAULT *KVPutRequest +func (p *GeneralStorageServicePutArgs) GetReq() *KVPutRequest { + if !p.IsSetReq() { + return GeneralStorageServicePutArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServicePutArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GeneralStorageServicePutArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVPutRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServicePutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServicePutArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GeneralStorageServicePutResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServicePutResult() *GeneralStorageServicePutResult { + return &GeneralStorageServicePutResult{} +} + +var GeneralStorageServicePutResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServicePutResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServicePutResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServicePutResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GeneralStorageServicePutResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServicePutResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServicePutResult(%+v)", *p) +} + +// Attributes: +// - Req +type GeneralStorageServiceRemoveArgs struct { + Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceRemoveArgs() *GeneralStorageServiceRemoveArgs { + return &GeneralStorageServiceRemoveArgs{} +} + +var GeneralStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest +func (p *GeneralStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { + if !p.IsSetReq() { + return GeneralStorageServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceRemoveArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GeneralStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVRemoveRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceRemoveArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServiceRemoveArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GeneralStorageServiceRemoveResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceRemoveResult() *GeneralStorageServiceRemoveResult { + return &GeneralStorageServiceRemoveResult{} +} + +var GeneralStorageServiceRemoveResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServiceRemoveResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceRemoveResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GeneralStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceRemoveResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GeneralStorageServiceRemoveResult(%+v)", *p) +} + + diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/graph_storage_service-remote/graph_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_0_0/storage/graph_storage_service-remote/graph_storage_service-remote.go new file mode 100755 index 0000000..2b62a43 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -0,0 +1,488 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse getNeighbors(GetNeighborsRequest req)") + fmt.Fprintln(os.Stderr, " GetPropResponse getProps(GetPropRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addVertices(AddVerticesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteEdges(DeleteEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteVertices(DeleteVerticesRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateVertex(UpdateVertexRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ScanVertexResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanEdgeResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") + fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdgesAtomic(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGraphStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "getNeighbors": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") + flag.Usage() + } + arg129 := flag.Arg(1) + mbTrans130 := thrift.NewMemoryBufferLen(len(arg129)) + defer mbTrans130.Close() + _, err131 := mbTrans130.WriteString(arg129) + if err131 != nil { + Usage() + return + } + factory132 := thrift.NewSimpleJSONProtocolFactory() + jsProt133 := factory132.GetProtocol(mbTrans130) + argvalue0 := storage.NewGetNeighborsRequest() + err134 := argvalue0.Read(jsProt133) + if err134 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetNeighbors(value0)) + fmt.Print("\n") + break + case "getProps": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetProps requires 1 args") + flag.Usage() + } + arg135 := flag.Arg(1) + mbTrans136 := thrift.NewMemoryBufferLen(len(arg135)) + defer mbTrans136.Close() + _, err137 := mbTrans136.WriteString(arg135) + if err137 != nil { + Usage() + return + } + factory138 := thrift.NewSimpleJSONProtocolFactory() + jsProt139 := factory138.GetProtocol(mbTrans136) + argvalue0 := storage.NewGetPropRequest() + err140 := argvalue0.Read(jsProt139) + if err140 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetProps(value0)) + fmt.Print("\n") + break + case "addVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") + flag.Usage() + } + arg141 := flag.Arg(1) + mbTrans142 := thrift.NewMemoryBufferLen(len(arg141)) + defer mbTrans142.Close() + _, err143 := mbTrans142.WriteString(arg141) + if err143 != nil { + Usage() + return + } + factory144 := thrift.NewSimpleJSONProtocolFactory() + jsProt145 := factory144.GetProtocol(mbTrans142) + argvalue0 := storage.NewAddVerticesRequest() + err146 := argvalue0.Read(jsProt145) + if err146 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddVertices(value0)) + fmt.Print("\n") + break + case "addEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") + flag.Usage() + } + arg147 := flag.Arg(1) + mbTrans148 := thrift.NewMemoryBufferLen(len(arg147)) + defer mbTrans148.Close() + _, err149 := mbTrans148.WriteString(arg147) + if err149 != nil { + Usage() + return + } + factory150 := thrift.NewSimpleJSONProtocolFactory() + jsProt151 := factory150.GetProtocol(mbTrans148) + argvalue0 := storage.NewAddEdgesRequest() + err152 := argvalue0.Read(jsProt151) + if err152 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdges(value0)) + fmt.Print("\n") + break + case "deleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") + flag.Usage() + } + arg153 := flag.Arg(1) + mbTrans154 := thrift.NewMemoryBufferLen(len(arg153)) + defer mbTrans154.Close() + _, err155 := mbTrans154.WriteString(arg153) + if err155 != nil { + Usage() + return + } + factory156 := thrift.NewSimpleJSONProtocolFactory() + jsProt157 := factory156.GetProtocol(mbTrans154) + argvalue0 := storage.NewDeleteEdgesRequest() + err158 := argvalue0.Read(jsProt157) + if err158 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteEdges(value0)) + fmt.Print("\n") + break + case "deleteVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") + flag.Usage() + } + arg159 := flag.Arg(1) + mbTrans160 := thrift.NewMemoryBufferLen(len(arg159)) + defer mbTrans160.Close() + _, err161 := mbTrans160.WriteString(arg159) + if err161 != nil { + Usage() + return + } + factory162 := thrift.NewSimpleJSONProtocolFactory() + jsProt163 := factory162.GetProtocol(mbTrans160) + argvalue0 := storage.NewDeleteVerticesRequest() + err164 := argvalue0.Read(jsProt163) + if err164 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteVertices(value0)) + fmt.Print("\n") + break + case "updateVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") + flag.Usage() + } + arg165 := flag.Arg(1) + mbTrans166 := thrift.NewMemoryBufferLen(len(arg165)) + defer mbTrans166.Close() + _, err167 := mbTrans166.WriteString(arg165) + if err167 != nil { + Usage() + return + } + factory168 := thrift.NewSimpleJSONProtocolFactory() + jsProt169 := factory168.GetProtocol(mbTrans166) + argvalue0 := storage.NewUpdateVertexRequest() + err170 := argvalue0.Read(jsProt169) + if err170 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateVertex(value0)) + fmt.Print("\n") + break + case "updateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") + flag.Usage() + } + arg171 := flag.Arg(1) + mbTrans172 := thrift.NewMemoryBufferLen(len(arg171)) + defer mbTrans172.Close() + _, err173 := mbTrans172.WriteString(arg171) + if err173 != nil { + Usage() + return + } + factory174 := thrift.NewSimpleJSONProtocolFactory() + jsProt175 := factory174.GetProtocol(mbTrans172) + argvalue0 := storage.NewUpdateEdgeRequest() + err176 := argvalue0.Read(jsProt175) + if err176 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateEdge(value0)) + fmt.Print("\n") + break + case "scanVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") + flag.Usage() + } + arg177 := flag.Arg(1) + mbTrans178 := thrift.NewMemoryBufferLen(len(arg177)) + defer mbTrans178.Close() + _, err179 := mbTrans178.WriteString(arg177) + if err179 != nil { + Usage() + return + } + factory180 := thrift.NewSimpleJSONProtocolFactory() + jsProt181 := factory180.GetProtocol(mbTrans178) + argvalue0 := storage.NewScanVertexRequest() + err182 := argvalue0.Read(jsProt181) + if err182 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanVertex(value0)) + fmt.Print("\n") + break + case "scanEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") + flag.Usage() + } + arg183 := flag.Arg(1) + mbTrans184 := thrift.NewMemoryBufferLen(len(arg183)) + defer mbTrans184.Close() + _, err185 := mbTrans184.WriteString(arg183) + if err185 != nil { + Usage() + return + } + factory186 := thrift.NewSimpleJSONProtocolFactory() + jsProt187 := factory186.GetProtocol(mbTrans184) + argvalue0 := storage.NewScanEdgeRequest() + err188 := argvalue0.Read(jsProt187) + if err188 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanEdge(value0)) + fmt.Print("\n") + break + case "getUUID": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") + flag.Usage() + } + arg189 := flag.Arg(1) + mbTrans190 := thrift.NewMemoryBufferLen(len(arg189)) + defer mbTrans190.Close() + _, err191 := mbTrans190.WriteString(arg189) + if err191 != nil { + Usage() + return + } + factory192 := thrift.NewSimpleJSONProtocolFactory() + jsProt193 := factory192.GetProtocol(mbTrans190) + argvalue0 := storage.NewGetUUIDReq() + err194 := argvalue0.Read(jsProt193) + if err194 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUUID(value0)) + fmt.Print("\n") + break + case "lookupIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") + flag.Usage() + } + arg195 := flag.Arg(1) + mbTrans196 := thrift.NewMemoryBufferLen(len(arg195)) + defer mbTrans196.Close() + _, err197 := mbTrans196.WriteString(arg195) + if err197 != nil { + Usage() + return + } + factory198 := thrift.NewSimpleJSONProtocolFactory() + jsProt199 := factory198.GetProtocol(mbTrans196) + argvalue0 := storage.NewLookupIndexRequest() + err200 := argvalue0.Read(jsProt199) + if err200 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupIndex(value0)) + fmt.Print("\n") + break + case "lookupAndTraverse": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") + flag.Usage() + } + arg201 := flag.Arg(1) + mbTrans202 := thrift.NewMemoryBufferLen(len(arg201)) + defer mbTrans202.Close() + _, err203 := mbTrans202.WriteString(arg201) + if err203 != nil { + Usage() + return + } + factory204 := thrift.NewSimpleJSONProtocolFactory() + jsProt205 := factory204.GetProtocol(mbTrans202) + argvalue0 := storage.NewLookupAndTraverseRequest() + err206 := argvalue0.Read(jsProt205) + if err206 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupAndTraverse(value0)) + fmt.Print("\n") + break + case "addEdgesAtomic": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdgesAtomic requires 1 args") + flag.Usage() + } + arg207 := flag.Arg(1) + mbTrans208 := thrift.NewMemoryBufferLen(len(arg207)) + defer mbTrans208.Close() + _, err209 := mbTrans208.WriteString(arg207) + if err209 != nil { + Usage() + return + } + factory210 := thrift.NewSimpleJSONProtocolFactory() + jsProt211 := factory210.GetProtocol(mbTrans208) + argvalue0 := storage.NewAddEdgesRequest() + err212 := argvalue0.Read(jsProt211) + if err212 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdgesAtomic(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/graphstorageservice.go b/ccore/nebula/internal/thrift/v2_0_0/storage/graphstorageservice.go new file mode 100644 index 0000000..e0d8bd6 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/graphstorageservice.go @@ -0,0 +1,5577 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GraphStorageService interface { + // Parameters: + // - Req + GetNeighbors(req *GetNeighborsRequest) (r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(req *GetPropRequest) (r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(req *AddVerticesRequest) (r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(req *AddEdgesRequest) (r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(req *DeleteEdgesRequest) (r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(req *DeleteVerticesRequest) (r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(req *UpdateVertexRequest) (r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(req *UpdateEdgeRequest) (r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(req *ScanVertexRequest) (r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(req *ScanEdgeRequest) (r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(req *GetUUIDReq) (r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(req *LookupIndexRequest) (r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(req *LookupAndTraverseRequest) (r *GetNeighborsResponse, err error) + // Parameters: + // - Req + AddEdgesAtomic(req *AddEdgesRequest) (r *ExecResponse, err error) +} + +type GraphStorageServiceClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 +} + +func (client *GraphStorageServiceClient) Close() error { + return client.Transport.Close() +} + +func NewGraphStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceClient { + return &GraphStorageServiceClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGraphStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceClient { + return &GraphStorageServiceClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetNeighbors(req *GetNeighborsRequest) (r *GetNeighborsResponse, err error) { + if err = p.sendGetNeighbors(req); err != nil { return } + return p.recvGetNeighbors() +} + +func (p *GraphStorageServiceClient) sendGetNeighbors(req *GetNeighborsRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getNeighbors", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getNeighbors" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getNeighbors failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getNeighbors failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error71 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error72 error + error72, err = error71.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error72 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getNeighbors failed: invalid message type") + return + } + result := GraphStorageServiceGetNeighborsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (r *GetPropResponse, err error) { + if err = p.sendGetProps(req); err != nil { return } + return p.recvGetProps() +} + +func (p *GraphStorageServiceClient) sendGetProps(req *GetPropRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getProps", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvGetProps() (value *GetPropResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getProps" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getProps failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getProps failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error73 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error74 error + error74, err = error73.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error74 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getProps failed: invalid message type") + return + } + result := GraphStorageServiceGetPropsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddVertices(req *AddVerticesRequest) (r *ExecResponse, err error) { + if err = p.sendAddVertices(req); err != nil { return } + return p.recvAddVertices() +} + +func (p *GraphStorageServiceClient) sendAddVertices(req *AddVerticesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addVertices", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvAddVertices() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addVertices" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addVertices failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addVertices failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error75 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error76 error + error76, err = error75.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error76 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addVertices failed: invalid message type") + return + } + result := GraphStorageServiceAddVerticesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdges(req *AddEdgesRequest) (r *ExecResponse, err error) { + if err = p.sendAddEdges(req); err != nil { return } + return p.recvAddEdges() +} + +func (p *GraphStorageServiceClient) sendAddEdges(req *AddEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvAddEdges() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error77 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error78 error + error78, err = error77.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error78 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addEdges failed: invalid message type") + return + } + result := GraphStorageServiceAddEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteEdges(req *DeleteEdgesRequest) (r *ExecResponse, err error) { + if err = p.sendDeleteEdges(req); err != nil { return } + return p.recvDeleteEdges() +} + +func (p *GraphStorageServiceClient) sendDeleteEdges(req *DeleteEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvDeleteEdges() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "deleteEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "deleteEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "deleteEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error79 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error80 error + error80, err = error79.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error80 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "deleteEdges failed: invalid message type") + return + } + result := GraphStorageServiceDeleteEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteVertices(req *DeleteVerticesRequest) (r *ExecResponse, err error) { + if err = p.sendDeleteVertices(req); err != nil { return } + return p.recvDeleteVertices() +} + +func (p *GraphStorageServiceClient) sendDeleteVertices(req *DeleteVerticesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteVertices", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvDeleteVertices() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "deleteVertices" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "deleteVertices failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "deleteVertices failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error81 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error82 error + error82, err = error81.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error82 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "deleteVertices failed: invalid message type") + return + } + result := GraphStorageServiceDeleteVerticesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateVertex(req *UpdateVertexRequest) (r *UpdateResponse, err error) { + if err = p.sendUpdateVertex(req); err != nil { return } + return p.recvUpdateVertex() +} + +func (p *GraphStorageServiceClient) sendUpdateVertex(req *UpdateVertexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateVertex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvUpdateVertex() (value *UpdateResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateVertex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateVertex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateVertex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error83 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error84 error + error84, err = error83.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error84 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateVertex failed: invalid message type") + return + } + result := GraphStorageServiceUpdateVertexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateEdge(req *UpdateEdgeRequest) (r *UpdateResponse, err error) { + if err = p.sendUpdateEdge(req); err != nil { return } + return p.recvUpdateEdge() +} + +func (p *GraphStorageServiceClient) sendUpdateEdge(req *UpdateEdgeRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvUpdateEdge() (value *UpdateResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error85 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error86 error + error86, err = error85.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error86 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateEdge failed: invalid message type") + return + } + result := GraphStorageServiceUpdateEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (r *ScanVertexResponse, err error) { + if err = p.sendScanVertex(req); err != nil { return } + return p.recvScanVertex() +} + +func (p *GraphStorageServiceClient) sendScanVertex(req *ScanVertexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scanVertex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scanVertex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scanVertex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scanVertex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error87 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error88 error + error88, err = error87.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error88 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scanVertex failed: invalid message type") + return + } + result := GraphStorageServiceScanVertexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (r *ScanEdgeResponse, err error) { + if err = p.sendScanEdge(req); err != nil { return } + return p.recvScanEdge() +} + +func (p *GraphStorageServiceClient) sendScanEdge(req *ScanEdgeRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scanEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scanEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scanEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scanEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error89 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error90 error + error90, err = error89.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error90 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scanEdge failed: invalid message type") + return + } + result := GraphStorageServiceScanEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetUUID(req *GetUUIDReq) (r *GetUUIDResp, err error) { + if err = p.sendGetUUID(req); err != nil { return } + return p.recvGetUUID() +} + +func (p *GraphStorageServiceClient) sendGetUUID(req *GetUUIDReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getUUID", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvGetUUID() (value *GetUUIDResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getUUID" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getUUID failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getUUID failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error91 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error92 error + error92, err = error91.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error92 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getUUID failed: invalid message type") + return + } + result := GraphStorageServiceGetUUIDResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupIndex(req *LookupIndexRequest) (r *LookupIndexResp, err error) { + if err = p.sendLookupIndex(req); err != nil { return } + return p.recvLookupIndex() +} + +func (p *GraphStorageServiceClient) sendLookupIndex(req *LookupIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lookupIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvLookupIndex() (value *LookupIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "lookupIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "lookupIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "lookupIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error93 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error94 error + error94, err = error93.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error94 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "lookupIndex failed: invalid message type") + return + } + result := GraphStorageServiceLookupIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupAndTraverse(req *LookupAndTraverseRequest) (r *GetNeighborsResponse, err error) { + if err = p.sendLookupAndTraverse(req); err != nil { return } + return p.recvLookupAndTraverse() +} + +func (p *GraphStorageServiceClient) sendLookupAndTraverse(req *LookupAndTraverseRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lookupAndTraverse", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "lookupAndTraverse" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "lookupAndTraverse failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "lookupAndTraverse failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error95 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error96 error + error96, err = error95.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error96 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "lookupAndTraverse failed: invalid message type") + return + } + result := GraphStorageServiceLookupAndTraverseResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdgesAtomic(req *AddEdgesRequest) (r *ExecResponse, err error) { + if err = p.sendAddEdgesAtomic(req); err != nil { return } + return p.recvAddEdgesAtomic() +} + +func (p *GraphStorageServiceClient) sendAddEdgesAtomic(req *AddEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addEdgesAtomic", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addEdgesAtomic" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addEdgesAtomic failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addEdgesAtomic failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error97 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error98 error + error98, err = error97.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error98 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addEdgesAtomic failed: invalid message type") + return + } + result := GraphStorageServiceAddEdgesAtomicResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GraphStorageServiceThreadsafeClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 + Mu sync.Mutex +} + +func NewGraphStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewGraphStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +func (p *GraphStorageServiceThreadsafeClient) Threadsafe() {} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetNeighbors(req *GetNeighborsRequest) (r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetNeighbors(req); err != nil { return } + return p.recvGetNeighbors() +} + +func (p *GraphStorageServiceThreadsafeClient) sendGetNeighbors(req *GetNeighborsRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getNeighbors", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getNeighbors" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getNeighbors failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getNeighbors failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error99 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error100 error + error100, err = error99.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error100 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getNeighbors failed: invalid message type") + return + } + result := GraphStorageServiceGetNeighborsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (r *GetPropResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetProps(req); err != nil { return } + return p.recvGetProps() +} + +func (p *GraphStorageServiceThreadsafeClient) sendGetProps(req *GetPropRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getProps", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetProps() (value *GetPropResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getProps" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getProps failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getProps failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error101 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error102 error + error102, err = error101.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error102 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getProps failed: invalid message type") + return + } + result := GraphStorageServiceGetPropsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddVertices(req *AddVerticesRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddVertices(req); err != nil { return } + return p.recvAddVertices() +} + +func (p *GraphStorageServiceThreadsafeClient) sendAddVertices(req *AddVerticesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addVertices", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddVertices() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addVertices" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addVertices failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addVertices failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error103 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error104 error + error104, err = error103.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error104 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addVertices failed: invalid message type") + return + } + result := GraphStorageServiceAddVerticesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdges(req *AddEdgesRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddEdges(req); err != nil { return } + return p.recvAddEdges() +} + +func (p *GraphStorageServiceThreadsafeClient) sendAddEdges(req *AddEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdges() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error105 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error106 error + error106, err = error105.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error106 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addEdges failed: invalid message type") + return + } + result := GraphStorageServiceAddEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteEdges(req *DeleteEdgesRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDeleteEdges(req); err != nil { return } + return p.recvDeleteEdges() +} + +func (p *GraphStorageServiceThreadsafeClient) sendDeleteEdges(req *DeleteEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteEdges", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteEdges() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "deleteEdges" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "deleteEdges failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "deleteEdges failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error107 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error108 error + error108, err = error107.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error108 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "deleteEdges failed: invalid message type") + return + } + result := GraphStorageServiceDeleteEdgesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteVertices(req *DeleteVerticesRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDeleteVertices(req); err != nil { return } + return p.recvDeleteVertices() +} + +func (p *GraphStorageServiceThreadsafeClient) sendDeleteVertices(req *DeleteVerticesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("deleteVertices", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteVertices() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "deleteVertices" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "deleteVertices failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "deleteVertices failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error109 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error110 error + error110, err = error109.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error110 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "deleteVertices failed: invalid message type") + return + } + result := GraphStorageServiceDeleteVerticesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateVertex(req *UpdateVertexRequest) (r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendUpdateVertex(req); err != nil { return } + return p.recvUpdateVertex() +} + +func (p *GraphStorageServiceThreadsafeClient) sendUpdateVertex(req *UpdateVertexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateVertex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateVertex() (value *UpdateResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateVertex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateVertex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateVertex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error111 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error112 error + error112, err = error111.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error112 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateVertex failed: invalid message type") + return + } + result := GraphStorageServiceUpdateVertexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateEdge(req *UpdateEdgeRequest) (r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendUpdateEdge(req); err != nil { return } + return p.recvUpdateEdge() +} + +func (p *GraphStorageServiceThreadsafeClient) sendUpdateEdge(req *UpdateEdgeRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("updateEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateEdge() (value *UpdateResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "updateEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "updateEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "updateEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error113 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error114 error + error114, err = error113.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error114 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "updateEdge failed: invalid message type") + return + } + result := GraphStorageServiceUpdateEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (r *ScanVertexResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendScanVertex(req); err != nil { return } + return p.recvScanVertex() +} + +func (p *GraphStorageServiceThreadsafeClient) sendScanVertex(req *ScanVertexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scanVertex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVertexResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scanVertex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scanVertex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scanVertex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error115 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error116 error + error116, err = error115.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error116 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scanVertex failed: invalid message type") + return + } + result := GraphStorageServiceScanVertexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (r *ScanEdgeResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendScanEdge(req); err != nil { return } + return p.recvScanEdge() +} + +func (p *GraphStorageServiceThreadsafeClient) sendScanEdge(req *ScanEdgeRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("scanEdge", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "scanEdge" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "scanEdge failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "scanEdge failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error117 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error118 error + error118, err = error117.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error118 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scanEdge failed: invalid message type") + return + } + result := GraphStorageServiceScanEdgeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetUUID(req *GetUUIDReq) (r *GetUUIDResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetUUID(req); err != nil { return } + return p.recvGetUUID() +} + +func (p *GraphStorageServiceThreadsafeClient) sendGetUUID(req *GetUUIDReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getUUID", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetUUID() (value *GetUUIDResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getUUID" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getUUID failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getUUID failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error119 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error120 error + error120, err = error119.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error120 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getUUID failed: invalid message type") + return + } + result := GraphStorageServiceGetUUIDResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupIndex(req *LookupIndexRequest) (r *LookupIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendLookupIndex(req); err != nil { return } + return p.recvLookupIndex() +} + +func (p *GraphStorageServiceThreadsafeClient) sendLookupIndex(req *LookupIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lookupIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupIndex() (value *LookupIndexResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "lookupIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "lookupIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "lookupIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error121 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error122 error + error122, err = error121.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error122 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "lookupIndex failed: invalid message type") + return + } + result := GraphStorageServiceLookupIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupAndTraverse(req *LookupAndTraverseRequest) (r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendLookupAndTraverse(req); err != nil { return } + return p.recvLookupAndTraverse() +} + +func (p *GraphStorageServiceThreadsafeClient) sendLookupAndTraverse(req *LookupAndTraverseRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("lookupAndTraverse", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "lookupAndTraverse" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "lookupAndTraverse failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "lookupAndTraverse failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error123 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error124 error + error124, err = error123.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error124 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "lookupAndTraverse failed: invalid message type") + return + } + result := GraphStorageServiceLookupAndTraverseResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdgesAtomic(req *AddEdgesRequest) (r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddEdgesAtomic(req); err != nil { return } + return p.recvAddEdgesAtomic() +} + +func (p *GraphStorageServiceThreadsafeClient) sendAddEdgesAtomic(req *AddEdgesRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addEdgesAtomic", thrift.CALL, p.SeqId); err != nil { + return + } + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addEdgesAtomic" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addEdgesAtomic failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addEdgesAtomic failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error125 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error126 error + error126, err = error125.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error126 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addEdgesAtomic failed: invalid message type") + return + } + result := GraphStorageServiceAddEdgesAtomicResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type GraphStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunction + handler GraphStorageService +} + +func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *GraphStorageServiceProcessor) GetProcessorFunction(key string) (processor thrift.ProcessorFunction, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunction { + return p.processorMap +} + +func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { + self127 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunction)} + self127.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self127.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self127.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self127.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self127.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self127.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self127.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self127.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self127.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self127.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self127.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self127.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self127.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self127.processorMap["addEdgesAtomic"] = &graphStorageServiceProcessorAddEdgesAtomic{handler:handler} + return self127 +} + +type graphStorageServiceProcessorGetNeighbors struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetNeighbors) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetNeighborsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetNeighbors) 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("getNeighbors", 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 *graphStorageServiceProcessorGetNeighbors) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetNeighborsArgs) + var result GraphStorageServiceGetNeighborsResult + if retval, err := p.handler.GetNeighbors(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getNeighbors: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetProps struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetProps) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetPropsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetProps) 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("getProps", 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 *graphStorageServiceProcessorGetProps) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetPropsArgs) + var result GraphStorageServiceGetPropsResult + if retval, err := p.handler.GetProps(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProps: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddVertices) 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("addVertices", 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 *graphStorageServiceProcessorAddVertices) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddVerticesArgs) + var result GraphStorageServiceAddVerticesResult + if retval, err := p.handler.AddVertices(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdges) 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("addEdges", 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 *graphStorageServiceProcessorAddEdges) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesArgs) + var result GraphStorageServiceAddEdgesResult + if retval, err := p.handler.AddEdges(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteEdges) 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("deleteEdges", 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 *graphStorageServiceProcessorDeleteEdges) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteEdgesArgs) + var result GraphStorageServiceDeleteEdgesResult + if retval, err := p.handler.DeleteEdges(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteVertices) 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("deleteVertices", 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 *graphStorageServiceProcessorDeleteVertices) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteVerticesArgs) + var result GraphStorageServiceDeleteVerticesResult + if retval, err := p.handler.DeleteVertices(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateVertex) 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("updateVertex", 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 *graphStorageServiceProcessorUpdateVertex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateVertexArgs) + var result GraphStorageServiceUpdateVertexResult + if retval, err := p.handler.UpdateVertex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateEdge) 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("updateEdge", 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 *graphStorageServiceProcessorUpdateEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateEdgeArgs) + var result GraphStorageServiceUpdateEdgeResult + if retval, err := p.handler.UpdateEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanVertex) 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("scanVertex", 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 *graphStorageServiceProcessorScanVertex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanVertexArgs) + var result GraphStorageServiceScanVertexResult + if retval, err := p.handler.ScanVertex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanEdge) 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("scanEdge", 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 *graphStorageServiceProcessorScanEdge) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanEdgeArgs) + var result GraphStorageServiceScanEdgeResult + if retval, err := p.handler.ScanEdge(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetUUID struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetUUID) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetUUIDArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetUUID) 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("getUUID", 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 *graphStorageServiceProcessorGetUUID) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetUUIDArgs) + var result GraphStorageServiceGetUUIDResult + if retval, err := p.handler.GetUUID(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUUID: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupIndex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupIndex) 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("lookupIndex", 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 *graphStorageServiceProcessorLookupIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupIndexArgs) + var result GraphStorageServiceLookupIndexResult + if retval, err := p.handler.LookupIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupAndTraverse struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupAndTraverseArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) 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("lookupAndTraverse", 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 *graphStorageServiceProcessorLookupAndTraverse) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupAndTraverseArgs) + var result GraphStorageServiceLookupAndTraverseResult + if retval, err := p.handler.LookupAndTraverse(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupAndTraverse: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdgesAtomic struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesAtomicArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) 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("addEdgesAtomic", 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 *graphStorageServiceProcessorAddEdgesAtomic) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesAtomicArgs) + var result GraphStorageServiceAddEdgesAtomicResult + if retval, err := p.handler.AddEdgesAtomic(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdgesAtomic: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GraphStorageServiceGetNeighborsArgs struct { + Req *GetNeighborsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetNeighborsArgs() *GraphStorageServiceGetNeighborsArgs { + return &GraphStorageServiceGetNeighborsArgs{} +} + +var GraphStorageServiceGetNeighborsArgs_Req_DEFAULT *GetNeighborsRequest +func (p *GraphStorageServiceGetNeighborsArgs) GetReq() *GetNeighborsRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetNeighborsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetNeighborsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetNeighborsRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceGetNeighborsResult struct { + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetNeighborsResult() *GraphStorageServiceGetNeighborsResult { + return &GraphStorageServiceGetNeighborsResult{} +} + +var GraphStorageServiceGetNeighborsResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceGetNeighborsResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetNeighborsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetNeighborsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceGetPropsArgs struct { + Req *GetPropRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetPropsArgs() *GraphStorageServiceGetPropsArgs { + return &GraphStorageServiceGetPropsArgs{} +} + +var GraphStorageServiceGetPropsArgs_Req_DEFAULT *GetPropRequest +func (p *GraphStorageServiceGetPropsArgs) GetReq() *GetPropRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetPropsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetPropsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPropRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetPropsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceGetPropsResult struct { + Success *GetPropResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetPropsResult() *GraphStorageServiceGetPropsResult { + return &GraphStorageServiceGetPropsResult{} +} + +var GraphStorageServiceGetPropsResult_Success_DEFAULT *GetPropResponse +func (p *GraphStorageServiceGetPropsResult) GetSuccess() *GetPropResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetPropsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetPropsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPropResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetPropsResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceAddVerticesArgs struct { + Req *AddVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddVerticesArgs() *GraphStorageServiceAddVerticesArgs { + return &GraphStorageServiceAddVerticesArgs{} +} + +var GraphStorageServiceAddVerticesArgs_Req_DEFAULT *AddVerticesRequest +func (p *GraphStorageServiceAddVerticesArgs) GetReq() *AddVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddVerticesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddVerticesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceAddVerticesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddVerticesResult() *GraphStorageServiceAddVerticesResult { + return &GraphStorageServiceAddVerticesResult{} +} + +var GraphStorageServiceAddVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddVerticesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddVerticesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesArgs struct { + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesArgs() *GraphStorageServiceAddEdgesArgs { + return &GraphStorageServiceAddEdgesArgs{} +} + +var GraphStorageServiceAddEdgesArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesResult() *GraphStorageServiceAddEdgesResult { + return &GraphStorageServiceAddEdgesResult{} +} + +var GraphStorageServiceAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteEdgesArgs struct { + Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteEdgesArgs() *GraphStorageServiceDeleteEdgesArgs { + return &GraphStorageServiceDeleteEdgesArgs{} +} + +var GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest +func (p *GraphStorageServiceDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteEdgesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteEdgesResult() *GraphStorageServiceDeleteEdgesResult { + return &GraphStorageServiceDeleteEdgesResult{} +} + +var GraphStorageServiceDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteVerticesArgs struct { + Req *DeleteVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteVerticesArgs() *GraphStorageServiceDeleteVerticesArgs { + return &GraphStorageServiceDeleteVerticesArgs{} +} + +var GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT *DeleteVerticesRequest +func (p *GraphStorageServiceDeleteVerticesArgs) GetReq() *DeleteVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteVerticesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteVerticesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteVerticesResult() *GraphStorageServiceDeleteVerticesResult { + return &GraphStorageServiceDeleteVerticesResult{} +} + +var GraphStorageServiceDeleteVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteVerticesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateVertexArgs struct { + Req *UpdateVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateVertexArgs() *GraphStorageServiceUpdateVertexArgs { + return &GraphStorageServiceUpdateVertexArgs{} +} + +var GraphStorageServiceUpdateVertexArgs_Req_DEFAULT *UpdateVertexRequest +func (p *GraphStorageServiceUpdateVertexArgs) GetReq() *UpdateVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateVertexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateVertexResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateVertexResult() *GraphStorageServiceUpdateVertexResult { + return &GraphStorageServiceUpdateVertexResult{} +} + +var GraphStorageServiceUpdateVertexResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateVertexResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateVertexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateEdgeArgs struct { + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateEdgeArgs() *GraphStorageServiceUpdateEdgeArgs { + return &GraphStorageServiceUpdateEdgeArgs{} +} + +var GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT *UpdateEdgeRequest +func (p *GraphStorageServiceUpdateEdgeArgs) GetReq() *UpdateEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateEdgeResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateEdgeResult() *GraphStorageServiceUpdateEdgeResult { + return &GraphStorageServiceUpdateEdgeResult{} +} + +var GraphStorageServiceUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceScanVertexArgs struct { + Req *ScanVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanVertexArgs() *GraphStorageServiceScanVertexArgs { + return &GraphStorageServiceScanVertexArgs{} +} + +var GraphStorageServiceScanVertexArgs_Req_DEFAULT *ScanVertexRequest +func (p *GraphStorageServiceScanVertexArgs) GetReq() *ScanVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanVertexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceScanVertexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceScanVertexResult struct { + Success *ScanVertexResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { + return &GraphStorageServiceScanVertexResult{} +} + +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanVertexResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanVertexResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanVertexResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceScanVertexResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceScanEdgeArgs struct { + Req *ScanEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanEdgeArgs() *GraphStorageServiceScanEdgeArgs { + return &GraphStorageServiceScanEdgeArgs{} +} + +var GraphStorageServiceScanEdgeArgs_Req_DEFAULT *ScanEdgeRequest +func (p *GraphStorageServiceScanEdgeArgs) GetReq() *ScanEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceScanEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceScanEdgeResult struct { + Success *ScanEdgeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { + return &GraphStorageServiceScanEdgeResult{} +} + +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanEdgeResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanEdgeResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanEdgeResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceScanEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceGetUUIDArgs struct { + Req *GetUUIDReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetUUIDArgs() *GraphStorageServiceGetUUIDArgs { + return &GraphStorageServiceGetUUIDArgs{} +} + +var GraphStorageServiceGetUUIDArgs_Req_DEFAULT *GetUUIDReq +func (p *GraphStorageServiceGetUUIDArgs) GetReq() *GetUUIDReq { + if !p.IsSetReq() { + return GraphStorageServiceGetUUIDArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetUUIDArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUUIDReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetUUIDArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceGetUUIDResult struct { + Success *GetUUIDResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetUUIDResult() *GraphStorageServiceGetUUIDResult { + return &GraphStorageServiceGetUUIDResult{} +} + +var GraphStorageServiceGetUUIDResult_Success_DEFAULT *GetUUIDResp +func (p *GraphStorageServiceGetUUIDResult) GetSuccess() *GetUUIDResp { + if !p.IsSetSuccess() { + return GraphStorageServiceGetUUIDResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetUUIDResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetUUIDResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetUUIDResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupIndexArgs struct { + Req *LookupIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupIndexArgs() *GraphStorageServiceLookupIndexArgs { + return &GraphStorageServiceLookupIndexArgs{} +} + +var GraphStorageServiceLookupIndexArgs_Req_DEFAULT *LookupIndexRequest +func (p *GraphStorageServiceLookupIndexArgs) GetReq() *LookupIndexRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceLookupIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupIndexResult struct { + Success *LookupIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupIndexResult() *GraphStorageServiceLookupIndexResult { + return &GraphStorageServiceLookupIndexResult{} +} + +var GraphStorageServiceLookupIndexResult_Success_DEFAULT *LookupIndexResp +func (p *GraphStorageServiceLookupIndexResult) GetSuccess() *LookupIndexResp { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewLookupIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceLookupIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupAndTraverseArgs struct { + Req *LookupAndTraverseRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupAndTraverseArgs() *GraphStorageServiceLookupAndTraverseArgs { + return &GraphStorageServiceLookupAndTraverseArgs{} +} + +var GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT *LookupAndTraverseRequest +func (p *GraphStorageServiceLookupAndTraverseArgs) GetReq() *LookupAndTraverseRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupAndTraverseArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupAndTraverseRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupAndTraverseResult struct { + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupAndTraverseResult() *GraphStorageServiceLookupAndTraverseResult { + return &GraphStorageServiceLookupAndTraverseResult{} +} + +var GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceLookupAndTraverseResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupAndTraverseResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesAtomicArgs struct { + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesAtomicArgs() *GraphStorageServiceAddEdgesAtomicArgs { + return &GraphStorageServiceAddEdgesAtomicArgs{} +} + +var GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesAtomicArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesAtomicArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesAtomicResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesAtomicResult() *GraphStorageServiceAddEdgesAtomicResult { + return &GraphStorageServiceAddEdgesAtomicResult{} +} + +var GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesAtomicResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesAtomicResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicResult(%+v)", *p) +} + + diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/storage_admin_service-remote/storage_admin_service-remote.go b/ccore/nebula/internal/thrift/v2_0_0/storage/storage_admin_service-remote/storage_admin_service-remote.go new file mode 100755 index 0000000..dbf4bfb --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -0,0 +1,514 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AdminExecResp transLeader(TransLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addPart(AddPartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addLearner(AddLearnerReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp removePart(RemovePartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp memberChange(MemberChangeReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp waitingForCatchUpData(CatchUpDataReq req)") + fmt.Fprintln(os.Stderr, " CreateCPResp createCheckpoint(CreateCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp dropCheckpoint(DropCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp blockingWrites(BlockingSignRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildTagIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildEdgeIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetLeaderPartsResp getLeaderParts(GetLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp checkPeers(CheckPeersReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addAdminTask(AddAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp stopAdminTask(StopAdminTaskRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewStorageAdminServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "transLeader": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") + flag.Usage() + } + arg275 := flag.Arg(1) + mbTrans276 := thrift.NewMemoryBufferLen(len(arg275)) + defer mbTrans276.Close() + _, err277 := mbTrans276.WriteString(arg275) + if err277 != nil { + Usage() + return + } + factory278 := thrift.NewSimpleJSONProtocolFactory() + jsProt279 := factory278.GetProtocol(mbTrans276) + argvalue0 := storage.NewTransLeaderReq() + err280 := argvalue0.Read(jsProt279) + if err280 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TransLeader(value0)) + fmt.Print("\n") + break + case "addPart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddPart requires 1 args") + flag.Usage() + } + arg281 := flag.Arg(1) + mbTrans282 := thrift.NewMemoryBufferLen(len(arg281)) + defer mbTrans282.Close() + _, err283 := mbTrans282.WriteString(arg281) + if err283 != nil { + Usage() + return + } + factory284 := thrift.NewSimpleJSONProtocolFactory() + jsProt285 := factory284.GetProtocol(mbTrans282) + argvalue0 := storage.NewAddPartReq() + err286 := argvalue0.Read(jsProt285) + if err286 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddPart(value0)) + fmt.Print("\n") + break + case "addLearner": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") + flag.Usage() + } + arg287 := flag.Arg(1) + mbTrans288 := thrift.NewMemoryBufferLen(len(arg287)) + defer mbTrans288.Close() + _, err289 := mbTrans288.WriteString(arg287) + if err289 != nil { + Usage() + return + } + factory290 := thrift.NewSimpleJSONProtocolFactory() + jsProt291 := factory290.GetProtocol(mbTrans288) + argvalue0 := storage.NewAddLearnerReq() + err292 := argvalue0.Read(jsProt291) + if err292 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddLearner(value0)) + fmt.Print("\n") + break + case "removePart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") + flag.Usage() + } + arg293 := flag.Arg(1) + mbTrans294 := thrift.NewMemoryBufferLen(len(arg293)) + defer mbTrans294.Close() + _, err295 := mbTrans294.WriteString(arg293) + if err295 != nil { + Usage() + return + } + factory296 := thrift.NewSimpleJSONProtocolFactory() + jsProt297 := factory296.GetProtocol(mbTrans294) + argvalue0 := storage.NewRemovePartReq() + err298 := argvalue0.Read(jsProt297) + if err298 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemovePart(value0)) + fmt.Print("\n") + break + case "memberChange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") + flag.Usage() + } + arg299 := flag.Arg(1) + mbTrans300 := thrift.NewMemoryBufferLen(len(arg299)) + defer mbTrans300.Close() + _, err301 := mbTrans300.WriteString(arg299) + if err301 != nil { + Usage() + return + } + factory302 := thrift.NewSimpleJSONProtocolFactory() + jsProt303 := factory302.GetProtocol(mbTrans300) + argvalue0 := storage.NewMemberChangeReq() + err304 := argvalue0.Read(jsProt303) + if err304 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MemberChange(value0)) + fmt.Print("\n") + break + case "waitingForCatchUpData": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") + flag.Usage() + } + arg305 := flag.Arg(1) + mbTrans306 := thrift.NewMemoryBufferLen(len(arg305)) + defer mbTrans306.Close() + _, err307 := mbTrans306.WriteString(arg305) + if err307 != nil { + Usage() + return + } + factory308 := thrift.NewSimpleJSONProtocolFactory() + jsProt309 := factory308.GetProtocol(mbTrans306) + argvalue0 := storage.NewCatchUpDataReq() + err310 := argvalue0.Read(jsProt309) + if err310 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.WaitingForCatchUpData(value0)) + fmt.Print("\n") + break + case "createCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") + flag.Usage() + } + arg311 := flag.Arg(1) + mbTrans312 := thrift.NewMemoryBufferLen(len(arg311)) + defer mbTrans312.Close() + _, err313 := mbTrans312.WriteString(arg311) + if err313 != nil { + Usage() + return + } + factory314 := thrift.NewSimpleJSONProtocolFactory() + jsProt315 := factory314.GetProtocol(mbTrans312) + argvalue0 := storage.NewCreateCPRequest() + err316 := argvalue0.Read(jsProt315) + if err316 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateCheckpoint(value0)) + fmt.Print("\n") + break + case "dropCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") + flag.Usage() + } + arg317 := flag.Arg(1) + mbTrans318 := thrift.NewMemoryBufferLen(len(arg317)) + defer mbTrans318.Close() + _, err319 := mbTrans318.WriteString(arg317) + if err319 != nil { + Usage() + return + } + factory320 := thrift.NewSimpleJSONProtocolFactory() + jsProt321 := factory320.GetProtocol(mbTrans318) + argvalue0 := storage.NewDropCPRequest() + err322 := argvalue0.Read(jsProt321) + if err322 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropCheckpoint(value0)) + fmt.Print("\n") + break + case "blockingWrites": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") + flag.Usage() + } + arg323 := flag.Arg(1) + mbTrans324 := thrift.NewMemoryBufferLen(len(arg323)) + defer mbTrans324.Close() + _, err325 := mbTrans324.WriteString(arg323) + if err325 != nil { + Usage() + return + } + factory326 := thrift.NewSimpleJSONProtocolFactory() + jsProt327 := factory326.GetProtocol(mbTrans324) + argvalue0 := storage.NewBlockingSignRequest() + err328 := argvalue0.Read(jsProt327) + if err328 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BlockingWrites(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg329 := flag.Arg(1) + mbTrans330 := thrift.NewMemoryBufferLen(len(arg329)) + defer mbTrans330.Close() + _, err331 := mbTrans330.WriteString(arg329) + if err331 != nil { + Usage() + return + } + factory332 := thrift.NewSimpleJSONProtocolFactory() + jsProt333 := factory332.GetProtocol(mbTrans330) + argvalue0 := storage.NewRebuildIndexRequest() + err334 := argvalue0.Read(jsProt333) + if err334 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg335 := flag.Arg(1) + mbTrans336 := thrift.NewMemoryBufferLen(len(arg335)) + defer mbTrans336.Close() + _, err337 := mbTrans336.WriteString(arg335) + if err337 != nil { + Usage() + return + } + factory338 := thrift.NewSimpleJSONProtocolFactory() + jsProt339 := factory338.GetProtocol(mbTrans336) + argvalue0 := storage.NewRebuildIndexRequest() + err340 := argvalue0.Read(jsProt339) + if err340 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "getLeaderParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") + flag.Usage() + } + arg341 := flag.Arg(1) + mbTrans342 := thrift.NewMemoryBufferLen(len(arg341)) + defer mbTrans342.Close() + _, err343 := mbTrans342.WriteString(arg341) + if err343 != nil { + Usage() + return + } + factory344 := thrift.NewSimpleJSONProtocolFactory() + jsProt345 := factory344.GetProtocol(mbTrans342) + argvalue0 := storage.NewGetLeaderReq() + err346 := argvalue0.Read(jsProt345) + if err346 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetLeaderParts(value0)) + fmt.Print("\n") + break + case "checkPeers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") + flag.Usage() + } + arg347 := flag.Arg(1) + mbTrans348 := thrift.NewMemoryBufferLen(len(arg347)) + defer mbTrans348.Close() + _, err349 := mbTrans348.WriteString(arg347) + if err349 != nil { + Usage() + return + } + factory350 := thrift.NewSimpleJSONProtocolFactory() + jsProt351 := factory350.GetProtocol(mbTrans348) + argvalue0 := storage.NewCheckPeersReq() + err352 := argvalue0.Read(jsProt351) + if err352 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckPeers(value0)) + fmt.Print("\n") + break + case "addAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") + flag.Usage() + } + arg353 := flag.Arg(1) + mbTrans354 := thrift.NewMemoryBufferLen(len(arg353)) + defer mbTrans354.Close() + _, err355 := mbTrans354.WriteString(arg353) + if err355 != nil { + Usage() + return + } + factory356 := thrift.NewSimpleJSONProtocolFactory() + jsProt357 := factory356.GetProtocol(mbTrans354) + argvalue0 := storage.NewAddAdminTaskRequest() + err358 := argvalue0.Read(jsProt357) + if err358 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddAdminTask(value0)) + fmt.Print("\n") + break + case "stopAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") + flag.Usage() + } + arg359 := flag.Arg(1) + mbTrans360 := thrift.NewMemoryBufferLen(len(arg359)) + defer mbTrans360.Close() + _, err361 := mbTrans360.WriteString(arg359) + if err361 != nil { + Usage() + return + } + factory362 := thrift.NewSimpleJSONProtocolFactory() + jsProt363 := factory362.GetProtocol(mbTrans360) + argvalue0 := storage.NewStopAdminTaskRequest() + err364 := argvalue0.Read(jsProt363) + if err364 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.StopAdminTask(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/storageadminservice.go b/ccore/nebula/internal/thrift/v2_0_0/storage/storageadminservice.go new file mode 100644 index 0000000..9d657fa --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/storageadminservice.go @@ -0,0 +1,5967 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type StorageAdminService interface { + // Parameters: + // - Req + TransLeader(req *TransLeaderReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(req *AddPartReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(req *AddLearnerReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(req *RemovePartReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(req *MemberChangeReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(req *CatchUpDataReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(req *CreateCPRequest) (r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(req *DropCPRequest) (r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(req *BlockingSignRequest) (r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(req *GetLeaderReq) (r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(req *CheckPeersReq) (r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(req *AddAdminTaskRequest) (r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(req *StopAdminTaskRequest) (r *AdminExecResp, err error) +} + +type StorageAdminServiceClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 +} + +func (client *StorageAdminServiceClient) Close() error { + return client.Transport.Close() +} + +func NewStorageAdminServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceClient { + return &StorageAdminServiceClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewStorageAdminServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceClient { + return &StorageAdminServiceClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) TransLeader(req *TransLeaderReq) (r *AdminExecResp, err error) { + if err = p.sendTransLeader(req); err != nil { return } + return p.recvTransLeader() +} + +func (p *StorageAdminServiceClient) sendTransLeader(req *TransLeaderReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("transLeader", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvTransLeader() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "transLeader" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "transLeader failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "transLeader failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error213 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error214 error + error214, err = error213.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error214 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "transLeader failed: invalid message type") + return + } + result := StorageAdminServiceTransLeaderResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddPart(req *AddPartReq) (r *AdminExecResp, err error) { + if err = p.sendAddPart(req); err != nil { return } + return p.recvAddPart() +} + +func (p *StorageAdminServiceClient) sendAddPart(req *AddPartReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addPart", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvAddPart() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addPart" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addPart failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addPart failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error215 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error216 error + error216, err = error215.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error216 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addPart failed: invalid message type") + return + } + result := StorageAdminServiceAddPartResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddLearner(req *AddLearnerReq) (r *AdminExecResp, err error) { + if err = p.sendAddLearner(req); err != nil { return } + return p.recvAddLearner() +} + +func (p *StorageAdminServiceClient) sendAddLearner(req *AddLearnerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addLearner", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvAddLearner() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addLearner" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addLearner failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addLearner failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error217 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error218 error + error218, err = error217.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error218 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addLearner failed: invalid message type") + return + } + result := StorageAdminServiceAddLearnerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RemovePart(req *RemovePartReq) (r *AdminExecResp, err error) { + if err = p.sendRemovePart(req); err != nil { return } + return p.recvRemovePart() +} + +func (p *StorageAdminServiceClient) sendRemovePart(req *RemovePartReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removePart", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvRemovePart() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removePart" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removePart failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removePart failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error219 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error220 error + error220, err = error219.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error220 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removePart failed: invalid message type") + return + } + result := StorageAdminServiceRemovePartResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) MemberChange(req *MemberChangeReq) (r *AdminExecResp, err error) { + if err = p.sendMemberChange(req); err != nil { return } + return p.recvMemberChange() +} + +func (p *StorageAdminServiceClient) sendMemberChange(req *MemberChangeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("memberChange", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvMemberChange() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "memberChange" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "memberChange failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "memberChange failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error221 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error222 error + error222, err = error221.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error222 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "memberChange failed: invalid message type") + return + } + result := StorageAdminServiceMemberChangeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) WaitingForCatchUpData(req *CatchUpDataReq) (r *AdminExecResp, err error) { + if err = p.sendWaitingForCatchUpData(req); err != nil { return } + return p.recvWaitingForCatchUpData() +} + +func (p *StorageAdminServiceClient) sendWaitingForCatchUpData(req *CatchUpDataReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("waitingForCatchUpData", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "waitingForCatchUpData" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "waitingForCatchUpData failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "waitingForCatchUpData failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error223 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error224 error + error224, err = error223.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error224 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "waitingForCatchUpData failed: invalid message type") + return + } + result := StorageAdminServiceWaitingForCatchUpDataResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CreateCheckpoint(req *CreateCPRequest) (r *CreateCPResp, err error) { + if err = p.sendCreateCheckpoint(req); err != nil { return } + return p.recvCreateCheckpoint() +} + +func (p *StorageAdminServiceClient) sendCreateCheckpoint(req *CreateCPRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createCheckpoint", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createCheckpoint" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createCheckpoint failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createCheckpoint failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error225 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error226 error + error226, err = error225.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error226 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createCheckpoint failed: invalid message type") + return + } + result := StorageAdminServiceCreateCheckpointResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) DropCheckpoint(req *DropCPRequest) (r *AdminExecResp, err error) { + if err = p.sendDropCheckpoint(req); err != nil { return } + return p.recvDropCheckpoint() +} + +func (p *StorageAdminServiceClient) sendDropCheckpoint(req *DropCPRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropCheckpoint", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropCheckpoint" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropCheckpoint failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropCheckpoint failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error227 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error228 error + error228, err = error227.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error228 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropCheckpoint failed: invalid message type") + return + } + result := StorageAdminServiceDropCheckpointResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) BlockingWrites(req *BlockingSignRequest) (r *AdminExecResp, err error) { + if err = p.sendBlockingWrites(req); err != nil { return } + return p.recvBlockingWrites() +} + +func (p *StorageAdminServiceClient) sendBlockingWrites(req *BlockingSignRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("blockingWrites", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvBlockingWrites() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "blockingWrites" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "blockingWrites failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "blockingWrites failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error229 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error230 error + error230, err = error229.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error230 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "blockingWrites failed: invalid message type") + return + } + result := StorageAdminServiceBlockingWritesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildTagIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) { + if err = p.sendRebuildTagIndex(req); err != nil { return } + return p.recvRebuildTagIndex() +} + +func (p *StorageAdminServiceClient) sendRebuildTagIndex(req *RebuildIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error231 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error232 error + error232, err = error231.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error232 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildTagIndex failed: invalid message type") + return + } + result := StorageAdminServiceRebuildTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildEdgeIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) { + if err = p.sendRebuildEdgeIndex(req); err != nil { return } + return p.recvRebuildEdgeIndex() +} + +func (p *StorageAdminServiceClient) sendRebuildEdgeIndex(req *RebuildIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error233 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error234 error + error234, err = error233.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error234 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildEdgeIndex failed: invalid message type") + return + } + result := StorageAdminServiceRebuildEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) GetLeaderParts(req *GetLeaderReq) (r *GetLeaderPartsResp, err error) { + if err = p.sendGetLeaderParts(req); err != nil { return } + return p.recvGetLeaderParts() +} + +func (p *StorageAdminServiceClient) sendGetLeaderParts(req *GetLeaderReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getLeaderParts", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getLeaderParts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getLeaderParts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getLeaderParts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error235 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error236 error + error236, err = error235.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error236 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getLeaderParts failed: invalid message type") + return + } + result := StorageAdminServiceGetLeaderPartsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CheckPeers(req *CheckPeersReq) (r *AdminExecResp, err error) { + if err = p.sendCheckPeers(req); err != nil { return } + return p.recvCheckPeers() +} + +func (p *StorageAdminServiceClient) sendCheckPeers(req *CheckPeersReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("checkPeers", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvCheckPeers() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "checkPeers" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "checkPeers failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "checkPeers failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error237 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error238 error + error238, err = error237.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error238 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "checkPeers failed: invalid message type") + return + } + result := StorageAdminServiceCheckPeersResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddAdminTask(req *AddAdminTaskRequest) (r *AdminExecResp, err error) { + if err = p.sendAddAdminTask(req); err != nil { return } + return p.recvAddAdminTask() +} + +func (p *StorageAdminServiceClient) sendAddAdminTask(req *AddAdminTaskRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addAdminTask", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvAddAdminTask() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addAdminTask" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addAdminTask failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addAdminTask failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error239 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error240 error + error240, err = error239.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error240 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addAdminTask failed: invalid message type") + return + } + result := StorageAdminServiceAddAdminTaskResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) StopAdminTask(req *StopAdminTaskRequest) (r *AdminExecResp, err error) { + if err = p.sendStopAdminTask(req); err != nil { return } + return p.recvStopAdminTask() +} + +func (p *StorageAdminServiceClient) sendStopAdminTask(req *StopAdminTaskRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("stopAdminTask", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceClient) recvStopAdminTask() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "stopAdminTask" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "stopAdminTask failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "stopAdminTask failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error241 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error242 error + error242, err = error241.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error242 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "stopAdminTask failed: invalid message type") + return + } + result := StorageAdminServiceStopAdminTaskResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type StorageAdminServiceThreadsafeClient struct { + Transport thrift.Transport + ProtocolFactory thrift.ProtocolFactory + InputProtocol thrift.Protocol + OutputProtocol thrift.Protocol + SeqId int32 + Mu sync.Mutex +} + +func NewStorageAdminServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{Transport: t, + ProtocolFactory: f, + InputProtocol: f.GetProtocol(t), + OutputProtocol: f.GetProtocol(t), + SeqId: 0, + } +} + +func NewStorageAdminServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{Transport: t, + ProtocolFactory: nil, + InputProtocol: iprot, + OutputProtocol: oprot, + SeqId: 0, + } +} + +func (p *StorageAdminServiceThreadsafeClient) Threadsafe() {} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) TransLeader(req *TransLeaderReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendTransLeader(req); err != nil { return } + return p.recvTransLeader() +} + +func (p *StorageAdminServiceThreadsafeClient) sendTransLeader(req *TransLeaderReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("transLeader", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvTransLeader() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "transLeader" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "transLeader failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "transLeader failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error243 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error244 error + error244, err = error243.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error244 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "transLeader failed: invalid message type") + return + } + result := StorageAdminServiceTransLeaderResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddPart(req *AddPartReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddPart(req); err != nil { return } + return p.recvAddPart() +} + +func (p *StorageAdminServiceThreadsafeClient) sendAddPart(req *AddPartReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addPart", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddPart() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addPart" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addPart failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addPart failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error245 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error246 error + error246, err = error245.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error246 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addPart failed: invalid message type") + return + } + result := StorageAdminServiceAddPartResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddLearner(req *AddLearnerReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddLearner(req); err != nil { return } + return p.recvAddLearner() +} + +func (p *StorageAdminServiceThreadsafeClient) sendAddLearner(req *AddLearnerReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addLearner", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddLearner() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addLearner" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addLearner failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addLearner failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error247 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error248 error + error248, err = error247.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error248 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addLearner failed: invalid message type") + return + } + result := StorageAdminServiceAddLearnerResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RemovePart(req *RemovePartReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRemovePart(req); err != nil { return } + return p.recvRemovePart() +} + +func (p *StorageAdminServiceThreadsafeClient) sendRemovePart(req *RemovePartReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("removePart", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRemovePart() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "removePart" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "removePart failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "removePart failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error249 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error250 error + error250, err = error249.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error250 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "removePart failed: invalid message type") + return + } + result := StorageAdminServiceRemovePartResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) MemberChange(req *MemberChangeReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendMemberChange(req); err != nil { return } + return p.recvMemberChange() +} + +func (p *StorageAdminServiceThreadsafeClient) sendMemberChange(req *MemberChangeReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("memberChange", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvMemberChange() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "memberChange" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "memberChange failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "memberChange failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error251 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error252 error + error252, err = error251.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error252 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "memberChange failed: invalid message type") + return + } + result := StorageAdminServiceMemberChangeResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) WaitingForCatchUpData(req *CatchUpDataReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendWaitingForCatchUpData(req); err != nil { return } + return p.recvWaitingForCatchUpData() +} + +func (p *StorageAdminServiceThreadsafeClient) sendWaitingForCatchUpData(req *CatchUpDataReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("waitingForCatchUpData", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "waitingForCatchUpData" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "waitingForCatchUpData failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "waitingForCatchUpData failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error253 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error254 error + error254, err = error253.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error254 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "waitingForCatchUpData failed: invalid message type") + return + } + result := StorageAdminServiceWaitingForCatchUpDataResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CreateCheckpoint(req *CreateCPRequest) (r *CreateCPResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCreateCheckpoint(req); err != nil { return } + return p.recvCreateCheckpoint() +} + +func (p *StorageAdminServiceThreadsafeClient) sendCreateCheckpoint(req *CreateCPRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("createCheckpoint", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "createCheckpoint" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "createCheckpoint failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "createCheckpoint failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error255 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error256 error + error256, err = error255.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error256 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createCheckpoint failed: invalid message type") + return + } + result := StorageAdminServiceCreateCheckpointResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) DropCheckpoint(req *DropCPRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendDropCheckpoint(req); err != nil { return } + return p.recvDropCheckpoint() +} + +func (p *StorageAdminServiceThreadsafeClient) sendDropCheckpoint(req *DropCPRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("dropCheckpoint", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "dropCheckpoint" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "dropCheckpoint failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "dropCheckpoint failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error257 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error258 error + error258, err = error257.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error258 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "dropCheckpoint failed: invalid message type") + return + } + result := StorageAdminServiceDropCheckpointResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) BlockingWrites(req *BlockingSignRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendBlockingWrites(req); err != nil { return } + return p.recvBlockingWrites() +} + +func (p *StorageAdminServiceThreadsafeClient) sendBlockingWrites(req *BlockingSignRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("blockingWrites", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvBlockingWrites() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "blockingWrites" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "blockingWrites failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "blockingWrites failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error259 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error260 error + error260, err = error259.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error260 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "blockingWrites failed: invalid message type") + return + } + result := StorageAdminServiceBlockingWritesResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRebuildTagIndex(req); err != nil { return } + return p.recvRebuildTagIndex() +} + +func (p *StorageAdminServiceThreadsafeClient) sendRebuildTagIndex(req *RebuildIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildTagIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildTagIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildTagIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildTagIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error261 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error262 error + error262, err = error261.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error262 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildTagIndex failed: invalid message type") + return + } + result := StorageAdminServiceRebuildTagIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendRebuildEdgeIndex(req); err != nil { return } + return p.recvRebuildEdgeIndex() +} + +func (p *StorageAdminServiceThreadsafeClient) sendRebuildEdgeIndex(req *RebuildIndexRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("rebuildEdgeIndex", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "rebuildEdgeIndex" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "rebuildEdgeIndex failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "rebuildEdgeIndex failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error263 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error264 error + error264, err = error263.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error264 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rebuildEdgeIndex failed: invalid message type") + return + } + result := StorageAdminServiceRebuildEdgeIndexResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) GetLeaderParts(req *GetLeaderReq) (r *GetLeaderPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendGetLeaderParts(req); err != nil { return } + return p.recvGetLeaderParts() +} + +func (p *StorageAdminServiceThreadsafeClient) sendGetLeaderParts(req *GetLeaderReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("getLeaderParts", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "getLeaderParts" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "getLeaderParts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "getLeaderParts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error265 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error266 error + error266, err = error265.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error266 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getLeaderParts failed: invalid message type") + return + } + result := StorageAdminServiceGetLeaderPartsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CheckPeers(req *CheckPeersReq) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendCheckPeers(req); err != nil { return } + return p.recvCheckPeers() +} + +func (p *StorageAdminServiceThreadsafeClient) sendCheckPeers(req *CheckPeersReq)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("checkPeers", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCheckPeers() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "checkPeers" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "checkPeers failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "checkPeers failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error267 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error268 error + error268, err = error267.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error268 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "checkPeers failed: invalid message type") + return + } + result := StorageAdminServiceCheckPeersResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddAdminTask(req *AddAdminTaskRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendAddAdminTask(req); err != nil { return } + return p.recvAddAdminTask() +} + +func (p *StorageAdminServiceThreadsafeClient) sendAddAdminTask(req *AddAdminTaskRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("addAdminTask", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddAdminTask() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "addAdminTask" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "addAdminTask failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "addAdminTask failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error269 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error270 error + error270, err = error269.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error270 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addAdminTask failed: invalid message type") + return + } + result := StorageAdminServiceAddAdminTaskResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) StopAdminTask(req *StopAdminTaskRequest) (r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + if err = p.sendStopAdminTask(req); err != nil { return } + return p.recvStopAdminTask() +} + +func (p *StorageAdminServiceThreadsafeClient) sendStopAdminTask(req *StopAdminTaskRequest)(err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("stopAdminTask", thrift.CALL, p.SeqId); err != nil { + return + } + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvStopAdminTask() (value *AdminExecResp, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "stopAdminTask" { + err = thrift.NewApplicationException(thrift.WRONG_METHOD_NAME, "stopAdminTask failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewApplicationException(thrift.BAD_SEQUENCE_ID, "stopAdminTask failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error271 := thrift.NewApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error272 error + error272, err = error271.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error272 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "stopAdminTask failed: invalid message type") + return + } + result := StorageAdminServiceStopAdminTaskResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + + +type StorageAdminServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunction + handler StorageAdminService +} + +func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *StorageAdminServiceProcessor) GetProcessorFunction(key string) (processor thrift.ProcessorFunction, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunction { + return p.processorMap +} + +func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { + self273 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunction)} + self273.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self273.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self273.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self273.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self273.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self273.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self273.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self273.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self273.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self273.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} + self273.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} + self273.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self273.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self273.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self273.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + return self273 +} + +type storageAdminServiceProcessorTransLeader struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorTransLeader) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceTransLeaderArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorTransLeader) 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("transLeader", 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 *storageAdminServiceProcessorTransLeader) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceTransLeaderArgs) + var result StorageAdminServiceTransLeaderResult + if retval, err := p.handler.TransLeader(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transLeader: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddPart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddPart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddPartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddPart) 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("addPart", 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 *storageAdminServiceProcessorAddPart) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddPartArgs) + var result StorageAdminServiceAddPartResult + if retval, err := p.handler.AddPart(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addPart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddLearner struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddLearner) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddLearnerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddLearner) 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("addLearner", 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 *storageAdminServiceProcessorAddLearner) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddLearnerArgs) + var result StorageAdminServiceAddLearnerResult + if retval, err := p.handler.AddLearner(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addLearner: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRemovePart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRemovePart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRemovePartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRemovePart) 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("removePart", 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 *storageAdminServiceProcessorRemovePart) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRemovePartArgs) + var result StorageAdminServiceRemovePartResult + if retval, err := p.handler.RemovePart(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removePart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorMemberChange struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorMemberChange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceMemberChangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorMemberChange) 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("memberChange", 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 *storageAdminServiceProcessorMemberChange) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceMemberChangeArgs) + var result StorageAdminServiceMemberChangeResult + if retval, err := p.handler.MemberChange(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing memberChange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorWaitingForCatchUpData struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) 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("waitingForCatchUpData", 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 *storageAdminServiceProcessorWaitingForCatchUpData) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceWaitingForCatchUpDataArgs) + var result StorageAdminServiceWaitingForCatchUpDataResult + if retval, err := p.handler.WaitingForCatchUpData(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing waitingForCatchUpData: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCreateCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCreateCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) 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("createCheckpoint", 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 *storageAdminServiceProcessorCreateCheckpoint) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCreateCheckpointArgs) + var result StorageAdminServiceCreateCheckpointResult + if retval, err := p.handler.CreateCheckpoint(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorDropCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorDropCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceDropCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorDropCheckpoint) 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("dropCheckpoint", 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 *storageAdminServiceProcessorDropCheckpoint) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceDropCheckpointArgs) + var result StorageAdminServiceDropCheckpointResult + if retval, err := p.handler.DropCheckpoint(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorBlockingWrites struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorBlockingWrites) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceBlockingWritesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorBlockingWrites) 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("blockingWrites", 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 *storageAdminServiceProcessorBlockingWrites) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceBlockingWritesArgs) + var result StorageAdminServiceBlockingWritesResult + if retval, err := p.handler.BlockingWrites(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing blockingWrites: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildTagIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *storageAdminServiceProcessorRebuildTagIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildTagIndexArgs) + var result StorageAdminServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildEdgeIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *storageAdminServiceProcessorRebuildEdgeIndex) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildEdgeIndexArgs) + var result StorageAdminServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorGetLeaderParts struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorGetLeaderParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceGetLeaderPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorGetLeaderParts) 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("getLeaderParts", 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 *storageAdminServiceProcessorGetLeaderParts) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceGetLeaderPartsArgs) + var result StorageAdminServiceGetLeaderPartsResult + if retval, err := p.handler.GetLeaderParts(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getLeaderParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCheckPeers struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCheckPeers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCheckPeersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCheckPeers) 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("checkPeers", 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 *storageAdminServiceProcessorCheckPeers) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCheckPeersArgs) + var result StorageAdminServiceCheckPeersResult + if retval, err := p.handler.CheckPeers(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPeers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddAdminTask) 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("addAdminTask", 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 *storageAdminServiceProcessorAddAdminTask) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddAdminTaskArgs) + var result StorageAdminServiceAddAdminTaskResult + if retval, err := p.handler.AddAdminTask(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorStopAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorStopAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceStopAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorStopAdminTask) 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("stopAdminTask", 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 *storageAdminServiceProcessorStopAdminTask) Run(argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceStopAdminTaskArgs) + var result StorageAdminServiceStopAdminTaskResult + if retval, err := p.handler.StopAdminTask(args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stopAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type StorageAdminServiceTransLeaderArgs struct { + Req *TransLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceTransLeaderArgs() *StorageAdminServiceTransLeaderArgs { + return &StorageAdminServiceTransLeaderArgs{} +} + +var StorageAdminServiceTransLeaderArgs_Req_DEFAULT *TransLeaderReq +func (p *StorageAdminServiceTransLeaderArgs) GetReq() *TransLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceTransLeaderArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceTransLeaderArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewTransLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceTransLeaderArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceTransLeaderResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceTransLeaderResult() *StorageAdminServiceTransLeaderResult { + return &StorageAdminServiceTransLeaderResult{} +} + +var StorageAdminServiceTransLeaderResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceTransLeaderResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceTransLeaderResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceTransLeaderResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceTransLeaderResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceAddPartArgs struct { + Req *AddPartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddPartArgs() *StorageAdminServiceAddPartArgs { + return &StorageAdminServiceAddPartArgs{} +} + +var StorageAdminServiceAddPartArgs_Req_DEFAULT *AddPartReq +func (p *StorageAdminServiceAddPartArgs) GetReq() *AddPartReq { + if !p.IsSetReq() { + return StorageAdminServiceAddPartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddPartArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddPartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddPartArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceAddPartResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddPartResult() *StorageAdminServiceAddPartResult { + return &StorageAdminServiceAddPartResult{} +} + +var StorageAdminServiceAddPartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddPartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddPartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddPartResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddPartResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceAddLearnerArgs struct { + Req *AddLearnerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddLearnerArgs() *StorageAdminServiceAddLearnerArgs { + return &StorageAdminServiceAddLearnerArgs{} +} + +var StorageAdminServiceAddLearnerArgs_Req_DEFAULT *AddLearnerReq +func (p *StorageAdminServiceAddLearnerArgs) GetReq() *AddLearnerReq { + if !p.IsSetReq() { + return StorageAdminServiceAddLearnerArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddLearnerArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddLearnerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddLearnerArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceAddLearnerResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddLearnerResult() *StorageAdminServiceAddLearnerResult { + return &StorageAdminServiceAddLearnerResult{} +} + +var StorageAdminServiceAddLearnerResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddLearnerResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddLearnerResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddLearnerResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddLearnerResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceRemovePartArgs struct { + Req *RemovePartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRemovePartArgs() *StorageAdminServiceRemovePartArgs { + return &StorageAdminServiceRemovePartArgs{} +} + +var StorageAdminServiceRemovePartArgs_Req_DEFAULT *RemovePartReq +func (p *StorageAdminServiceRemovePartArgs) GetReq() *RemovePartReq { + if !p.IsSetReq() { + return StorageAdminServiceRemovePartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRemovePartArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemovePartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRemovePartArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceRemovePartResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRemovePartResult() *StorageAdminServiceRemovePartResult { + return &StorageAdminServiceRemovePartResult{} +} + +var StorageAdminServiceRemovePartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRemovePartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRemovePartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRemovePartResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRemovePartResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceMemberChangeArgs struct { + Req *MemberChangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceMemberChangeArgs() *StorageAdminServiceMemberChangeArgs { + return &StorageAdminServiceMemberChangeArgs{} +} + +var StorageAdminServiceMemberChangeArgs_Req_DEFAULT *MemberChangeReq +func (p *StorageAdminServiceMemberChangeArgs) GetReq() *MemberChangeReq { + if !p.IsSetReq() { + return StorageAdminServiceMemberChangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceMemberChangeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMemberChangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceMemberChangeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceMemberChangeResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceMemberChangeResult() *StorageAdminServiceMemberChangeResult { + return &StorageAdminServiceMemberChangeResult{} +} + +var StorageAdminServiceMemberChangeResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceMemberChangeResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceMemberChangeResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceMemberChangeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceMemberChangeResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceWaitingForCatchUpDataArgs struct { + Req *CatchUpDataReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataArgs() *StorageAdminServiceWaitingForCatchUpDataArgs { + return &StorageAdminServiceWaitingForCatchUpDataArgs{} +} + +var StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT *CatchUpDataReq +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) GetReq() *CatchUpDataReq { + if !p.IsSetReq() { + return StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCatchUpDataReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceWaitingForCatchUpDataResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataResult() *StorageAdminServiceWaitingForCatchUpDataResult { + return &StorageAdminServiceWaitingForCatchUpDataResult{} +} + +var StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceWaitingForCatchUpDataResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceWaitingForCatchUpDataResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceCreateCheckpointArgs struct { + Req *CreateCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCreateCheckpointArgs() *StorageAdminServiceCreateCheckpointArgs { + return &StorageAdminServiceCreateCheckpointArgs{} +} + +var StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT *CreateCPRequest +func (p *StorageAdminServiceCreateCheckpointArgs) GetReq() *CreateCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCreateCheckpointArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceCreateCheckpointResult struct { + Success *CreateCPResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCreateCheckpointResult() *StorageAdminServiceCreateCheckpointResult { + return &StorageAdminServiceCreateCheckpointResult{} +} + +var StorageAdminServiceCreateCheckpointResult_Success_DEFAULT *CreateCPResp +func (p *StorageAdminServiceCreateCheckpointResult) GetSuccess() *CreateCPResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCreateCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCreateCheckpointResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateCPResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceDropCheckpointArgs struct { + Req *DropCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceDropCheckpointArgs() *StorageAdminServiceDropCheckpointArgs { + return &StorageAdminServiceDropCheckpointArgs{} +} + +var StorageAdminServiceDropCheckpointArgs_Req_DEFAULT *DropCPRequest +func (p *StorageAdminServiceDropCheckpointArgs) GetReq() *DropCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceDropCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceDropCheckpointArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceDropCheckpointResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { + return &StorageAdminServiceDropCheckpointResult{} +} + +var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceDropCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceBlockingWritesArgs struct { + Req *BlockingSignRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceBlockingWritesArgs() *StorageAdminServiceBlockingWritesArgs { + return &StorageAdminServiceBlockingWritesArgs{} +} + +var StorageAdminServiceBlockingWritesArgs_Req_DEFAULT *BlockingSignRequest +func (p *StorageAdminServiceBlockingWritesArgs) GetReq() *BlockingSignRequest { + if !p.IsSetReq() { + return StorageAdminServiceBlockingWritesArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceBlockingWritesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBlockingSignRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceBlockingWritesResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { + return &StorageAdminServiceBlockingWritesResult{} +} + +var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceBlockingWritesResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildTagIndexArgs struct { + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildTagIndexArgs() *StorageAdminServiceRebuildTagIndexArgs { + return &StorageAdminServiceRebuildTagIndexArgs{} +} + +var StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildTagIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildTagIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildTagIndexResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildTagIndexResult() *StorageAdminServiceRebuildTagIndexResult { + return &StorageAdminServiceRebuildTagIndexResult{} +} + +var StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildTagIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildEdgeIndexArgs struct { + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildEdgeIndexArgs() *StorageAdminServiceRebuildEdgeIndexArgs { + return &StorageAdminServiceRebuildEdgeIndexArgs{} +} + +var StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildEdgeIndexResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildEdgeIndexResult() *StorageAdminServiceRebuildEdgeIndexResult { + return &StorageAdminServiceRebuildEdgeIndexResult{} +} + +var StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildEdgeIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceGetLeaderPartsArgs struct { + Req *GetLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceGetLeaderPartsArgs() *StorageAdminServiceGetLeaderPartsArgs { + return &StorageAdminServiceGetLeaderPartsArgs{} +} + +var StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT *GetLeaderReq +func (p *StorageAdminServiceGetLeaderPartsArgs) GetReq() *GetLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceGetLeaderPartsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceGetLeaderPartsResult struct { + Success *GetLeaderPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceGetLeaderPartsResult() *StorageAdminServiceGetLeaderPartsResult { + return &StorageAdminServiceGetLeaderPartsResult{} +} + +var StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT *GetLeaderPartsResp +func (p *StorageAdminServiceGetLeaderPartsResult) GetSuccess() *GetLeaderPartsResp { + if !p.IsSetSuccess() { + return StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceGetLeaderPartsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetLeaderPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceCheckPeersArgs struct { + Req *CheckPeersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCheckPeersArgs() *StorageAdminServiceCheckPeersArgs { + return &StorageAdminServiceCheckPeersArgs{} +} + +var StorageAdminServiceCheckPeersArgs_Req_DEFAULT *CheckPeersReq +func (p *StorageAdminServiceCheckPeersArgs) GetReq() *CheckPeersReq { + if !p.IsSetReq() { + return StorageAdminServiceCheckPeersArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCheckPeersArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCheckPeersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceCheckPeersArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceCheckPeersResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCheckPeersResult() *StorageAdminServiceCheckPeersResult { + return &StorageAdminServiceCheckPeersResult{} +} + +var StorageAdminServiceCheckPeersResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceCheckPeersResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCheckPeersResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCheckPeersResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceCheckPeersResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceAddAdminTaskArgs struct { + Req *AddAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { + return &StorageAdminServiceAddAdminTaskArgs{} +} + +var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddAdminTaskRequest +func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceAddAdminTaskResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { + return &StorageAdminServiceAddAdminTaskResult{} +} + +var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskResult(%+v)", *p) +} + +// Attributes: +// - Req +type StorageAdminServiceStopAdminTaskArgs struct { + Req *StopAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { + return &StorageAdminServiceStopAdminTaskArgs{} +} + +var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopAdminTaskRequest +func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewStopAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceStopAdminTaskResult struct { + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { + return &StorageAdminServiceStopAdminTaskResult{} +} + +var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskResult(%+v)", *p) +} + + diff --git a/ccore/nebula/internal/thrift/v2_0_0/storage/ttypes.go b/ccore/nebula/internal/thrift/v2_0_0/storage/ttypes.go new file mode 100644 index 0000000..9348e9a --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/storage/ttypes.go @@ -0,0 +1,12101 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_0_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAILED_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -11 + ErrorCode_E_KEY_HAS_EXISTS ErrorCode = -12 + ErrorCode_E_SPACE_NOT_FOUND ErrorCode = -13 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -14 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -15 + ErrorCode_E_CONSENSUS_ERROR ErrorCode = -16 + ErrorCode_E_DATA_TYPE_MISMATCH ErrorCode = -17 + ErrorCode_E_INVALID_FIELD_VALUE ErrorCode = -18 + ErrorCode_E_REBUILD_INDEX_FAILED ErrorCode = -19 + ErrorCode_E_INVALID_OPERATION ErrorCode = -20 + ErrorCode_E_NOT_NULLABLE ErrorCode = -21 + ErrorCode_E_FIELD_UNSET ErrorCode = -22 + ErrorCode_E_OUT_OF_RANGE ErrorCode = -23 + ErrorCode_E_ATOMIC_OP_FAILED ErrorCode = -24 + ErrorCode_E_DATA_CONFLICT_ERROR ErrorCode = -25 + ErrorCode_E_EDGE_PROP_NOT_FOUND ErrorCode = -31 + ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -32 + ErrorCode_E_IMPROPER_DATA_TYPE ErrorCode = -33 + ErrorCode_E_EDGE_NOT_FOUND ErrorCode = -34 + ErrorCode_E_TAG_NOT_FOUND ErrorCode = -35 + ErrorCode_E_INVALID_SPACEVIDLEN ErrorCode = -36 + ErrorCode_E_INDEX_NOT_FOUND ErrorCode = -37 + ErrorCode_E_INVALID_FILTER ErrorCode = -41 + ErrorCode_E_INVALID_UPDATER ErrorCode = -42 + ErrorCode_E_INVALID_STORE ErrorCode = -43 + ErrorCode_E_INVALID_PEER ErrorCode = -44 + ErrorCode_E_RETRY_EXHAUSTED ErrorCode = -45 + ErrorCode_E_TRANSFER_LEADER_FAILED ErrorCode = -46 + ErrorCode_E_INVALID_STAT_TYPE ErrorCode = -47 + ErrorCode_E_INVALID_VID ErrorCode = -48 + ErrorCode_E_NO_TRANSFORMED ErrorCode = -49 + ErrorCode_E_LOAD_META_FAILED ErrorCode = -51 + ErrorCode_E_FAILED_TO_CHECKPOINT ErrorCode = -60 + ErrorCode_E_CHECKPOINT_BLOCKED ErrorCode = -61 + ErrorCode_E_BACKUP_FAILED ErrorCode = -65 + ErrorCode_E_PARTIAL_RESULT ErrorCode = -71 + ErrorCode_E_FILTER_OUT ErrorCode = -81 + ErrorCode_E_INVALID_DATA ErrorCode = -82 + ErrorCode_E_MUTATE_EDGE_CONFLICT ErrorCode = -85 + ErrorCode_E_OUTDATED_LOCK ErrorCode = -86 + ErrorCode_E_INVALID_TASK_PARA ErrorCode = -90 + ErrorCode_E_USER_CANCEL ErrorCode = -99 + ErrorCode_E_UNKNOWN ErrorCode = -100 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAILED_TO_CONNECT: "E_FAILED_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_LEADER_CHANGED: "E_LEADER_CHANGED", + ErrorCode_E_KEY_HAS_EXISTS: "E_KEY_HAS_EXISTS", + ErrorCode_E_SPACE_NOT_FOUND: "E_SPACE_NOT_FOUND", + ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", + ErrorCode_E_KEY_NOT_FOUND: "E_KEY_NOT_FOUND", + ErrorCode_E_CONSENSUS_ERROR: "E_CONSENSUS_ERROR", + ErrorCode_E_DATA_TYPE_MISMATCH: "E_DATA_TYPE_MISMATCH", + ErrorCode_E_INVALID_FIELD_VALUE: "E_INVALID_FIELD_VALUE", + ErrorCode_E_REBUILD_INDEX_FAILED: "E_REBUILD_INDEX_FAILED", + ErrorCode_E_INVALID_OPERATION: "E_INVALID_OPERATION", + ErrorCode_E_NOT_NULLABLE: "E_NOT_NULLABLE", + ErrorCode_E_FIELD_UNSET: "E_FIELD_UNSET", + ErrorCode_E_OUT_OF_RANGE: "E_OUT_OF_RANGE", + ErrorCode_E_ATOMIC_OP_FAILED: "E_ATOMIC_OP_FAILED", + ErrorCode_E_DATA_CONFLICT_ERROR: "E_DATA_CONFLICT_ERROR", + ErrorCode_E_EDGE_PROP_NOT_FOUND: "E_EDGE_PROP_NOT_FOUND", + ErrorCode_E_TAG_PROP_NOT_FOUND: "E_TAG_PROP_NOT_FOUND", + ErrorCode_E_IMPROPER_DATA_TYPE: "E_IMPROPER_DATA_TYPE", + ErrorCode_E_EDGE_NOT_FOUND: "E_EDGE_NOT_FOUND", + ErrorCode_E_TAG_NOT_FOUND: "E_TAG_NOT_FOUND", + ErrorCode_E_INVALID_SPACEVIDLEN: "E_INVALID_SPACEVIDLEN", + ErrorCode_E_INDEX_NOT_FOUND: "E_INDEX_NOT_FOUND", + ErrorCode_E_INVALID_FILTER: "E_INVALID_FILTER", + ErrorCode_E_INVALID_UPDATER: "E_INVALID_UPDATER", + ErrorCode_E_INVALID_STORE: "E_INVALID_STORE", + ErrorCode_E_INVALID_PEER: "E_INVALID_PEER", + ErrorCode_E_RETRY_EXHAUSTED: "E_RETRY_EXHAUSTED", + ErrorCode_E_TRANSFER_LEADER_FAILED: "E_TRANSFER_LEADER_FAILED", + ErrorCode_E_INVALID_STAT_TYPE: "E_INVALID_STAT_TYPE", + ErrorCode_E_INVALID_VID: "E_INVALID_VID", + ErrorCode_E_NO_TRANSFORMED: "E_NO_TRANSFORMED", + ErrorCode_E_LOAD_META_FAILED: "E_LOAD_META_FAILED", + ErrorCode_E_FAILED_TO_CHECKPOINT: "E_FAILED_TO_CHECKPOINT", + ErrorCode_E_CHECKPOINT_BLOCKED: "E_CHECKPOINT_BLOCKED", + ErrorCode_E_BACKUP_FAILED: "E_BACKUP_FAILED", + ErrorCode_E_PARTIAL_RESULT: "E_PARTIAL_RESULT", + ErrorCode_E_FILTER_OUT: "E_FILTER_OUT", + ErrorCode_E_INVALID_DATA: "E_INVALID_DATA", + ErrorCode_E_MUTATE_EDGE_CONFLICT: "E_MUTATE_EDGE_CONFLICT", + ErrorCode_E_OUTDATED_LOCK: "E_OUTDATED_LOCK", + ErrorCode_E_INVALID_TASK_PARA: "E_INVALID_TASK_PARA", + ErrorCode_E_USER_CANCEL: "E_USER_CANCEL", + ErrorCode_E_UNKNOWN: "E_UNKNOWN", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAILED_TO_CONNECT": ErrorCode_E_FAILED_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_LEADER_CHANGED": ErrorCode_E_LEADER_CHANGED, + "E_KEY_HAS_EXISTS": ErrorCode_E_KEY_HAS_EXISTS, + "E_SPACE_NOT_FOUND": ErrorCode_E_SPACE_NOT_FOUND, + "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, + "E_KEY_NOT_FOUND": ErrorCode_E_KEY_NOT_FOUND, + "E_CONSENSUS_ERROR": ErrorCode_E_CONSENSUS_ERROR, + "E_DATA_TYPE_MISMATCH": ErrorCode_E_DATA_TYPE_MISMATCH, + "E_INVALID_FIELD_VALUE": ErrorCode_E_INVALID_FIELD_VALUE, + "E_REBUILD_INDEX_FAILED": ErrorCode_E_REBUILD_INDEX_FAILED, + "E_INVALID_OPERATION": ErrorCode_E_INVALID_OPERATION, + "E_NOT_NULLABLE": ErrorCode_E_NOT_NULLABLE, + "E_FIELD_UNSET": ErrorCode_E_FIELD_UNSET, + "E_OUT_OF_RANGE": ErrorCode_E_OUT_OF_RANGE, + "E_ATOMIC_OP_FAILED": ErrorCode_E_ATOMIC_OP_FAILED, + "E_DATA_CONFLICT_ERROR": ErrorCode_E_DATA_CONFLICT_ERROR, + "E_EDGE_PROP_NOT_FOUND": ErrorCode_E_EDGE_PROP_NOT_FOUND, + "E_TAG_PROP_NOT_FOUND": ErrorCode_E_TAG_PROP_NOT_FOUND, + "E_IMPROPER_DATA_TYPE": ErrorCode_E_IMPROPER_DATA_TYPE, + "E_EDGE_NOT_FOUND": ErrorCode_E_EDGE_NOT_FOUND, + "E_TAG_NOT_FOUND": ErrorCode_E_TAG_NOT_FOUND, + "E_INVALID_SPACEVIDLEN": ErrorCode_E_INVALID_SPACEVIDLEN, + "E_INDEX_NOT_FOUND": ErrorCode_E_INDEX_NOT_FOUND, + "E_INVALID_FILTER": ErrorCode_E_INVALID_FILTER, + "E_INVALID_UPDATER": ErrorCode_E_INVALID_UPDATER, + "E_INVALID_STORE": ErrorCode_E_INVALID_STORE, + "E_INVALID_PEER": ErrorCode_E_INVALID_PEER, + "E_RETRY_EXHAUSTED": ErrorCode_E_RETRY_EXHAUSTED, + "E_TRANSFER_LEADER_FAILED": ErrorCode_E_TRANSFER_LEADER_FAILED, + "E_INVALID_STAT_TYPE": ErrorCode_E_INVALID_STAT_TYPE, + "E_INVALID_VID": ErrorCode_E_INVALID_VID, + "E_NO_TRANSFORMED": ErrorCode_E_NO_TRANSFORMED, + "E_LOAD_META_FAILED": ErrorCode_E_LOAD_META_FAILED, + "E_FAILED_TO_CHECKPOINT": ErrorCode_E_FAILED_TO_CHECKPOINT, + "E_CHECKPOINT_BLOCKED": ErrorCode_E_CHECKPOINT_BLOCKED, + "E_BACKUP_FAILED": ErrorCode_E_BACKUP_FAILED, + "E_PARTIAL_RESULT": ErrorCode_E_PARTIAL_RESULT, + "E_FILTER_OUT": ErrorCode_E_FILTER_OUT, + "E_INVALID_DATA": ErrorCode_E_INVALID_DATA, + "E_MUTATE_EDGE_CONFLICT": ErrorCode_E_MUTATE_EDGE_CONFLICT, + "E_OUTDATED_LOCK": ErrorCode_E_OUTDATED_LOCK, + "E_INVALID_TASK_PARA": ErrorCode_E_INVALID_TASK_PARA, + "E_USER_CANCEL": ErrorCode_E_USER_CANCEL, + "E_UNKNOWN": ErrorCode_E_UNKNOWN, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +type StatType int64 +const ( + StatType_SUM StatType = 1 + StatType_COUNT StatType = 2 + StatType_AVG StatType = 3 + StatType_MAX StatType = 4 + StatType_MIN StatType = 5 +) + +var StatTypeToName = map[StatType]string { + StatType_SUM: "SUM", + StatType_COUNT: "COUNT", + StatType_AVG: "AVG", + StatType_MAX: "MAX", + StatType_MIN: "MIN", +} + +var StatTypeToValue = map[string]StatType { + "SUM": StatType_SUM, + "COUNT": StatType_COUNT, + "AVG": StatType_AVG, + "MAX": StatType_MAX, + "MIN": StatType_MIN, +} + +func (p StatType) String() string { + if v, ok := StatTypeToName[p]; ok { + return v + } + return "" +} + +func StatTypeFromString(s string) (StatType, error) { + if v, ok := StatTypeToValue[s]; ok { + return v, nil + } + return StatType(0), fmt.Errorf("not a valid StatType string") +} + +func StatTypePtr(v StatType) *StatType { return &v } + +type OrderDirection int64 +const ( + OrderDirection_ASCENDING OrderDirection = 1 + OrderDirection_DESCENDING OrderDirection = 2 +) + +var OrderDirectionToName = map[OrderDirection]string { + OrderDirection_ASCENDING: "ASCENDING", + OrderDirection_DESCENDING: "DESCENDING", +} + +var OrderDirectionToValue = map[string]OrderDirection { + "ASCENDING": OrderDirection_ASCENDING, + "DESCENDING": OrderDirection_DESCENDING, +} + +func (p OrderDirection) String() string { + if v, ok := OrderDirectionToName[p]; ok { + return v + } + return "" +} + +func OrderDirectionFromString(s string) (OrderDirection, error) { + if v, ok := OrderDirectionToValue[s]; ok { + return v, nil + } + return OrderDirection(0), fmt.Errorf("not a valid OrderDirection string") +} + +func OrderDirectionPtr(v OrderDirection) *OrderDirection { return &v } + +type EdgeDirection int64 +const ( + EdgeDirection_BOTH EdgeDirection = 1 + EdgeDirection_IN_EDGE EdgeDirection = 2 + EdgeDirection_OUT_EDGE EdgeDirection = 3 +) + +var EdgeDirectionToName = map[EdgeDirection]string { + EdgeDirection_BOTH: "BOTH", + EdgeDirection_IN_EDGE: "IN_EDGE", + EdgeDirection_OUT_EDGE: "OUT_EDGE", +} + +var EdgeDirectionToValue = map[string]EdgeDirection { + "BOTH": EdgeDirection_BOTH, + "IN_EDGE": EdgeDirection_IN_EDGE, + "OUT_EDGE": EdgeDirection_OUT_EDGE, +} + +func (p EdgeDirection) String() string { + if v, ok := EdgeDirectionToName[p]; ok { + return v + } + return "" +} + +func EdgeDirectionFromString(s string) (EdgeDirection, error) { + if v, ok := EdgeDirectionToValue[s]; ok { + return v, nil + } + return EdgeDirection(0), fmt.Errorf("not a valid EdgeDirection string") +} + +func EdgeDirectionPtr(v EdgeDirection) *EdgeDirection { return &v } + +type ScanType int64 +const ( + ScanType_PREFIX ScanType = 1 + ScanType_RANGE ScanType = 2 +) + +var ScanTypeToName = map[ScanType]string { + ScanType_PREFIX: "PREFIX", + ScanType_RANGE: "RANGE", +} + +var ScanTypeToValue = map[string]ScanType { + "PREFIX": ScanType_PREFIX, + "RANGE": ScanType_RANGE, +} + +func (p ScanType) String() string { + if v, ok := ScanTypeToName[p]; ok { + return v + } + return "" +} + +func ScanTypeFromString(s string) (ScanType, error) { + if v, ok := ScanTypeToValue[s]; ok { + return v, nil + } + return ScanType(0), fmt.Errorf("not a valid ScanType string") +} + +func ScanTypePtr(v ScanType) *ScanType { return &v } + +type EngineSignType int64 +const ( + EngineSignType_BLOCK_ON EngineSignType = 1 + EngineSignType_BLOCK_OFF EngineSignType = 2 +) + +var EngineSignTypeToName = map[EngineSignType]string { + EngineSignType_BLOCK_ON: "BLOCK_ON", + EngineSignType_BLOCK_OFF: "BLOCK_OFF", +} + +var EngineSignTypeToValue = map[string]EngineSignType { + "BLOCK_ON": EngineSignType_BLOCK_ON, + "BLOCK_OFF": EngineSignType_BLOCK_OFF, +} + +func (p EngineSignType) String() string { + if v, ok := EngineSignTypeToName[p]; ok { + return v + } + return "" +} + +func EngineSignTypeFromString(s string) (EngineSignType, error) { + if v, ok := EngineSignTypeToValue[s]; ok { + return v, nil + } + return EngineSignType(0), fmt.Errorf("not a valid EngineSignType string") +} + +func EngineSignTypePtr(v EngineSignType) *EngineSignType { return &v } + +// Attributes: +// - Code +// - PartID +// - Leader +type PartitionResult_ struct { + Code ErrorCode `thrift:"code,1,required" db:"code" json:"code"` + PartID nebula0.PartitionID `thrift:"part_id,2,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader,omitempty"` +} + +func NewPartitionResult_() *PartitionResult_ { + return &PartitionResult_{} +} + + +func (p *PartitionResult_) GetCode() ErrorCode { + return p.Code +} + +func (p *PartitionResult_) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartitionResult__Leader_DEFAULT *nebula0.HostAddr +func (p *PartitionResult_) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartitionResult__Leader_DEFAULT + } +return p.Leader +} +func (p *PartitionResult_) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *PartitionResult_) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetCode bool = false; + var issetPartID 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 + } + issetCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetPartID = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")); + } + if !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + return nil +} + +func (p *PartitionResult_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *PartitionResult_) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartitionResult_) ReadField3(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 *PartitionResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionResult"); 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 *PartitionResult_) 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 *PartitionResult_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + } + return err +} + +func (p *PartitionResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionResult_(%+v)", *p) +} + +// Attributes: +// - FailedParts +// - LatencyInUs +type ResponseCommon struct { + FailedParts []*PartitionResult_ `thrift:"failed_parts,1,required" db:"failed_parts" json:"failed_parts"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` +} + +func NewResponseCommon() *ResponseCommon { + return &ResponseCommon{} +} + + +func (p *ResponseCommon) GetFailedParts() []*PartitionResult_ { + return p.FailedParts +} + +func (p *ResponseCommon) GetLatencyInUs() int32 { + return p.LatencyInUs +} +func (p *ResponseCommon) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFailedParts bool = false; + var issetLatencyInUs 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 + } + issetFailedParts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetFailedParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedParts is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ResponseCommon) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartitionResult_, 0, size) + p.FailedParts = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewPartitionResult_() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.FailedParts = append(p.FailedParts, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ResponseCommon) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ResponseCommon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ResponseCommon"); 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 *ResponseCommon) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("failed_parts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:failed_parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FailedParts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.FailedParts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:failed_parts: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ResponseCommon) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ResponseCommon(%+v)", *p) +} + +// Attributes: +// - Alias +// - Prop +// - Stat +type StatProp struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Prop []byte `thrift:"prop,2" db:"prop" json:"prop"` + Stat StatType `thrift:"stat,3" db:"stat" json:"stat"` +} + +func NewStatProp() *StatProp { + return &StatProp{} +} + + +func (p *StatProp) GetAlias() []byte { + return p.Alias +} + +func (p *StatProp) GetProp() []byte { + return p.Prop +} + +func (p *StatProp) GetStat() StatType { + return p.Stat +} +func (p *StatProp) 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 *StatProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *StatProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *StatProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := StatType(v) + p.Stat = temp +} + return nil +} + +func (p *StatProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatProp"); 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 *StatProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *StatProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prop: ", p), err) } + return err +} + +func (p *StatProp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stat", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat: ", p), err) } + if err := oprot.WriteI32(int32(p.Stat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stat (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat: ", p), err) } + return err +} + +func (p *StatProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StatProp(%+v)", *p) +} + +// Attributes: +// - Alias +// - Expr +type Expr struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Expr []byte `thrift:"expr,2" db:"expr" json:"expr"` +} + +func NewExpr() *Expr { + return &Expr{} +} + + +func (p *Expr) GetAlias() []byte { + return p.Alias +} + +func (p *Expr) GetExpr() []byte { + return p.Expr +} +func (p *Expr) 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 *Expr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *Expr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Expr = v +} + return nil +} + +func (p *Expr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Expr"); 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 *Expr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *Expr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("expr", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expr: ", p), err) } + if err := oprot.WriteBinary(p.Expr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expr: ", p), err) } + return err +} + +func (p *Expr) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Expr(%+v)", *p) +} + +// Attributes: +// - Type +// - Props +type EdgeProp struct { + Type nebula0.EdgeType `thrift:"type,1" db:"type" json:"type"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewEdgeProp() *EdgeProp { + return &EdgeProp{} +} + + +func (p *EdgeProp) GetType() nebula0.EdgeType { + return p.Type +} + +func (p *EdgeProp) GetProps() [][]byte { + return p.Props +} +func (p *EdgeProp) 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 *EdgeProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *EdgeProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem3 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem3 = v +} + p.Props = append(p.Props, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *EdgeProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeProp"); 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 *EdgeProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *EdgeProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *EdgeProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeProp(%+v)", *p) +} + +// Attributes: +// - Tag +// - Props +type VertexProp struct { + Tag nebula0.TagID `thrift:"tag,1" db:"tag" json:"tag"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewVertexProp() *VertexProp { + return &VertexProp{} +} + + +func (p *VertexProp) GetTag() nebula0.TagID { + return p.Tag +} + +func (p *VertexProp) GetProps() [][]byte { + return p.Props +} +func (p *VertexProp) 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 *VertexProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.Tag = temp +} + return nil +} + +func (p *VertexProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem4 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem4 = v +} + p.Props = append(p.Props, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *VertexProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VertexProp"); 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 *VertexProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) } + if err := oprot.WriteI32(int32(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) } + return err +} + +func (p *VertexProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *VertexProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VertexProp(%+v)", *p) +} + +// Attributes: +// - Prop +// - Direction +type OrderBy struct { + Prop []byte `thrift:"prop,1" db:"prop" json:"prop"` + Direction OrderDirection `thrift:"direction,2" db:"direction" json:"direction"` +} + +func NewOrderBy() *OrderBy { + return &OrderBy{} +} + + +func (p *OrderBy) GetProp() []byte { + return p.Prop +} + +func (p *OrderBy) GetDirection() OrderDirection { + return p.Direction +} +func (p *OrderBy) 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 *OrderBy) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *OrderBy) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := OrderDirection(v) + p.Direction = temp +} + return nil +} + +func (p *OrderBy) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("OrderBy"); 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 *OrderBy) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prop: ", p), err) } + return err +} + +func (p *OrderBy) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:direction: ", p), err) } + if err := oprot.WriteI32(int32(p.Direction)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:direction: ", p), err) } + return err +} + +func (p *OrderBy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OrderBy(%+v)", *p) +} + +// Attributes: +// - EdgeTypes +// - EdgeDirection +// - Dedup +// - StatProps +// - VertexProps +// - EdgeProps +// - Expressions +// - OrderBy +// - Random +// - Limit +// - Filter +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"` + Dedup bool `thrift:"dedup,3" db:"dedup" json:"dedup"` + StatProps []*StatProp `thrift:"stat_props,4" db:"stat_props" json:"stat_props,omitempty"` + VertexProps []*VertexProp `thrift:"vertex_props,5" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,6" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,7" db:"expressions" json:"expressions,omitempty"` + OrderBy []*OrderBy `thrift:"order_by,8" db:"order_by" json:"order_by,omitempty"` + Random *bool `thrift:"random,9" db:"random" json:"random,omitempty"` + Limit *int64 `thrift:"limit,10" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,11" db:"filter" json:"filter,omitempty"` +} + +func NewTraverseSpec() *TraverseSpec { + return &TraverseSpec{ +EdgeDirection: 1, +} +} + + +func (p *TraverseSpec) GetEdgeTypes() []nebula0.EdgeType { + return p.EdgeTypes +} + +func (p *TraverseSpec) GetEdgeDirection() EdgeDirection { + return p.EdgeDirection +} + +func (p *TraverseSpec) GetDedup() bool { + return p.Dedup +} +var TraverseSpec_StatProps_DEFAULT []*StatProp + +func (p *TraverseSpec) GetStatProps() []*StatProp { + return p.StatProps +} +var TraverseSpec_VertexProps_DEFAULT []*VertexProp + +func (p *TraverseSpec) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var TraverseSpec_EdgeProps_DEFAULT []*EdgeProp + +func (p *TraverseSpec) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var TraverseSpec_Expressions_DEFAULT []*Expr + +func (p *TraverseSpec) GetExpressions() []*Expr { + return p.Expressions +} +var TraverseSpec_OrderBy_DEFAULT []*OrderBy + +func (p *TraverseSpec) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var TraverseSpec_Random_DEFAULT bool +func (p *TraverseSpec) GetRandom() bool { + if !p.IsSetRandom() { + return TraverseSpec_Random_DEFAULT + } +return *p.Random +} +var TraverseSpec_Limit_DEFAULT int64 +func (p *TraverseSpec) GetLimit() int64 { + if !p.IsSetLimit() { + return TraverseSpec_Limit_DEFAULT + } +return *p.Limit +} +var TraverseSpec_Filter_DEFAULT []byte + +func (p *TraverseSpec) GetFilter() []byte { + return p.Filter +} +func (p *TraverseSpec) IsSetStatProps() bool { + return p.StatProps != nil +} + +func (p *TraverseSpec) IsSetVertexProps() bool { + return p.VertexProps != nil +} + +func (p *TraverseSpec) IsSetEdgeProps() bool { + return p.EdgeProps != nil +} + +func (p *TraverseSpec) IsSetExpressions() bool { + return p.Expressions != nil +} + +func (p *TraverseSpec) IsSetOrderBy() bool { + return p.OrderBy != nil +} + +func (p *TraverseSpec) IsSetRandom() bool { + return p.Random != nil +} + +func (p *TraverseSpec) IsSetLimit() bool { + return p.Limit != nil +} + +func (p *TraverseSpec) IsSetFilter() bool { + return p.Filter != nil +} + +func (p *TraverseSpec) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *TraverseSpec) ReadField1(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 _elem5 nebula0.EdgeType + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.EdgeType(v) + _elem5 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeDirection(v) + p.EdgeDirection = temp +} + return nil +} + +func (p *TraverseSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *TraverseSpec) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*StatProp, 0, size) + p.StatProps = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewStatProp() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.StatProps = append(p.StatProps, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem7 := NewVertexProp() + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.VertexProps = append(p.VertexProps, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField6(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem8 := NewEdgeProp() + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + p.EdgeProps = append(p.EdgeProps, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewExpr() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Expressions = append(p.Expressions, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField8(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem10 := NewOrderBy() + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.OrderBy = append(p.OrderBy, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Random = &v +} + return nil +} + +func (p *TraverseSpec) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *TraverseSpec) ReadField11(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.Filter = 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) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TraverseSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:edge_types: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_direction: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeDirection)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_direction: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dedup: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatProps() { + if err := oprot.WriteFieldBegin("stat_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stat_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StatProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stat_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vertex_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + 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 7:expressions: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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:order_by: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetRandom() { + if err := oprot.WriteFieldBegin("random", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:random: ", p), err) } + if err := oprot.WriteBool(bool(*p.Random)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.random (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:random: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:limit: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TraverseSpec(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - ColumnNames +// - Parts +// - TraverseSpec +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"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewGetNeighborsRequest() *GetNeighborsRequest { + return &GetNeighborsRequest{} +} + + +func (p *GetNeighborsRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetNeighborsRequest) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetNeighborsRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *GetNeighborsRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return GetNeighborsRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *GetNeighborsRequest) IsSetTraverseSpec() bool { + return p.TraverseSpec != nil +} + +func (p *GetNeighborsRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + 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 _elem11 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem11 = v +} + p.ColumnNames = append(p.ColumnNames, _elem11) + } + 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.Row, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key12 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key12 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val13 := tSlice + for i := 0; i < size; i ++ { + _elem14 := nebula0.NewRow() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + _val13 = append(_val13, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key12] = _val13 + } + 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) 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 := oprot.WriteFieldStop(); err != nil { + return thrift.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) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetNeighborsRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Vertices +type GetNeighborsResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Vertices *nebula0.DataSet `thrift:"vertices,2" db:"vertices" json:"vertices,omitempty"` +} + +func NewGetNeighborsResponse() *GetNeighborsResponse { + return &GetNeighborsResponse{} +} + +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.Result_ != nil +} + +func (p *GetNeighborsResponse) IsSetVertices() bool { + return p.Vertices != nil +} + +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 "" + } + return fmt.Sprintf("GetNeighborsResponse(%+v)", *p) +} + +// Attributes: +// - Result_ +type ExecResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` +} + +func NewExecResponse() *ExecResponse { + return &ExecResponse{} +} + +var ExecResponse_Result__DEFAULT *ResponseCommon +func (p *ExecResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ExecResponse_Result__DEFAULT + } +return p.Result_ +} +func (p *ExecResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *ExecResponse) 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 + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 *ExecResponse) 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 *ExecResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResponse"); 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 *ExecResponse) 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 *ExecResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecResponse(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - VertexProps +// - EdgeProps +// - Expressions +// - Dedup +// - OrderBy +// - Limit +// - Filter +type GetPropRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.Row `thrift:"parts,2" db:"parts" json:"parts"` + VertexProps []*VertexProp `thrift:"vertex_props,3" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,4" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,5" db:"expressions" json:"expressions,omitempty"` + Dedup bool `thrift:"dedup,6" db:"dedup" json:"dedup"` + OrderBy []*OrderBy `thrift:"order_by,7" db:"order_by" json:"order_by,omitempty"` + Limit *int64 `thrift:"limit,8" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,9" db:"filter" json:"filter,omitempty"` +} + +func NewGetPropRequest() *GetPropRequest { + return &GetPropRequest{} +} + + +func (p *GetPropRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetPropRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetPropRequest_VertexProps_DEFAULT []*VertexProp + +func (p *GetPropRequest) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var GetPropRequest_EdgeProps_DEFAULT []*EdgeProp + +func (p *GetPropRequest) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var GetPropRequest_Expressions_DEFAULT []*Expr + +func (p *GetPropRequest) GetExpressions() []*Expr { + return p.Expressions +} + +func (p *GetPropRequest) GetDedup() bool { + return p.Dedup +} +var GetPropRequest_OrderBy_DEFAULT []*OrderBy + +func (p *GetPropRequest) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var GetPropRequest_Limit_DEFAULT int64 +func (p *GetPropRequest) GetLimit() int64 { + if !p.IsSetLimit() { + return GetPropRequest_Limit_DEFAULT + } +return *p.Limit +} +var GetPropRequest_Filter_DEFAULT []byte + +func (p *GetPropRequest) GetFilter() []byte { + return p.Filter +} +func (p *GetPropRequest) IsSetVertexProps() bool { + return p.VertexProps != nil +} + +func (p *GetPropRequest) IsSetEdgeProps() bool { + return p.EdgeProps != nil +} + +func (p *GetPropRequest) IsSetExpressions() bool { + return p.Expressions != nil +} + +func (p *GetPropRequest) IsSetOrderBy() bool { + return p.OrderBy != nil +} + +func (p *GetPropRequest) IsSetLimit() bool { + return p.Limit != nil +} + +func (p *GetPropRequest) IsSetFilter() bool { + return p.Filter != nil +} + +func (p *GetPropRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key15 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key15 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val16 := tSlice + for i := 0; i < size; i ++ { + _elem17 := nebula0.NewRow() + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + _val16 = append(_val16, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem18 := NewVertexProp() + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.VertexProps = append(p.VertexProps, _elem18) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem19 := NewEdgeProp() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + p.EdgeProps = append(p.EdgeProps, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem20 := NewExpr() + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + } + p.Expressions = append(p.Expressions, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *GetPropRequest) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem21 := NewOrderBy() + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + } + p.OrderBy = append(p.OrderBy, _elem21) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *GetPropRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *GetPropRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:edge_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:expressions: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dedup: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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 7:order_by: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:limit: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:filter: ", p), err) } + } + return err +} + +func (p *GetPropRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPropRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Props +type GetPropResponse struct { + Result_ *ResponseCommon `thrift:"result,1" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewGetPropResponse() *GetPropResponse { + return &GetPropResponse{} +} + +var GetPropResponse_Result__DEFAULT *ResponseCommon +func (p *GetPropResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetPropResponse_Result__DEFAULT + } +return p.Result_ +} +var GetPropResponse_Props_DEFAULT *nebula0.DataSet +func (p *GetPropResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return GetPropResponse_Props_DEFAULT + } +return p.Props +} +func (p *GetPropResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *GetPropResponse) IsSetProps() bool { + return p.Props != nil +} + +func (p *GetPropResponse) 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 *GetPropResponse) 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 *GetPropResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *GetPropResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropResponse"); 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 *GetPropResponse) 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 *GetPropResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *GetPropResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPropResponse(%+v)", *p) +} + +// Attributes: +// - TagID +// - Props +type NewTag_ struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewTag_() *NewTag_ { + return &NewTag_{} +} + + +func (p *NewTag_) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *NewTag_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewTag_) 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 *NewTag_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *NewTag_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + p.Props = tSlice + for i := 0; i < size; i ++ { + _elem22 := nebula0.NewValue() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.Props = append(p.Props, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewTag_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewTag"); 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 *NewTag_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *NewTag_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewTag_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewTag_(%+v)", *p) +} + +// Attributes: +// - Id +// - Tags +type NewVertex_ struct { + Id *nebula0.Value `thrift:"id,1" db:"id" json:"id"` + Tags []*NewTag_ `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewNewVertex_() *NewVertex_ { + return &NewVertex_{} +} + +var NewVertex__Id_DEFAULT *nebula0.Value +func (p *NewVertex_) GetId() *nebula0.Value { + if !p.IsSetId() { + return NewVertex__Id_DEFAULT + } +return p.Id +} + +func (p *NewVertex_) GetTags() []*NewTag_ { + return p.Tags +} +func (p *NewVertex_) IsSetId() bool { + return p.Id != nil +} + +func (p *NewVertex_) 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 *NewVertex_) ReadField1(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *NewVertex_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewTag_, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem23 := NewNewTag_() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Tags = append(p.Tags, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewVertex_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewVertex"); 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 *NewVertex_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *NewVertex_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *NewVertex_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewVertex_(%+v)", *p) +} + +// Attributes: +// - Src +// - EdgeType +// - Ranking +// - Dst +type EdgeKey struct { + Src *nebula0.Value `thrift:"src,1" db:"src" json:"src"` + EdgeType nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type"` + Ranking nebula0.EdgeRanking `thrift:"ranking,3" db:"ranking" json:"ranking"` + Dst *nebula0.Value `thrift:"dst,4" db:"dst" json:"dst"` +} + +func NewEdgeKey() *EdgeKey { + return &EdgeKey{} +} + +var EdgeKey_Src_DEFAULT *nebula0.Value +func (p *EdgeKey) GetSrc() *nebula0.Value { + if !p.IsSetSrc() { + return EdgeKey_Src_DEFAULT + } +return p.Src +} + +func (p *EdgeKey) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeKey) GetRanking() nebula0.EdgeRanking { + return p.Ranking +} +var EdgeKey_Dst_DEFAULT *nebula0.Value +func (p *EdgeKey) GetDst() *nebula0.Value { + if !p.IsSetDst() { + return EdgeKey_Dst_DEFAULT + } +return p.Dst +} +func (p *EdgeKey) IsSetSrc() bool { + return p.Src != nil +} + +func (p *EdgeKey) IsSetDst() bool { + return p.Dst != nil +} + +func (p *EdgeKey) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeKey) ReadField1(iprot thrift.Protocol) error { + p.Src = nebula0.NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *EdgeKey) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeKey) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *EdgeKey) ReadField4(iprot thrift.Protocol) error { + p.Dst = nebula0.NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *EdgeKey) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeKey"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeKey) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *EdgeKey) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + return err +} + +func (p *EdgeKey) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ranking: ", p), err) } + return err +} + +func (p *EdgeKey) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dst: ", p), err) } + return err +} + +func (p *EdgeKey) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeKey(%+v)", *p) +} + +// Attributes: +// - Key +// - Props +type NewEdge_ struct { + Key *EdgeKey `thrift:"key,1" db:"key" json:"key"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewEdge_() *NewEdge_ { + return &NewEdge_{} +} + +var NewEdge__Key_DEFAULT *EdgeKey +func (p *NewEdge_) GetKey() *EdgeKey { + if !p.IsSetKey() { + return NewEdge__Key_DEFAULT + } +return p.Key +} + +func (p *NewEdge_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewEdge_) IsSetKey() bool { + return p.Key != nil +} + +func (p *NewEdge_) 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 *NewEdge_) ReadField1(iprot thrift.Protocol) error { + p.Key = NewEdgeKey() + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *NewEdge_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Props = append(p.Props, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewEdge_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewEdge"); 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 *NewEdge_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *NewEdge_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewEdge_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewEdge_(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - Overwritable +type AddVerticesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + Overwritable bool `thrift:"overwritable,4" db:"overwritable" json:"overwritable"` +} + +func NewAddVerticesRequest() *AddVerticesRequest { + return &AddVerticesRequest{ +Overwritable: true, +} +} + + +func (p *AddVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddVerticesRequest) GetParts() map[nebula0.PartitionID][]*NewVertex_ { + return p.Parts +} + +func (p *AddVerticesRequest) GetPropNames() map[nebula0.TagID][][]byte { + return p.PropNames +} + +func (p *AddVerticesRequest) GetOverwritable() bool { + return p.Overwritable +} +func (p *AddVerticesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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][]*NewVertex_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key25 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key25 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewVertex_, 0, size) + _val26 := tSlice + for i := 0; i < size; i ++ { + _elem27 := NewNewVertex_() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + _val26 = append(_val26, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key25] = _val26 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.TagID][][]byte, size) + p.PropNames = tMap + for i := 0; i < size; i ++ { +var _key28 nebula0.TagID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.TagID(v) + _key28 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val29 := tSlice + for i := 0; i < size; i ++ { +var _elem30 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem30 = v +} + _val29 = append(_val29, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PropNames[_key28] = _val29 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Overwritable = v +} + return nil +} + +func (p *AddVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddVerticesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PropNames { + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:prop_names: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("overwritable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:overwritable: ", p), err) } + if err := oprot.WriteBool(bool(p.Overwritable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.overwritable (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:overwritable: ", p), err) } + return err +} + +func (p *AddVerticesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddVerticesRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - Overwritable +type AddEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + Overwritable bool `thrift:"overwritable,4" db:"overwritable" json:"overwritable"` +} + +func NewAddEdgesRequest() *AddEdgesRequest { + return &AddEdgesRequest{ +Overwritable: true, +} +} + + +func (p *AddEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddEdgesRequest) GetParts() map[nebula0.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *AddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *AddEdgesRequest) GetOverwritable() bool { + return p.Overwritable +} +func (p *AddEdgesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key31 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val32 := tSlice + for i := 0; i < size; i ++ { + _elem33 := NewNewEdge_() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) + } + _val32 = append(_val32, _elem33) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key31] = _val32 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField3(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.PropNames = tSlice + for i := 0; i < size; i ++ { +var _elem34 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem34 = v +} + p.PropNames = append(p.PropNames, _elem34) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Overwritable = v +} + return nil +} + +func (p *AddEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddEdgesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("overwritable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:overwritable: ", p), err) } + if err := oprot.WriteBool(bool(p.Overwritable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.overwritable (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:overwritable: ", p), err) } + return err +} + +func (p *AddEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddEdgesRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteVerticesRequest 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"` +} + +func NewDeleteVerticesRequest() *DeleteVerticesRequest { + return &DeleteVerticesRequest{} +} + + +func (p *DeleteVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteVerticesRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { + return p.Parts +} +func (p *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key35 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key35 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + _val36 := tSlice + for i := 0; i < size; i ++ { + _elem37 := nebula0.NewValue() + if err := _elem37.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + _val36 = append(_val36, _elem37) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key35] = _val36 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteVerticesRequest"); 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteVerticesRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*EdgeKey `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewDeleteEdgesRequest() *DeleteEdgesRequest { + return &DeleteEdgesRequest{} +} + + +func (p *DeleteEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteEdgesRequest) GetParts() map[nebula0.PartitionID][]*EdgeKey { + return p.Parts +} +func (p *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key38 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key38 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val39 := tSlice + for i := 0; i < size; i ++ { + _elem40 := NewEdgeKey() + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + _val39 = append(_val39, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key38] = _val39 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteEdgesRequest"); 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteEdgesRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Props +type UpdateResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewUpdateResponse() *UpdateResponse { + return &UpdateResponse{} +} + +var UpdateResponse_Result__DEFAULT *ResponseCommon +func (p *UpdateResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return UpdateResponse_Result__DEFAULT + } +return p.Result_ +} +var UpdateResponse_Props_DEFAULT *nebula0.DataSet +func (p *UpdateResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return UpdateResponse_Props_DEFAULT + } +return p.Props +} +func (p *UpdateResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *UpdateResponse) IsSetProps() bool { + return p.Props != nil +} + +func (p *UpdateResponse) 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 *UpdateResponse) 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 *UpdateResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *UpdateResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateResponse"); 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 *UpdateResponse) 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 *UpdateResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateResponse(%+v)", *p) +} + +// Attributes: +// - Name +// - Value +type UpdatedProp struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewUpdatedProp() *UpdatedProp { + return &UpdatedProp{} +} + + +func (p *UpdatedProp) GetName() []byte { + return p.Name +} + +func (p *UpdatedProp) GetValue() []byte { + return p.Value +} +func (p *UpdatedProp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetValue 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *UpdatedProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *UpdatedProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *UpdatedProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdatedProp"); 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 *UpdatedProp) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *UpdatedProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *UpdatedProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdatedProp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - VertexID +// - TagID +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + VertexID *nebula0.Value `thrift:"vertex_id,3" db:"vertex_id" json:"vertex_id"` + TagID nebula0.TagID `thrift:"tag_id,4,required" db:"tag_id" json:"tag_id"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,5" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,6" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,7" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,8" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateVertexRequest() *UpdateVertexRequest { + return &UpdateVertexRequest{} +} + + +func (p *UpdateVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateVertexRequest_VertexID_DEFAULT *nebula0.Value +func (p *UpdateVertexRequest) GetVertexID() *nebula0.Value { + if !p.IsSetVertexID() { + return UpdateVertexRequest_VertexID_DEFAULT + } +return p.VertexID +} + +func (p *UpdateVertexRequest) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *UpdateVertexRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateVertexRequest_Insertable_DEFAULT bool = false + +func (p *UpdateVertexRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateVertexRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateVertexRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateVertexRequest_Condition_DEFAULT []byte + +func (p *UpdateVertexRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateVertexRequest) IsSetVertexID() bool { + return p.VertexID != nil +} + +func (p *UpdateVertexRequest) IsSetInsertable() bool { + return p.Insertable != UpdateVertexRequest_Insertable_DEFAULT +} + +func (p *UpdateVertexRequest) IsSetReturnProps() bool { + return p.ReturnProps != nil +} + +func (p *UpdateVertexRequest) IsSetCondition() bool { + return p.Condition != nil +} + +func (p *UpdateVertexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTagID 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 + } + 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 + } + issetTagID = true + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetTagID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagID is not set")); + } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField3(iprot thrift.Protocol) error { + p.VertexID = nebula0.NewValue() + if err := p.VertexID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexID), err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem41 := NewUpdatedProp() + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField7(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem42 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem42 = v +} + p.ReturnProps = append(p.ReturnProps, _elem42) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_id: ", p), err) } + if err := p.VertexID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tag_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updated_props: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:insertable: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:return_props: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:condition: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateVertexRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - EdgeKey +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + EdgeKey *EdgeKey `thrift:"edge_key,3" db:"edge_key" json:"edge_key"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,4" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,5" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,6" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,7" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateEdgeRequest() *UpdateEdgeRequest { + return &UpdateEdgeRequest{} +} + + +func (p *UpdateEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateEdgeRequest_EdgeKey_DEFAULT *EdgeKey +func (p *UpdateEdgeRequest) GetEdgeKey() *EdgeKey { + if !p.IsSetEdgeKey() { + return UpdateEdgeRequest_EdgeKey_DEFAULT + } +return p.EdgeKey +} + +func (p *UpdateEdgeRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateEdgeRequest_Insertable_DEFAULT bool = false + +func (p *UpdateEdgeRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateEdgeRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateEdgeRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateEdgeRequest_Condition_DEFAULT []byte + +func (p *UpdateEdgeRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateEdgeRequest) IsSetEdgeKey() bool { + return p.EdgeKey != nil +} + +func (p *UpdateEdgeRequest) IsSetInsertable() bool { + return p.Insertable != UpdateEdgeRequest_Insertable_DEFAULT +} + +func (p *UpdateEdgeRequest) IsSetReturnProps() bool { + return p.ReturnProps != nil +} + +func (p *UpdateEdgeRequest) IsSetCondition() bool { + return p.Condition != nil +} + +func (p *UpdateEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField3(iprot thrift.Protocol) error { + p.EdgeKey = NewEdgeKey() + if err := p.EdgeKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeKey), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem43 := NewUpdatedProp() + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem43) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField6(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem44 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem44 = v +} + p.ReturnProps = append(p.ReturnProps, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_key", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_key: ", p), err) } + if err := p.EdgeKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_key: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:updated_props: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:insertable: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + 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 6:return_props: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:condition: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateEdgeRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Name +type GetUUIDReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Name []byte `thrift:"name,3" db:"name" json:"name"` +} + +func NewGetUUIDReq() *GetUUIDReq { + return &GetUUIDReq{} +} + + +func (p *GetUUIDReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetUUIDReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetUUIDReq) GetName() []byte { + return p.Name +} +func (p *GetUUIDReq) 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 *GetUUIDReq) 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 *GetUUIDReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *GetUUIDReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDReq"); 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 *GetUUIDReq) 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 *GetUUIDReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *GetUUIDReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUUIDReq(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Id +type GetUUIDResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Id *nebula0.Value `thrift:"id,2" db:"id" json:"id"` +} + +func NewGetUUIDResp() *GetUUIDResp { + return &GetUUIDResp{} +} + +var GetUUIDResp_Result__DEFAULT *ResponseCommon +func (p *GetUUIDResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetUUIDResp_Result__DEFAULT + } +return p.Result_ +} +var GetUUIDResp_Id_DEFAULT *nebula0.Value +func (p *GetUUIDResp) GetId() *nebula0.Value { + if !p.IsSetId() { + return GetUUIDResp_Id_DEFAULT + } +return p.Id +} +func (p *GetUUIDResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *GetUUIDResp) IsSetId() bool { + return p.Id != nil +} + +func (p *GetUUIDResp) 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 *GetUUIDResp) 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 *GetUUIDResp) ReadField2(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *GetUUIDResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDResp"); 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 *GetUUIDResp) 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 *GetUUIDResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *GetUUIDResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUUIDResp(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Data +type LookupIndexResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Data *nebula0.DataSet `thrift:"data,2" db:"data" json:"data,omitempty"` +} + +func NewLookupIndexResp() *LookupIndexResp { + return &LookupIndexResp{} +} + +var LookupIndexResp_Result__DEFAULT *ResponseCommon +func (p *LookupIndexResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return LookupIndexResp_Result__DEFAULT + } +return p.Result_ +} +var LookupIndexResp_Data_DEFAULT *nebula0.DataSet +func (p *LookupIndexResp) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return LookupIndexResp_Data_DEFAULT + } +return p.Data +} +func (p *LookupIndexResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *LookupIndexResp) IsSetData() bool { + return p.Data != nil +} + +func (p *LookupIndexResp) 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 *LookupIndexResp) 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 *LookupIndexResp) ReadField2(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *LookupIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexResp"); 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 *LookupIndexResp) 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 *LookupIndexResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupIndexResp(%+v)", *p) +} + +// Attributes: +// - ColumnName +// - ScanType +// - BeginValue +// - EndValue +type IndexColumnHint struct { + ColumnName []byte `thrift:"column_name,1" db:"column_name" json:"column_name"` + ScanType ScanType `thrift:"scan_type,2" db:"scan_type" json:"scan_type"` + BeginValue *nebula0.Value `thrift:"begin_value,3" db:"begin_value" json:"begin_value"` + EndValue *nebula0.Value `thrift:"end_value,4" db:"end_value" json:"end_value"` +} + +func NewIndexColumnHint() *IndexColumnHint { + return &IndexColumnHint{} +} + + +func (p *IndexColumnHint) GetColumnName() []byte { + return p.ColumnName +} + +func (p *IndexColumnHint) GetScanType() ScanType { + return p.ScanType +} +var IndexColumnHint_BeginValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetBeginValue() *nebula0.Value { + if !p.IsSetBeginValue() { + return IndexColumnHint_BeginValue_DEFAULT + } +return p.BeginValue +} +var IndexColumnHint_EndValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetEndValue() *nebula0.Value { + if !p.IsSetEndValue() { + return IndexColumnHint_EndValue_DEFAULT + } +return p.EndValue +} +func (p *IndexColumnHint) IsSetBeginValue() bool { + return p.BeginValue != nil +} + +func (p *IndexColumnHint) IsSetEndValue() bool { + return p.EndValue != nil +} + +func (p *IndexColumnHint) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *IndexColumnHint) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ScanType(v) + p.ScanType = temp +} + return nil +} + +func (p *IndexColumnHint) ReadField3(iprot thrift.Protocol) error { + p.BeginValue = nebula0.NewValue() + if err := p.BeginValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BeginValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField4(iprot thrift.Protocol) error { + p.EndValue = nebula0.NewValue() + if err := p.EndValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndValue), err) + } + return nil +} + +func (p *IndexColumnHint) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexColumnHint"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexColumnHint) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:column_name: ", p), err) } + if err := oprot.WriteBinary(p.ColumnName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.column_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_name: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("scan_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:scan_type: ", p), err) } + if err := oprot.WriteI32(int32(p.ScanType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.scan_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:scan_type: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("begin_value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:begin_value: ", p), err) } + if err := p.BeginValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BeginValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:begin_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:end_value: ", p), err) } + if err := p.EndValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:end_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexColumnHint(%+v)", *p) +} + +// Attributes: +// - IndexID +// - Filter +// - ColumnHints +type IndexQueryContext struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + Filter []byte `thrift:"filter,2" db:"filter" json:"filter"` + ColumnHints []*IndexColumnHint `thrift:"column_hints,3" db:"column_hints" json:"column_hints"` +} + +func NewIndexQueryContext() *IndexQueryContext { + return &IndexQueryContext{} +} + + +func (p *IndexQueryContext) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexQueryContext) GetFilter() []byte { + return p.Filter +} + +func (p *IndexQueryContext) GetColumnHints() []*IndexColumnHint { + return p.ColumnHints +} +func (p *IndexQueryContext) 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 *IndexQueryContext) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexQueryContext) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *IndexQueryContext) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexColumnHint, 0, size) + p.ColumnHints = tSlice + for i := 0; i < size; i ++ { + _elem45 := NewIndexColumnHint() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.ColumnHints = append(p.ColumnHints, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexQueryContext) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexQueryContext"); 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 *IndexQueryContext) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:filter: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_hints", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:column_hints: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColumnHints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnHints { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:column_hints: ", p), err) } + return err +} + +func (p *IndexQueryContext) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexQueryContext(%+v)", *p) +} + +// Attributes: +// - Contexts +// - IsEdge +// - TagOrEdgeID +type IndexSpec struct { + Contexts []*IndexQueryContext `thrift:"contexts,1,required" db:"contexts" json:"contexts"` + IsEdge bool `thrift:"is_edge,2,required" db:"is_edge" json:"is_edge"` + TagOrEdgeID int32 `thrift:"tag_or_edge_id,3,required" db:"tag_or_edge_id" json:"tag_or_edge_id"` +} + +func NewIndexSpec() *IndexSpec { + return &IndexSpec{} +} + + +func (p *IndexSpec) GetContexts() []*IndexQueryContext { + return p.Contexts +} + +func (p *IndexSpec) GetIsEdge() bool { + return p.IsEdge +} + +func (p *IndexSpec) GetTagOrEdgeID() int32 { + return p.TagOrEdgeID +} +func (p *IndexSpec) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetContexts bool = false; + var issetIsEdge bool = false; + var issetTagOrEdgeID 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 + } + issetContexts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetIsEdge = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTagOrEdgeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetContexts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Contexts is not set")); + } + if !issetIsEdge{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsEdge is not set")); + } + if !issetTagOrEdgeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagOrEdgeID is not set")); + } + return nil +} + +func (p *IndexSpec) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexQueryContext, 0, size) + p.Contexts = tSlice + for i := 0; i < size; i ++ { + _elem46 := NewIndexQueryContext() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Contexts = append(p.Contexts, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsEdge = v +} + return nil +} + +func (p *IndexSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagOrEdgeID = v +} + return nil +} + +func (p *IndexSpec) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexSpec"); 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 *IndexSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("contexts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:contexts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Contexts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Contexts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:contexts: ", p), err) } + return err +} + +func (p *IndexSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_edge", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_edge: ", p), err) } + if err := oprot.WriteBool(bool(p.IsEdge)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_edge (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_edge: ", p), err) } + return err +} + +func (p *IndexSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_or_edge_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_or_edge_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagOrEdgeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_or_edge_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_or_edge_id: ", p), err) } + return err +} + +func (p *IndexSpec) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexSpec(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - ReturnColumns +type LookupIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + ReturnColumns [][]byte `thrift:"return_columns,4" db:"return_columns" json:"return_columns,omitempty"` +} + +func NewLookupIndexRequest() *LookupIndexRequest { + return &LookupIndexRequest{} +} + + +func (p *LookupIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupIndexRequest_Indices_DEFAULT *IndexSpec +func (p *LookupIndexRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupIndexRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupIndexRequest_ReturnColumns_DEFAULT [][]byte + +func (p *LookupIndexRequest) GetReturnColumns() [][]byte { + return p.ReturnColumns +} +func (p *LookupIndexRequest) IsSetIndices() bool { + return p.Indices != nil +} + +func (p *LookupIndexRequest) IsSetReturnColumns() bool { + return p.ReturnColumns != nil +} + +func (p *LookupIndexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem47 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem47 = temp +} + p.Parts = append(p.Parts, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField4(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.ReturnColumns = tSlice + for i := 0; i < size; i ++ { +var _elem48 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem48 = v +} + p.ReturnColumns = append(p.ReturnColumns, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetReturnColumns() { + if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + 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 4:return_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupIndexRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - TraverseSpec +type LookupAndTraverseRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewLookupAndTraverseRequest() *LookupAndTraverseRequest { + return &LookupAndTraverseRequest{} +} + + +func (p *LookupAndTraverseRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupAndTraverseRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupAndTraverseRequest_Indices_DEFAULT *IndexSpec +func (p *LookupAndTraverseRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupAndTraverseRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupAndTraverseRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *LookupAndTraverseRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return LookupAndTraverseRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *LookupAndTraverseRequest) IsSetIndices() bool { + return p.Indices != nil +} + +func (p *LookupAndTraverseRequest) IsSetTraverseSpec() bool { + return p.TraverseSpec != nil +} + +func (p *LookupAndTraverseRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem49 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem49 = temp +} + p.Parts = append(p.Parts, _elem49) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupAndTraverseRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupAndTraverseRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *VertexProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanVertexRequest() *ScanVertexRequest { + return &ScanVertexRequest{ +EnableReadFromFollower: true, +} +} + + +func (p *ScanVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanVertexRequest_Cursor_DEFAULT []byte + +func (p *ScanVertexRequest) GetCursor() []byte { + return p.Cursor +} +var ScanVertexRequest_ReturnColumns_DEFAULT *VertexProp +func (p *ScanVertexRequest) GetReturnColumns() *VertexProp { + if !p.IsSetReturnColumns() { + return ScanVertexRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanVertexRequest) GetLimit() int64 { + return p.Limit +} +var ScanVertexRequest_StartTime_DEFAULT int64 +func (p *ScanVertexRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanVertexRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanVertexRequest_EndTime_DEFAULT int64 +func (p *ScanVertexRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanVertexRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanVertexRequest_Filter_DEFAULT []byte + +func (p *ScanVertexRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanVertexRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanVertexRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanVertexRequest) IsSetCursor() bool { + return p.Cursor != nil +} + +func (p *ScanVertexRequest) IsSetReturnColumns() bool { + return p.ReturnColumns != nil +} + +func (p *ScanVertexRequest) IsSetStartTime() bool { + return p.StartTime != nil +} + +func (p *ScanVertexRequest) IsSetEndTime() bool { + return p.EndTime != nil +} + +func (p *ScanVertexRequest) IsSetFilter() bool { + return p.Filter != nil +} + +func (p *ScanVertexRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanVertexRequest) 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 *ScanVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanVertexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewVertexProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexRequest) 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 *ScanVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanVertexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanVertexRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - VertexData +// - HasNext +// - NextCursor +type ScanVertexResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + VertexData *nebula0.DataSet `thrift:"vertex_data,2" db:"vertex_data" json:"vertex_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanVertexResponse() *ScanVertexResponse { + return &ScanVertexResponse{} +} + +var ScanVertexResponse_Result__DEFAULT *ResponseCommon +func (p *ScanVertexResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanVertexResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanVertexResponse_VertexData_DEFAULT *nebula0.DataSet +func (p *ScanVertexResponse) GetVertexData() *nebula0.DataSet { + if !p.IsSetVertexData() { + return ScanVertexResponse_VertexData_DEFAULT + } +return p.VertexData +} + +func (p *ScanVertexResponse) GetHasNext() bool { + return p.HasNext +} +var ScanVertexResponse_NextCursor_DEFAULT []byte + +func (p *ScanVertexResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanVertexResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *ScanVertexResponse) IsSetVertexData() bool { + return p.VertexData != nil +} + +func (p *ScanVertexResponse) IsSetNextCursor() bool { + return p.NextCursor != nil +} + +func (p *ScanVertexResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanVertexResponse) ReadField1(iprot thrift.Protocol) error { + p.Result_ = NewResponseCommon() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField2(iprot thrift.Protocol) error { + p.VertexData = nebula0.NewDataSet() + if err := p.VertexData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexData), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanVertexResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanVertexResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } + if err := p.Result_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertex_data: ", p), err) } + if err := p.VertexData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertex_data: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanVertexResponse(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *EdgeProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanEdgeRequest() *ScanEdgeRequest { + return &ScanEdgeRequest{ +EnableReadFromFollower: true, +} +} + + +func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanEdgeRequest_Cursor_DEFAULT []byte + +func (p *ScanEdgeRequest) GetCursor() []byte { + return p.Cursor +} +var ScanEdgeRequest_ReturnColumns_DEFAULT *EdgeProp +func (p *ScanEdgeRequest) GetReturnColumns() *EdgeProp { + if !p.IsSetReturnColumns() { + return ScanEdgeRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanEdgeRequest) GetLimit() int64 { + return p.Limit +} +var ScanEdgeRequest_StartTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanEdgeRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanEdgeRequest_EndTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanEdgeRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanEdgeRequest_Filter_DEFAULT []byte + +func (p *ScanEdgeRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanEdgeRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanEdgeRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanEdgeRequest) IsSetCursor() bool { + return p.Cursor != nil +} + +func (p *ScanEdgeRequest) IsSetReturnColumns() bool { + return p.ReturnColumns != nil +} + +func (p *ScanEdgeRequest) IsSetStartTime() bool { + return p.StartTime != nil +} + +func (p *ScanEdgeRequest) IsSetEndTime() bool { + return p.EndTime != nil +} + +func (p *ScanEdgeRequest) IsSetFilter() bool { + return p.Filter != nil +} + +func (p *ScanEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanEdgeRequest) 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 *ScanEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewEdgeProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeRequest) 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 *ScanEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanEdgeRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - EdgeData +// - HasNext +// - NextCursor +type ScanEdgeResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + EdgeData *nebula0.DataSet `thrift:"edge_data,2" db:"edge_data" json:"edge_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanEdgeResponse() *ScanEdgeResponse { + return &ScanEdgeResponse{} +} + +var ScanEdgeResponse_Result__DEFAULT *ResponseCommon +func (p *ScanEdgeResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanEdgeResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanEdgeResponse_EdgeData_DEFAULT *nebula0.DataSet +func (p *ScanEdgeResponse) GetEdgeData() *nebula0.DataSet { + if !p.IsSetEdgeData() { + return ScanEdgeResponse_EdgeData_DEFAULT + } +return p.EdgeData +} + +func (p *ScanEdgeResponse) GetHasNext() bool { + return p.HasNext +} +var ScanEdgeResponse_NextCursor_DEFAULT []byte + +func (p *ScanEdgeResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanEdgeResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *ScanEdgeResponse) IsSetEdgeData() bool { + return p.EdgeData != nil +} + +func (p *ScanEdgeResponse) IsSetNextCursor() bool { + return p.NextCursor != nil +} + +func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) ReadField2(iprot thrift.Protocol) error { + p.EdgeData = nebula0.NewDataSet() + if err := p.EdgeData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeData), err) + } + return nil +} + +func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanEdgeResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeResponse"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_data: ", p), err) } + if err := p.EdgeData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_data: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanEdgeResponse(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - TaskSpecficParas +type TaskPara struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts,omitempty"` + TaskSpecficParas [][]byte `thrift:"task_specfic_paras,3" db:"task_specfic_paras" json:"task_specfic_paras,omitempty"` +} + +func NewTaskPara() *TaskPara { + return &TaskPara{} +} + + +func (p *TaskPara) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var TaskPara_Parts_DEFAULT []nebula0.PartitionID + +func (p *TaskPara) GetParts() []nebula0.PartitionID { + return p.Parts +} +var TaskPara_TaskSpecficParas_DEFAULT [][]byte + +func (p *TaskPara) GetTaskSpecficParas() [][]byte { + return p.TaskSpecficParas +} +func (p *TaskPara) IsSetParts() bool { + return p.Parts != nil +} + +func (p *TaskPara) IsSetTaskSpecficParas() bool { + return p.TaskSpecficParas != nil +} + +func (p *TaskPara) 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 *TaskPara) 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 *TaskPara) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem50 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem50 = temp +} + p.Parts = append(p.Parts, _elem50) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) ReadField3(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.TaskSpecficParas = tSlice + for i := 0; i < size; i ++ { +var _elem51 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem51 = v +} + p.TaskSpecficParas = append(p.TaskSpecficParas, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskPara"); 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 *TaskPara) 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 *TaskPara) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetParts() { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + } + return err +} + +func (p *TaskPara) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskSpecficParas() { + if err := oprot.WriteFieldBegin("task_specfic_paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specfic_paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.TaskSpecficParas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskSpecficParas { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_specfic_paras: ", p), err) } + } + return err +} + +func (p *TaskPara) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TaskPara(%+v)", *p) +} + +// Attributes: +// - Cmd +// - JobID +// - TaskID +// - Para +// - Concurrency +type AddAdminTaskRequest struct { + Cmd meta1.AdminCmd `thrift:"cmd,1" db:"cmd" json:"cmd"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Para *TaskPara `thrift:"para,4" db:"para" json:"para"` + Concurrency *int32 `thrift:"concurrency,5" db:"concurrency" json:"concurrency,omitempty"` +} + +func NewAddAdminTaskRequest() *AddAdminTaskRequest { + return &AddAdminTaskRequest{} +} + + +func (p *AddAdminTaskRequest) GetCmd() meta1.AdminCmd { + return p.Cmd +} + +func (p *AddAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *AddAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +var AddAdminTaskRequest_Para_DEFAULT *TaskPara +func (p *AddAdminTaskRequest) GetPara() *TaskPara { + if !p.IsSetPara() { + return AddAdminTaskRequest_Para_DEFAULT + } +return p.Para +} +var AddAdminTaskRequest_Concurrency_DEFAULT int32 +func (p *AddAdminTaskRequest) GetConcurrency() int32 { + if !p.IsSetConcurrency() { + return AddAdminTaskRequest_Concurrency_DEFAULT + } +return *p.Concurrency +} +func (p *AddAdminTaskRequest) IsSetPara() bool { + return p.Para != nil +} + +func (p *AddAdminTaskRequest) IsSetConcurrency() bool { + return p.Concurrency != nil +} + +func (p *AddAdminTaskRequest) 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 + } + 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 *AddAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := meta1.AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField4(iprot thrift.Protocol) error { + p.Para = NewTaskPara() + if err := p.Para.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Para), err) + } + return nil +} + +func (p *AddAdminTaskRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Concurrency = &v +} + return nil +} + +func (p *AddAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddAdminTaskRequest"); 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 *AddAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("para", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:para: ", p), err) } + if err := p.Para.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Para), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:para: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetConcurrency() { + if err := oprot.WriteFieldBegin("concurrency", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:concurrency: ", p), err) } + if err := oprot.WriteI32(int32(*p.Concurrency)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.concurrency (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:concurrency: ", p), err) } + } + return err +} + +func (p *AddAdminTaskRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddAdminTaskRequest(%+v)", *p) +} + +// Attributes: +// - JobID +// - TaskID +type StopAdminTaskRequest struct { + JobID int32 `thrift:"job_id,1" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,2" db:"task_id" json:"task_id"` +} + +func NewStopAdminTaskRequest() *StopAdminTaskRequest { + return &StopAdminTaskRequest{} +} + + +func (p *StopAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *StopAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +func (p *StopAdminTaskRequest) 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 *StopAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *StopAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *StopAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StopAdminTaskRequest"); 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 *StopAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:task_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StopAdminTaskRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Statis +type AdminExecResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Statis *meta1.StatisItem `thrift:"statis,2" db:"statis" json:"statis,omitempty"` +} + +func NewAdminExecResp() *AdminExecResp { + return &AdminExecResp{} +} + +var AdminExecResp_Result__DEFAULT *ResponseCommon +func (p *AdminExecResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return AdminExecResp_Result__DEFAULT + } +return p.Result_ +} +var AdminExecResp_Statis_DEFAULT *meta1.StatisItem +func (p *AdminExecResp) GetStatis() *meta1.StatisItem { + if !p.IsSetStatis() { + return AdminExecResp_Statis_DEFAULT + } +return p.Statis +} +func (p *AdminExecResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *AdminExecResp) IsSetStatis() bool { + return p.Statis != nil +} + +func (p *AdminExecResp) 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 *AdminExecResp) 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 *AdminExecResp) ReadField2(iprot thrift.Protocol) error { + p.Statis = meta1.NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *AdminExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminExecResp"); 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 *AdminExecResp) 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 *AdminExecResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statis: ", p), err) } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statis: ", p), err) } + } + return err +} + +func (p *AdminExecResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminExecResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - NewLeader_ +type TransLeaderReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + NewLeader_ *nebula0.HostAddr `thrift:"new_leader,3" db:"new_leader" json:"new_leader"` +} + +func NewTransLeaderReq() *TransLeaderReq { + return &TransLeaderReq{} +} + + +func (p *TransLeaderReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *TransLeaderReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var TransLeaderReq_NewLeader__DEFAULT *nebula0.HostAddr +func (p *TransLeaderReq) GetNewLeader_() *nebula0.HostAddr { + if !p.IsSetNewLeader_() { + return TransLeaderReq_NewLeader__DEFAULT + } +return p.NewLeader_ +} +func (p *TransLeaderReq) IsSetNewLeader_() bool { + return p.NewLeader_ != nil +} + +func (p *TransLeaderReq) 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 *TransLeaderReq) 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 *TransLeaderReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField3(iprot thrift.Protocol) error { + p.NewLeader_ = nebula0.NewHostAddr() + if err := p.NewLeader_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewLeader_), err) + } + return nil +} + +func (p *TransLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TransLeaderReq"); 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 *TransLeaderReq) 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 *TransLeaderReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_leader: ", p), err) } + if err := p.NewLeader_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewLeader_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_leader: ", p), err) } + return err +} + +func (p *TransLeaderReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TransLeaderReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - AsLearner +// - Peers +type AddPartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + AsLearner bool `thrift:"as_learner,3" db:"as_learner" json:"as_learner"` + Peers []*nebula0.HostAddr `thrift:"peers,4" db:"peers" json:"peers"` +} + +func NewAddPartReq() *AddPartReq { + return &AddPartReq{} +} + + +func (p *AddPartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddPartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *AddPartReq) GetAsLearner() bool { + return p.AsLearner +} + +func (p *AddPartReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *AddPartReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddPartReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.AsLearner = v +} + return nil +} + +func (p *AddPartReq) ReadField4(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Peers = append(p.Peers, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddPartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddPartReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("as_learner", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:as_learner: ", p), err) } + if err := oprot.WriteBool(bool(p.AsLearner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.as_learner (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:as_learner: ", p), err) } + return err +} + +func (p *AddPartReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:peers: ", p), err) } + return err +} + +func (p *AddPartReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddPartReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Learner +type AddLearnerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Learner *nebula0.HostAddr `thrift:"learner,3" db:"learner" json:"learner"` +} + +func NewAddLearnerReq() *AddLearnerReq { + return &AddLearnerReq{} +} + + +func (p *AddLearnerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddLearnerReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var AddLearnerReq_Learner_DEFAULT *nebula0.HostAddr +func (p *AddLearnerReq) GetLearner() *nebula0.HostAddr { + if !p.IsSetLearner() { + return AddLearnerReq_Learner_DEFAULT + } +return p.Learner +} +func (p *AddLearnerReq) IsSetLearner() bool { + return p.Learner != nil +} + +func (p *AddLearnerReq) 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 *AddLearnerReq) 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 *AddLearnerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField3(iprot thrift.Protocol) error { + p.Learner = nebula0.NewHostAddr() + if err := p.Learner.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Learner), err) + } + return nil +} + +func (p *AddLearnerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddLearnerReq"); 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 *AddLearnerReq) 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 *AddLearnerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("learner", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:learner: ", p), err) } + if err := p.Learner.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Learner), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:learner: ", p), err) } + return err +} + +func (p *AddLearnerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddLearnerReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +type RemovePartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` +} + +func NewRemovePartReq() *RemovePartReq { + return &RemovePartReq{} +} + + +func (p *RemovePartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemovePartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +func (p *RemovePartReq) 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 *RemovePartReq) 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 *RemovePartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *RemovePartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemovePartReq"); 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 *RemovePartReq) 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 *RemovePartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *RemovePartReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemovePartReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peer +// - Add +type MemberChangeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peer *nebula0.HostAddr `thrift:"peer,3" db:"peer" json:"peer"` + Add bool `thrift:"add,4" db:"add" json:"add"` +} + +func NewMemberChangeReq() *MemberChangeReq { + return &MemberChangeReq{} +} + + +func (p *MemberChangeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *MemberChangeReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var MemberChangeReq_Peer_DEFAULT *nebula0.HostAddr +func (p *MemberChangeReq) GetPeer() *nebula0.HostAddr { + if !p.IsSetPeer() { + return MemberChangeReq_Peer_DEFAULT + } +return p.Peer +} + +func (p *MemberChangeReq) GetAdd() bool { + return p.Add +} +func (p *MemberChangeReq) IsSetPeer() bool { + return p.Peer != nil +} + +func (p *MemberChangeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField3(iprot thrift.Protocol) error { + p.Peer = nebula0.NewHostAddr() + if err := p.Peer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Peer), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Add = v +} + return nil +} + +func (p *MemberChangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MemberChangeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peer", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peer: ", p), err) } + if err := p.Peer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Peer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peer: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("add", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:add: ", p), err) } + if err := oprot.WriteBool(bool(p.Add)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.add (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:add: ", p), err) } + return err +} + +func (p *MemberChangeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MemberChangeReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Target +type CatchUpDataReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Target *nebula0.HostAddr `thrift:"target,3" db:"target" json:"target"` +} + +func NewCatchUpDataReq() *CatchUpDataReq { + return &CatchUpDataReq{} +} + + +func (p *CatchUpDataReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CatchUpDataReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var CatchUpDataReq_Target_DEFAULT *nebula0.HostAddr +func (p *CatchUpDataReq) GetTarget() *nebula0.HostAddr { + if !p.IsSetTarget() { + return CatchUpDataReq_Target_DEFAULT + } +return p.Target +} +func (p *CatchUpDataReq) IsSetTarget() bool { + return p.Target != nil +} + +func (p *CatchUpDataReq) 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 *CatchUpDataReq) 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 *CatchUpDataReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField3(iprot thrift.Protocol) error { + p.Target = nebula0.NewHostAddr() + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *CatchUpDataReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CatchUpDataReq"); 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 *CatchUpDataReq) 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 *CatchUpDataReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target: ", p), err) } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target: ", p), err) } + return err +} + +func (p *CatchUpDataReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CatchUpDataReq(%+v)", *p) +} + +type GetLeaderReq struct { +} + +func NewGetLeaderReq() *GetLeaderReq { + return &GetLeaderReq{} +} + +func (p *GetLeaderReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetLeaderReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Name +type CreateCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewCreateCPRequest() *CreateCPRequest { + return &CreateCPRequest{} +} + + +func (p *CreateCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateCPRequest) GetName() []byte { + return p.Name +} +func (p *CreateCPRequest) 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 *CreateCPRequest) 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 *CreateCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *CreateCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPRequest"); 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 *CreateCPRequest) 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 *CreateCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *CreateCPRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateCPRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Name +type DropCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewDropCPRequest() *DropCPRequest { + return &DropCPRequest{} +} + + +func (p *DropCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropCPRequest) GetName() []byte { + return p.Name +} +func (p *DropCPRequest) 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 *DropCPRequest) 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 *DropCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *DropCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropCPRequest"); 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 *DropCPRequest) 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 *DropCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *DropCPRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropCPRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Sign +type BlockingSignRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` +} + +func NewBlockingSignRequest() *BlockingSignRequest { + return &BlockingSignRequest{} +} + + +func (p *BlockingSignRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *BlockingSignRequest) GetSign() EngineSignType { + return p.Sign +} +func (p *BlockingSignRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSign 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 + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetSign = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetSign{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Sign is not set")); + } + return nil +} + +func (p *BlockingSignRequest) 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 *BlockingSignRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EngineSignType(v) + p.Sign = temp +} + return nil +} + +func (p *BlockingSignRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BlockingSignRequest"); 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 *BlockingSignRequest) 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 *BlockingSignRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sign", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sign: ", p), err) } + if err := oprot.WriteI32(int32(p.Sign)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sign (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sign: ", p), err) } + return err +} + +func (p *BlockingSignRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BlockingSignRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - LeaderParts +type GetLeaderPartsResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + LeaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` +} + +func NewGetLeaderPartsResp() *GetLeaderPartsResp { + return &GetLeaderPartsResp{} +} + +var GetLeaderPartsResp_Result__DEFAULT *ResponseCommon +func (p *GetLeaderPartsResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetLeaderPartsResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula0.GraphSpaceID][]nebula0.PartitionID { + return p.LeaderParts +} +func (p *GetLeaderPartsResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *GetLeaderPartsResp) 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key53 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key53 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val54 := tSlice + for i := 0; i < size; i ++ { +var _elem55 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem55 = temp +} + _val54 = append(_val54, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key53] = _val54 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetLeaderPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderPartsResp"); 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + 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.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader_parts: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetLeaderPartsResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peers +type CheckPeersReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peers []*nebula0.HostAddr `thrift:"peers,3" db:"peers" json:"peers"` +} + +func NewCheckPeersReq() *CheckPeersReq { + return &CheckPeersReq{} +} + + +func (p *CheckPeersReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CheckPeersReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *CheckPeersReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *CheckPeersReq) 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 *CheckPeersReq) 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 *CheckPeersReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem56 := nebula0.NewHostAddr() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Peers = append(p.Peers, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckPeersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckPeersReq"); 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 *CheckPeersReq) 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 *CheckPeersReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *CheckPeersReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckPeersReq(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - IndexID +type RebuildIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts"` + IndexID nebula0.IndexID `thrift:"index_id,3" db:"index_id" json:"index_id"` +} + +func NewRebuildIndexRequest() *RebuildIndexRequest { + return &RebuildIndexRequest{} +} + + +func (p *RebuildIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} + +func (p *RebuildIndexRequest) GetIndexID() nebula0.IndexID { + return p.IndexID +} +func (p *RebuildIndexRequest) 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem57 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem57 = temp +} + p.Parts = append(p.Parts, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *RebuildIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexRequest"); 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RebuildIndexRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Path +type CreateCPResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Path []byte `thrift:"path,2" db:"path" json:"path"` +} + +func NewCreateCPResp() *CreateCPResp { + return &CreateCPResp{} +} + +var CreateCPResp_Result__DEFAULT *ResponseCommon +func (p *CreateCPResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return CreateCPResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *CreateCPResp) GetPath() []byte { + return p.Path +} +func (p *CreateCPResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *CreateCPResp) 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 *CreateCPResp) 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 *CreateCPResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Path = v +} + return nil +} + +func (p *CreateCPResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPResp"); 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 *CreateCPResp) 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 *CreateCPResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) } + if err := oprot.WriteBinary(p.Path); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.path (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) } + return err +} + +func (p *CreateCPResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateCPResp(%+v)", *p) +} + +// Attributes: +// - Result_ +// - BackupName +// - PartitionInfo +type PartitionInfoResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + BackupName []byte `thrift:"backup_name,2" db:"backup_name" json:"backup_name"` + PartitionInfo *nebula0.PartitionBackupInfo `thrift:"partition_info,3" db:"partition_info" json:"partition_info"` +} + +func NewPartitionInfoResp() *PartitionInfoResp { + return &PartitionInfoResp{} +} + +var PartitionInfoResp_Result__DEFAULT *ResponseCommon +func (p *PartitionInfoResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return PartitionInfoResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *PartitionInfoResp) GetBackupName() []byte { + return p.BackupName +} +var PartitionInfoResp_PartitionInfo_DEFAULT *nebula0.PartitionBackupInfo +func (p *PartitionInfoResp) GetPartitionInfo() *nebula0.PartitionBackupInfo { + if !p.IsSetPartitionInfo() { + return PartitionInfoResp_PartitionInfo_DEFAULT + } +return p.PartitionInfo +} +func (p *PartitionInfoResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *PartitionInfoResp) IsSetPartitionInfo() bool { + return p.PartitionInfo != nil +} + +func (p *PartitionInfoResp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *PartitionInfoResp) 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 *PartitionInfoResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BackupName = v +} + return nil +} + +func (p *PartitionInfoResp) ReadField3(iprot thrift.Protocol) error { + p.PartitionInfo = nebula0.NewPartitionBackupInfo() + if err := p.PartitionInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionInfo), err) + } + return nil +} + +func (p *PartitionInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionInfoResp"); 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 *PartitionInfoResp) 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 *PartitionInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.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:backup_name: ", p), err) } + return err +} + +func (p *PartitionInfoResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_info", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:partition_info: ", p), err) } + if err := p.PartitionInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:partition_info: ", p), err) } + return err +} + +func (p *PartitionInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionInfoResp(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - BackupName +type PartitionInfoRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + BackupName []byte `thrift:"backup_name,2" db:"backup_name" json:"backup_name"` +} + +func NewPartitionInfoRequest() *PartitionInfoRequest { + return &PartitionInfoRequest{} +} + + +func (p *PartitionInfoRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *PartitionInfoRequest) GetBackupName() []byte { + return p.BackupName +} +func (p *PartitionInfoRequest) 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 *PartitionInfoRequest) 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 *PartitionInfoRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BackupName = v +} + return nil +} + +func (p *PartitionInfoRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionInfoRequest"); 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 *PartitionInfoRequest) 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 *PartitionInfoRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.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:backup_name: ", p), err) } + return err +} + +func (p *PartitionInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionInfoRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +// - ReturnPartly +type KVGetRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` + ReturnPartly bool `thrift:"return_partly,3" db:"return_partly" json:"return_partly"` +} + +func NewKVGetRequest() *KVGetRequest { + return &KVGetRequest{} +} + + +func (p *KVGetRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVGetRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} + +func (p *KVGetRequest) GetReturnPartly() bool { + return p.ReturnPartly +} +func (p *KVGetRequest) 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 *KVGetRequest) 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 *KVGetRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key58 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key58 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val59 := tSlice + for i := 0; i < size; i ++ { +var _elem60 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem60 = v +} + _val59 = append(_val59, _elem60) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key58] = _val59 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReturnPartly = v +} + return nil +} + +func (p *KVGetRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetRequest"); 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 *KVGetRequest) 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 *KVGetRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_partly", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_partly: ", p), err) } + if err := oprot.WriteBool(bool(p.ReturnPartly)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_partly (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_partly: ", p), err) } + return err +} + +func (p *KVGetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVGetRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - KeyValues +type KVGetResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + KeyValues map[string][]byte `thrift:"key_values,2" db:"key_values" json:"key_values"` +} + +func NewKVGetResponse() *KVGetResponse { + return &KVGetResponse{} +} + +var KVGetResponse_Result__DEFAULT *ResponseCommon +func (p *KVGetResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return KVGetResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *KVGetResponse) GetKeyValues() map[string][]byte { + return p.KeyValues +} +func (p *KVGetResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *KVGetResponse) 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 *KVGetResponse) 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 *KVGetResponse) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.KeyValues = tMap + for i := 0; i < size; i ++ { +var _key61 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key61 = v +} +var _val62 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val62 = v +} + p.KeyValues[_key61] = _val62 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetResponse"); 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 *KVGetResponse) 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 *KVGetResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key_values", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key_values: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.KeyValues)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KeyValues { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key_values: ", p), err) } + return err +} + +func (p *KVGetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVGetResponse(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +type KVPutRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.KeyValue `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVPutRequest() *KVPutRequest { + return &KVPutRequest{} +} + + +func (p *KVPutRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVPutRequest) GetParts() map[nebula0.PartitionID][]*nebula0.KeyValue { + return p.Parts +} +func (p *KVPutRequest) 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 *KVPutRequest) 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 *KVPutRequest) 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.KeyValue, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key63 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key63 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + _val64 := tSlice + for i := 0; i < size; i ++ { + _elem65 := nebula0.NewKeyValue() + if err := _elem65.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem65), err) + } + _val64 = append(_val64, _elem65) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key63] = _val64 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVPutRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVPutRequest"); 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 *KVPutRequest) 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 *KVPutRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *KVPutRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVPutRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - Parts +type KVRemoveRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVRemoveRequest() *KVRemoveRequest { + return &KVRemoveRequest{} +} + + +func (p *KVRemoveRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVRemoveRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} +func (p *KVRemoveRequest) 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key66 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key66 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val67 := tSlice + for i := 0; i < size; i ++ { +var _elem68 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem68 = v +} + _val67 = append(_val67, _elem68) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key66] = _val67 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVRemoveRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVRemoveRequest"); 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVRemoveRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVRemoveRequest(%+v)", *p) +} + +// Attributes: +// - TxnID +// - SpaceID +// - PartID +// - Position +// - Data +type InternalTxnRequest struct { + TxnID int64 `thrift:"txn_id,1" db:"txn_id" json:"txn_id"` + SpaceID int32 `thrift:"space_id,2" db:"space_id" json:"space_id"` + PartID int32 `thrift:"part_id,3" db:"part_id" json:"part_id"` + Position int32 `thrift:"position,4" db:"position" json:"position"` + Data [][][]byte `thrift:"data,5" db:"data" json:"data"` +} + +func NewInternalTxnRequest() *InternalTxnRequest { + return &InternalTxnRequest{} +} + + +func (p *InternalTxnRequest) GetTxnID() int64 { + return p.TxnID +} + +func (p *InternalTxnRequest) GetSpaceID() int32 { + return p.SpaceID +} + +func (p *InternalTxnRequest) GetPartID() int32 { + return p.PartID +} + +func (p *InternalTxnRequest) GetPosition() int32 { + return p.Position +} + +func (p *InternalTxnRequest) GetData() [][][]byte { + return p.Data +} +func (p *InternalTxnRequest) 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 + } + 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 *InternalTxnRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TxnID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.SpaceID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.PartID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Position = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField5(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.Data = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _elem69 := tSlice + for i := 0; i < size; i ++ { +var _elem70 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem70 = v +} + _elem69 = append(_elem69, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Data = append(p.Data, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *InternalTxnRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("InternalTxnRequest"); 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 *InternalTxnRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("txn_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:txn_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TxnID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.txn_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:txn_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("position", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:position: ", p), err) } + if err := oprot.WriteI32(int32(p.Position)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.position (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:position: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.LIST, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:data: ", p), err) } + return err +} + +func (p *InternalTxnRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalTxnRequest(%+v)", *p) +} + +// Attributes: +// - SpaceID +// - PartID +// - Key +type GetValueRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Key []byte `thrift:"key,3" db:"key" json:"key"` +} + +func NewGetValueRequest() *GetValueRequest { + return &GetValueRequest{} +} + + +func (p *GetValueRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetValueRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetValueRequest) GetKey() []byte { + return p.Key +} +func (p *GetValueRequest) 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 *GetValueRequest) 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 *GetValueRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetValueRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *GetValueRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueRequest"); 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 *GetValueRequest) 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 *GetValueRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetValueRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:key: ", p), err) } + return err +} + +func (p *GetValueRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetValueRequest(%+v)", *p) +} + +// Attributes: +// - Result_ +// - Value +type GetValueResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewGetValueResponse() *GetValueResponse { + return &GetValueResponse{} +} + +var GetValueResponse_Result__DEFAULT *ResponseCommon +func (p *GetValueResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetValueResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetValueResponse) GetValue() []byte { + return p.Value +} +func (p *GetValueResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *GetValueResponse) 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 *GetValueResponse) 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 *GetValueResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *GetValueResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueResponse"); 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 *GetValueResponse) 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 *GetValueResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *GetValueResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetValueResponse(%+v)", *p) +} + diff --git a/ccore/nebula/internal/thrift/v2_0_0/ttypes.go b/ccore/nebula/internal/thrift/v2_0_0/ttypes.go new file mode 100644 index 0000000..d393869 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_0_0/ttypes.go @@ -0,0 +1,3365 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal + +var GoUnusedProtection__ int; + +type NullType int64 +const ( + NullType___NULL__ NullType = 0 + NullType_NaN NullType = 1 + NullType_BAD_DATA NullType = 2 + NullType_BAD_TYPE NullType = 3 + NullType_ERR_OVERFLOW NullType = 4 + NullType_UNKNOWN_PROP NullType = 5 + NullType_DIV_BY_ZERO NullType = 6 + NullType_OUT_OF_RANGE NullType = 7 +) + +var NullTypeToName = map[NullType]string { + NullType___NULL__: "__NULL__", + NullType_NaN: "NaN", + NullType_BAD_DATA: "BAD_DATA", + NullType_BAD_TYPE: "BAD_TYPE", + NullType_ERR_OVERFLOW: "ERR_OVERFLOW", + NullType_UNKNOWN_PROP: "UNKNOWN_PROP", + NullType_DIV_BY_ZERO: "DIV_BY_ZERO", + NullType_OUT_OF_RANGE: "OUT_OF_RANGE", +} + +var NullTypeToValue = map[string]NullType { + "__NULL__": NullType___NULL__, + "NaN": NullType_NaN, + "BAD_DATA": NullType_BAD_DATA, + "BAD_TYPE": NullType_BAD_TYPE, + "ERR_OVERFLOW": NullType_ERR_OVERFLOW, + "UNKNOWN_PROP": NullType_UNKNOWN_PROP, + "DIV_BY_ZERO": NullType_DIV_BY_ZERO, + "OUT_OF_RANGE": NullType_OUT_OF_RANGE, +} + +func (p NullType) String() string { + if v, ok := NullTypeToName[p]; ok { + return v + } + return "" +} + +func NullTypeFromString(s string) (NullType, error) { + if v, ok := NullTypeToValue[s]; ok { + return v, nil + } + return NullType(0), fmt.Errorf("not a valid NullType string") +} + +func NullTypePtr(v NullType) *NullType { return &v } + +type GraphSpaceID int32 + +func GraphSpaceIDPtr(v GraphSpaceID) *GraphSpaceID { return &v } + +type PartitionID int32 + +func PartitionIDPtr(v PartitionID) *PartitionID { return &v } + +type TagID int32 + +func TagIDPtr(v TagID) *TagID { return &v } + +type EdgeType int32 + +func EdgeTypePtr(v EdgeType) *EdgeType { return &v } + +type EdgeRanking int64 + +func EdgeRankingPtr(v EdgeRanking) *EdgeRanking { return &v } + +type LogID int64 + +func LogIDPtr(v LogID) *LogID { return &v } + +type TermID int64 + +func TermIDPtr(v TermID) *TermID { return &v } + +type Timestamp int64 + +func TimestampPtr(v Timestamp) *Timestamp { return &v } + +type IndexID int32 + +func IndexIDPtr(v IndexID) *IndexID { return &v } + +type Port int32 + +func PortPtr(v Port) *Port { return &v } + +type SessionID int64 + +func SessionIDPtr(v SessionID) *SessionID { return &v } + +// Attributes: +// - Year +// - Month +// - Day +type Date struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` +} + +func NewDate() *Date { + return &Date{} +} + + +func (p *Date) GetYear() int16 { + return p.Year +} + +func (p *Date) GetMonth() int8 { + return p.Month +} + +func (p *Date) GetDay() int8 { + return p.Day +} +func (p *Date) 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 *Date) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *Date) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *Date) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *Date) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Date"); 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 *Date) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *Date) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *Date) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *Date) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Date(%+v)", *p) +} + +// Attributes: +// - Hour +// - Minute +// - Sec +// - Microsec +type Time struct { + Hour int8 `thrift:"hour,1" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,2" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,3" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,4" db:"microsec" json:"microsec"` +} + +func NewTime() *Time { + return &Time{} +} + + +func (p *Time) GetHour() int8 { + return p.Hour +} + +func (p *Time) GetMinute() int8 { + return p.Minute +} + +func (p *Time) GetSec() int8 { + return p.Sec +} + +func (p *Time) GetMicrosec() int32 { + return p.Microsec +} +func (p *Time) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Time) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *Time) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *Time) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *Time) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *Time) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Time"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Time) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hour: ", p), err) } + return err +} + +func (p *Time) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:minute: ", p), err) } + return err +} + +func (p *Time) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sec: ", p), err) } + return err +} + +func (p *Time) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:microsec: ", p), err) } + return err +} + +func (p *Time) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Time(%+v)", *p) +} + +// Attributes: +// - Year +// - Month +// - Day +// - Hour +// - Minute +// - Sec +// - Microsec +type DateTime struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` + Hour int8 `thrift:"hour,4" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,5" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,6" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,7" db:"microsec" json:"microsec"` +} + +func NewDateTime() *DateTime { + return &DateTime{} +} + + +func (p *DateTime) GetYear() int16 { + return p.Year +} + +func (p *DateTime) GetMonth() int8 { + return p.Month +} + +func (p *DateTime) GetDay() int8 { + return p.Day +} + +func (p *DateTime) GetHour() int8 { + return p.Hour +} + +func (p *DateTime) GetMinute() int8 { + return p.Minute +} + +func (p *DateTime) GetSec() int8 { + return p.Sec +} + +func (p *DateTime) GetMicrosec() int32 { + return p.Microsec +} +func (p *DateTime) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DateTime) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *DateTime) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *DateTime) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *DateTime) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *DateTime) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *DateTime) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *DateTime) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *DateTime) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DateTime"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DateTime) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *DateTime) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *DateTime) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *DateTime) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hour: ", p), err) } + return err +} + +func (p *DateTime) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minute: ", p), err) } + return err +} + +func (p *DateTime) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sec: ", p), err) } + return err +} + +func (p *DateTime) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:microsec: ", p), err) } + return err +} + +func (p *DateTime) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DateTime(%+v)", *p) +} + +// Attributes: +// - NVal +// - BVal +// - IVal +// - FVal +// - SVal +// - DVal +// - TVal +// - DtVal +// - VVal +// - EVal +// - PVal +// - LVal +// - MVal +// - UVal +// - GVal +type Value struct { + NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` + BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` + IVal *int64 `thrift:"iVal,3" db:"iVal" json:"iVal,omitempty"` + FVal *float64 `thrift:"fVal,4" db:"fVal" json:"fVal,omitempty"` + SVal []byte `thrift:"sVal,5" db:"sVal" json:"sVal,omitempty"` + DVal *Date `thrift:"dVal,6" db:"dVal" json:"dVal,omitempty"` + TVal *Time `thrift:"tVal,7" db:"tVal" json:"tVal,omitempty"` + DtVal *DateTime `thrift:"dtVal,8" db:"dtVal" json:"dtVal,omitempty"` + VVal *Vertex `thrift:"vVal,9" db:"vVal" json:"vVal,omitempty"` + EVal *Edge `thrift:"eVal,10" db:"eVal" json:"eVal,omitempty"` + PVal *Path `thrift:"pVal,11" db:"pVal" json:"pVal,omitempty"` + LVal *NList `thrift:"lVal,12" db:"lVal" json:"lVal,omitempty"` + MVal *NMap `thrift:"mVal,13" db:"mVal" json:"mVal,omitempty"` + UVal *NSet `thrift:"uVal,14" db:"uVal" json:"uVal,omitempty"` + GVal *DataSet `thrift:"gVal,15" db:"gVal" json:"gVal,omitempty"` +} + +func NewValue() *Value { + return &Value{} +} + +var Value_NVal_DEFAULT NullType +func (p *Value) GetNVal() NullType { + if !p.IsSetNVal() { + return Value_NVal_DEFAULT + } +return *p.NVal +} +var Value_BVal_DEFAULT bool +func (p *Value) GetBVal() bool { + if !p.IsSetBVal() { + return Value_BVal_DEFAULT + } +return *p.BVal +} +var Value_IVal_DEFAULT int64 +func (p *Value) GetIVal() int64 { + if !p.IsSetIVal() { + return Value_IVal_DEFAULT + } +return *p.IVal +} +var Value_FVal_DEFAULT float64 +func (p *Value) GetFVal() float64 { + if !p.IsSetFVal() { + return Value_FVal_DEFAULT + } +return *p.FVal +} +var Value_SVal_DEFAULT []byte + +func (p *Value) GetSVal() []byte { + return p.SVal +} +var Value_DVal_DEFAULT *Date +func (p *Value) GetDVal() *Date { + if !p.IsSetDVal() { + return Value_DVal_DEFAULT + } +return p.DVal +} +var Value_TVal_DEFAULT *Time +func (p *Value) GetTVal() *Time { + if !p.IsSetTVal() { + return Value_TVal_DEFAULT + } +return p.TVal +} +var Value_DtVal_DEFAULT *DateTime +func (p *Value) GetDtVal() *DateTime { + if !p.IsSetDtVal() { + return Value_DtVal_DEFAULT + } +return p.DtVal +} +var Value_VVal_DEFAULT *Vertex +func (p *Value) GetVVal() *Vertex { + if !p.IsSetVVal() { + return Value_VVal_DEFAULT + } +return p.VVal +} +var Value_EVal_DEFAULT *Edge +func (p *Value) GetEVal() *Edge { + if !p.IsSetEVal() { + return Value_EVal_DEFAULT + } +return p.EVal +} +var Value_PVal_DEFAULT *Path +func (p *Value) GetPVal() *Path { + if !p.IsSetPVal() { + return Value_PVal_DEFAULT + } +return p.PVal +} +var Value_LVal_DEFAULT *NList +func (p *Value) GetLVal() *NList { + if !p.IsSetLVal() { + return Value_LVal_DEFAULT + } +return p.LVal +} +var Value_MVal_DEFAULT *NMap +func (p *Value) GetMVal() *NMap { + if !p.IsSetMVal() { + return Value_MVal_DEFAULT + } +return p.MVal +} +var Value_UVal_DEFAULT *NSet +func (p *Value) GetUVal() *NSet { + if !p.IsSetUVal() { + return Value_UVal_DEFAULT + } +return p.UVal +} +var Value_GVal_DEFAULT *DataSet +func (p *Value) GetGVal() *DataSet { + if !p.IsSetGVal() { + return Value_GVal_DEFAULT + } +return p.GVal +} +func (p *Value) CountSetFieldsValue() int { + count := 0 + if (p.IsSetNVal()) { + count++ + } + if (p.IsSetBVal()) { + count++ + } + if (p.IsSetIVal()) { + count++ + } + if (p.IsSetFVal()) { + count++ + } + if (p.IsSetDVal()) { + count++ + } + if (p.IsSetTVal()) { + count++ + } + if (p.IsSetDtVal()) { + count++ + } + if (p.IsSetVVal()) { + count++ + } + if (p.IsSetEVal()) { + count++ + } + if (p.IsSetPVal()) { + count++ + } + if (p.IsSetLVal()) { + count++ + } + if (p.IsSetMVal()) { + count++ + } + if (p.IsSetUVal()) { + count++ + } + if (p.IsSetGVal()) { + count++ + } + return count + +} + +func (p *Value) IsSetNVal() bool { + return p.NVal != nil +} + +func (p *Value) IsSetBVal() bool { + return p.BVal != nil +} + +func (p *Value) IsSetIVal() bool { + return p.IVal != nil +} + +func (p *Value) IsSetFVal() bool { + return p.FVal != nil +} + +func (p *Value) IsSetSVal() bool { + return p.SVal != nil +} + +func (p *Value) IsSetDVal() bool { + return p.DVal != nil +} + +func (p *Value) IsSetTVal() bool { + return p.TVal != nil +} + +func (p *Value) IsSetDtVal() bool { + return p.DtVal != nil +} + +func (p *Value) IsSetVVal() bool { + return p.VVal != nil +} + +func (p *Value) IsSetEVal() bool { + return p.EVal != nil +} + +func (p *Value) IsSetPVal() bool { + return p.PVal != nil +} + +func (p *Value) IsSetLVal() bool { + return p.LVal != nil +} + +func (p *Value) IsSetMVal() bool { + return p.MVal != nil +} + +func (p *Value) IsSetUVal() bool { + return p.UVal != nil +} + +func (p *Value) IsSetGVal() bool { + return p.GVal != nil +} + +func (p *Value) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(iprot); err != nil { + return err + } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } + case 14: + if err := p.ReadField14(iprot); err != nil { + return err + } + case 15: + if err := p.ReadField15(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 *Value) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := NullType(v) + p.NVal = &temp +} + return nil +} + +func (p *Value) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BVal = &v +} + return nil +} + +func (p *Value) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IVal = &v +} + return nil +} + +func (p *Value) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FVal = &v +} + return nil +} + +func (p *Value) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SVal = v +} + return nil +} + +func (p *Value) ReadField6(iprot thrift.Protocol) error { + p.DVal = NewDate() + if err := p.DVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DVal), err) + } + return nil +} + +func (p *Value) ReadField7(iprot thrift.Protocol) error { + p.TVal = NewTime() + if err := p.TVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TVal), err) + } + return nil +} + +func (p *Value) ReadField8(iprot thrift.Protocol) error { + p.DtVal = NewDateTime() + if err := p.DtVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DtVal), err) + } + return nil +} + +func (p *Value) ReadField9(iprot thrift.Protocol) error { + p.VVal = NewVertex() + if err := p.VVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VVal), err) + } + return nil +} + +func (p *Value) ReadField10(iprot thrift.Protocol) error { + p.EVal = NewEdge() + if err := p.EVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EVal), err) + } + return nil +} + +func (p *Value) ReadField11(iprot thrift.Protocol) error { + p.PVal = NewPath() + if err := p.PVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PVal), err) + } + return nil +} + +func (p *Value) ReadField12(iprot thrift.Protocol) error { + p.LVal = NewNList() + if err := p.LVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LVal), err) + } + return nil +} + +func (p *Value) ReadField13(iprot thrift.Protocol) error { + p.MVal = NewNMap() + if err := p.MVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MVal), err) + } + return nil +} + +func (p *Value) ReadField14(iprot thrift.Protocol) error { + p.UVal = NewNSet() + if err := p.UVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UVal), err) + } + return nil +} + +func (p *Value) ReadField15(iprot thrift.Protocol) error { + p.GVal = NewDataSet() + if err := p.GVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GVal), err) + } + return nil +} + +func (p *Value) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("Value"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } + if err := p.writeField14(oprot); err != nil { return err } + if err := p.writeField15(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Value) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetNVal() { + if err := oprot.WriteFieldBegin("nVal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nVal: ", p), err) } + if err := oprot.WriteI32(int32(*p.NVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nVal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nVal: ", p), err) } + } + return err +} + +func (p *Value) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetBVal() { + if err := oprot.WriteFieldBegin("bVal", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bVal: ", p), err) } + if err := oprot.WriteBool(bool(*p.BVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bVal (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bVal: ", p), err) } + } + return err +} + +func (p *Value) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetIVal() { + if err := oprot.WriteFieldBegin("iVal", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:iVal: ", p), err) } + if err := oprot.WriteI64(int64(*p.IVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.iVal (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:iVal: ", p), err) } + } + return err +} + +func (p *Value) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetFVal() { + if err := oprot.WriteFieldBegin("fVal", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fVal: ", p), err) } + if err := oprot.WriteDouble(float64(*p.FVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fVal (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fVal: ", p), err) } + } + return err +} + +func (p *Value) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetSVal() { + if err := oprot.WriteFieldBegin("sVal", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sVal: ", p), err) } + if err := oprot.WriteBinary(p.SVal); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sVal (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sVal: ", p), err) } + } + return err +} + +func (p *Value) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetDVal() { + if err := oprot.WriteFieldBegin("dVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dVal: ", p), err) } + if err := p.DVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dVal: ", p), err) } + } + return err +} + +func (p *Value) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetTVal() { + if err := oprot.WriteFieldBegin("tVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tVal: ", p), err) } + if err := p.TVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tVal: ", p), err) } + } + return err +} + +func (p *Value) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetDtVal() { + if err := oprot.WriteFieldBegin("dtVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:dtVal: ", p), err) } + if err := p.DtVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DtVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:dtVal: ", p), err) } + } + return err +} + +func (p *Value) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetVVal() { + if err := oprot.WriteFieldBegin("vVal", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:vVal: ", p), err) } + if err := p.VVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:vVal: ", p), err) } + } + return err +} + +func (p *Value) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetEVal() { + if err := oprot.WriteFieldBegin("eVal", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:eVal: ", p), err) } + if err := p.EVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:eVal: ", p), err) } + } + return err +} + +func (p *Value) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetPVal() { + if err := oprot.WriteFieldBegin("pVal", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:pVal: ", p), err) } + if err := p.PVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:pVal: ", p), err) } + } + return err +} + +func (p *Value) writeField12(oprot thrift.Protocol) (err error) { + if p.IsSetLVal() { + if err := oprot.WriteFieldBegin("lVal", thrift.STRUCT, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:lVal: ", p), err) } + if err := p.LVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:lVal: ", p), err) } + } + return err +} + +func (p *Value) writeField13(oprot thrift.Protocol) (err error) { + if p.IsSetMVal() { + if err := oprot.WriteFieldBegin("mVal", thrift.STRUCT, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:mVal: ", p), err) } + if err := p.MVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:mVal: ", p), err) } + } + return err +} + +func (p *Value) writeField14(oprot thrift.Protocol) (err error) { + if p.IsSetUVal() { + if err := oprot.WriteFieldBegin("uVal", thrift.STRUCT, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:uVal: ", p), err) } + if err := p.UVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:uVal: ", p), err) } + } + return err +} + +func (p *Value) writeField15(oprot thrift.Protocol) (err error) { + if p.IsSetGVal() { + if err := oprot.WriteFieldBegin("gVal", thrift.STRUCT, 15); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:gVal: ", p), err) } + if err := p.GVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:gVal: ", p), err) } + } + return err +} + +func (p *Value) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Value(%+v)", *p) +} + +// Attributes: +// - Values +type NList struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNList() *NList { + return &NList{} +} + + +func (p *NList) GetValues() []*Value { + return p.Values +} +func (p *NList) 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 *NList) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem0 := NewValue() + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Values = append(p.Values, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NList) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NList"); 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 *NList) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NList) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NList(%+v)", *p) +} + +// Attributes: +// - Kvs +type NMap struct { + Kvs map[string]*Value `thrift:"kvs,1" db:"kvs" json:"kvs"` +} + +func NewNMap() *NMap { + return &NMap{} +} + + +func (p *NMap) GetKvs() map[string]*Value { + return p.Kvs +} +func (p *NMap) 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 *NMap) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Kvs = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} + _val2 := NewValue() + if err := _val2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val2), err) + } + p.Kvs[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *NMap) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NMap"); 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 *NMap) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kvs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Kvs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kvs: ", p), err) } + return err +} + +func (p *NMap) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NMap(%+v)", *p) +} + +// Attributes: +// - Values +type NSet struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNSet() *NSet { + return &NSet{} +} + + +func (p *NSet) GetValues() []*Value { + return p.Values +} +func (p *NSet) 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 *NSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*Value, 0, size) + p.Values = tSet + for i := 0; i < size; i ++ { + _elem3 := NewValue() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Values = append(p.Values, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *NSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NSet"); 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 *NSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.SET, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[*Value]bool, len(p.Values)) + for _, v := range p.Values { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NSet) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NSet(%+v)", *p) +} + +// Attributes: +// - Values +type Row struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewRow() *Row { + return &Row{} +} + + +func (p *Row) GetValues() []*Value { + return p.Values +} +func (p *Row) 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 *Row) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewValue() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Values = append(p.Values, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Row) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Row"); 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 *Row) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *Row) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Row(%+v)", *p) +} + +// Attributes: +// - ColumnNames +// - Rows +type DataSet struct { + ColumnNames [][]byte `thrift:"column_names,1" db:"column_names" json:"column_names"` + Rows []*Row `thrift:"rows,2" db:"rows" json:"rows"` +} + +func NewDataSet() *DataSet { + return &DataSet{} +} + + +func (p *DataSet) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *DataSet) GetRows() []*Row { + return p.Rows +} +func (p *DataSet) 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 *DataSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ColumnNames = tSlice + for i := 0; i < size; i ++ { +var _elem5 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.ColumnNames = append(p.ColumnNames, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Row, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewRow() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.Rows = append(p.Rows, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DataSet"); 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 *DataSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:column_names: ", p), err) } + return err +} + +func (p *DataSet) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + 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:rows: ", p), err) } + return err +} + +func (p *DataSet) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DataSet(%+v)", *p) +} + +// Attributes: +// - Name +// - Props +type Tag struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Props map[string]*Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewTag() *Tag { + return &Tag{} +} + + +func (p *Tag) GetName() []byte { + return p.Name +} + +func (p *Tag) GetProps() map[string]*Value { + return p.Props +} +func (p *Tag) 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 *Tag) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Tag) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} + _val8 := NewValue() + if err := _val8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val8), err) + } + p.Props[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Tag) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Tag"); 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 *Tag) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Tag) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Tag(%+v)", *p) +} + +// Attributes: +// - Vid +// - Tags +type Vertex struct { + Vid *Value `thrift:"vid,1" db:"vid" json:"vid"` + Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewVertex() *Vertex { + return &Vertex{} +} + +var Vertex_Vid_DEFAULT *Value +func (p *Vertex) GetVid() *Value { + if !p.IsSetVid() { + return Vertex_Vid_DEFAULT + } +return p.Vid +} + +func (p *Vertex) GetTags() []*Tag { + return p.Tags +} +func (p *Vertex) IsSetVid() bool { + return p.Vid != nil +} + +func (p *Vertex) 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 *Vertex) ReadField1(iprot thrift.Protocol) error { + p.Vid = NewValue() + if err := p.Vid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vid), err) + } + return nil +} + +func (p *Vertex) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewTag() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Tags = append(p.Tags, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Vertex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Vertex"); 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 *Vertex) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:vid: ", p), err) } + if err := p.Vid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:vid: ", p), err) } + return err +} + +func (p *Vertex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *Vertex) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Vertex(%+v)", *p) +} + +// Attributes: +// - Src +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Edge struct { + Src *Value `thrift:"src,1" db:"src" json:"src"` + Dst *Value `thrift:"dst,2" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,3" db:"type" json:"type"` + Name []byte `thrift:"name,4" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,5" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,6" db:"props" json:"props"` +} + +func NewEdge() *Edge { + return &Edge{} +} + +var Edge_Src_DEFAULT *Value +func (p *Edge) GetSrc() *Value { + if !p.IsSetSrc() { + return Edge_Src_DEFAULT + } +return p.Src +} +var Edge_Dst_DEFAULT *Value +func (p *Edge) GetDst() *Value { + if !p.IsSetDst() { + return Edge_Dst_DEFAULT + } +return p.Dst +} + +func (p *Edge) GetType() EdgeType { + return p.Type +} + +func (p *Edge) GetName() []byte { + return p.Name +} + +func (p *Edge) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Edge) GetProps() map[string]*Value { + return p.Props +} +func (p *Edge) IsSetSrc() bool { + return p.Src != nil +} + +func (p *Edge) IsSetDst() bool { + return p.Dst != nil +} + +func (p *Edge) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Edge) ReadField1(iprot thrift.Protocol) error { + p.Src = NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Edge) ReadField2(iprot thrift.Protocol) error { + p.Dst = NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Edge) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Edge) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Edge) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Edge) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} + _val11 := NewValue() + if err := _val11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val11), err) + } + p.Props[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Edge) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Edge"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Edge) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Edge) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dst: ", p), err) } + return err +} + +func (p *Edge) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *Edge) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:name: ", p), err) } + return err +} + +func (p *Edge) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ranking: ", p), err) } + return err +} + +func (p *Edge) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) } + return err +} + +func (p *Edge) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Edge(%+v)", *p) +} + +// Attributes: +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Step struct { + Dst *Vertex `thrift:"dst,1" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,2" db:"type" json:"type"` + Name []byte `thrift:"name,3" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,4" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,5" db:"props" json:"props"` +} + +func NewStep() *Step { + return &Step{} +} + +var Step_Dst_DEFAULT *Vertex +func (p *Step) GetDst() *Vertex { + if !p.IsSetDst() { + return Step_Dst_DEFAULT + } +return p.Dst +} + +func (p *Step) GetType() EdgeType { + return p.Type +} + +func (p *Step) GetName() []byte { + return p.Name +} + +func (p *Step) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Step) GetProps() map[string]*Value { + return p.Props +} +func (p *Step) IsSetDst() bool { + return p.Dst != nil +} + +func (p *Step) 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 + } + 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 *Step) ReadField1(iprot thrift.Protocol) error { + p.Dst = NewVertex() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Step) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Step) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Step) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Step) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key12 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key12 = v +} + _val13 := NewValue() + if err := _val13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val13), err) + } + p.Props[_key12] = _val13 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Step) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Step"); 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 *Step) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dst: ", p), err) } + return err +} + +func (p *Step) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *Step) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *Step) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ranking: ", p), err) } + return err +} + +func (p *Step) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:props: ", p), err) } + return err +} + +func (p *Step) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Step(%+v)", *p) +} + +// Attributes: +// - Src +// - Steps +type Path struct { + Src *Vertex `thrift:"src,1" db:"src" json:"src"` + Steps []*Step `thrift:"steps,2" db:"steps" json:"steps"` +} + +func NewPath() *Path { + return &Path{} +} + +var Path_Src_DEFAULT *Vertex +func (p *Path) GetSrc() *Vertex { + if !p.IsSetSrc() { + return Path_Src_DEFAULT + } +return p.Src +} + +func (p *Path) GetSteps() []*Step { + return p.Steps +} +func (p *Path) IsSetSrc() bool { + return p.Src != nil +} + +func (p *Path) 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 *Path) ReadField1(iprot thrift.Protocol) error { + p.Src = NewVertex() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Path) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Step, 0, size) + p.Steps = tSlice + for i := 0; i < size; i ++ { + _elem14 := NewStep() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + p.Steps = append(p.Steps, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Path) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Path"); 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 *Path) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Path) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("steps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:steps: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Steps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Steps { + 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:steps: ", p), err) } + return err +} + +func (p *Path) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Path(%+v)", *p) +} + +// Attributes: +// - Host +// - Port +type HostAddr struct { + Host string `thrift:"host,1" db:"host" json:"host"` + Port Port `thrift:"port,2" db:"port" json:"port"` +} + +func NewHostAddr() *HostAddr { + return &HostAddr{} +} + + +func (p *HostAddr) GetHost() string { + return p.Host +} + +func (p *HostAddr) GetPort() Port { + return p.Port +} +func (p *HostAddr) 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 *HostAddr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *HostAddr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := Port(v) + p.Port = temp +} + return nil +} + +func (p *HostAddr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostAddr"); 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 *HostAddr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteString(string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostAddr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } + if err := oprot.WriteI32(int32(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } + return err +} + +func (p *HostAddr) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostAddr(%+v)", *p) +} + +// Attributes: +// - Key +// - Value +type KeyValue struct { + Key []byte `thrift:"key,1" db:"key" json:"key"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewKeyValue() *KeyValue { + return &KeyValue{} +} + + +func (p *KeyValue) GetKey() []byte { + return p.Key +} + +func (p *KeyValue) GetValue() []byte { + return p.Value +} +func (p *KeyValue) 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 *KeyValue) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *KeyValue) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *KeyValue) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KeyValue"); 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 *KeyValue) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *KeyValue) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KeyValue(%+v)", *p) +} + +// Attributes: +// - LogID +// - TermID +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"` +} + +func NewLogInfo() *LogInfo { + return &LogInfo{} +} + + +func (p *LogInfo) GetLogID() LogID { + return p.LogID +} + +func (p *LogInfo) GetTermID() TermID { + return p.TermID +} +func (p *LogInfo) 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 *LogInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := LogID(v) + p.LogID = temp +} + return nil +} + +func (p *LogInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TermID(v) + p.TermID = temp +} + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("log_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:log_id: ", p), err) } + if err := oprot.WriteI64(int64(p.LogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TermID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_id: ", p), err) } + return err +} + +func (p *LogInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LogInfo(%+v)", *p) +} + +// Attributes: +// - Info +type PartitionBackupInfo struct { + Info map[PartitionID]*LogInfo `thrift:"info,1" db:"info" json:"info"` +} + +func NewPartitionBackupInfo() *PartitionBackupInfo { + return &PartitionBackupInfo{} +} + + +func (p *PartitionBackupInfo) GetInfo() map[PartitionID]*LogInfo { + return p.Info +} +func (p *PartitionBackupInfo) 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 *PartitionBackupInfo) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[PartitionID]*LogInfo, size) + p.Info = tMap + for i := 0; i < size; i ++ { +var _key15 PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := PartitionID(v) + _key15 = temp +} + _val16 := NewLogInfo() + if err := _val16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val16), err) + } + p.Info[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PartitionBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionBackupInfo"); 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 *PartitionBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Info { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) } + return err +} + +func (p *PartitionBackupInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionBackupInfo(%+v)", *p) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/constants.go b/ccore/nebula/internal/thrift/v2_5_0/constants.go new file mode 100644 index 0000000..2030b74 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/constants.go @@ -0,0 +1,25 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/graph/constants.go b/ccore/nebula/internal/thrift/v2_5_0/graph/constants.go new file mode 100644 index 0000000..ef0d38d --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/graph/constants.go @@ -0,0 +1,28 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/graph/graph_service-remote/graph_service-remote.go b/ccore/nebula/internal/thrift/v2_5_0/graph/graph_service-remote/graph_service-remote.go new file mode 100755 index 0000000..3ec7d03 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/graph/graph_service-remote/graph_service-remote.go @@ -0,0 +1,186 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/graph" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AuthResponse authenticate(string username, string password)") + fmt.Fprintln(os.Stderr, " void signout(i64 sessionId)") + fmt.Fprintln(os.Stderr, " ExecutionResponse execute(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " string executeJson(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := graph.NewGraphServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "authenticate": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Authenticate requires 2 args") + flag.Usage() + } + argvalue0 := []byte(flag.Arg(1)) + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Authenticate(value0, value1)) + fmt.Print("\n") + break + case "signout": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Signout requires 1 args") + flag.Usage() + } + argvalue0, err13 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err13 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Signout(value0)) + fmt.Print("\n") + break + case "execute": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Execute requires 2 args") + flag.Usage() + } + argvalue0, err14 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err14 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Execute(value0, value1)) + fmt.Print("\n") + break + case "executeJson": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "ExecuteJson requires 2 args") + flag.Usage() + } + argvalue0, err16 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err16 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.ExecuteJson(value0, value1)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/graph/graphservice.go b/ccore/nebula/internal/thrift/v2_5_0/graph/graphservice.go new file mode 100644 index 0000000..0684887 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/graph/graphservice.go @@ -0,0 +1,1328 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type GraphService interface { + // Parameters: + // - Username + // - Password + Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(ctx context.Context, sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) +} + +type GraphServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Username + // - Password + Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) +} + +type GraphServiceClient struct { + GraphServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceClientProtocol(prot thrift.Protocol) *GraphServiceClient { + return NewGraphServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceClient) Signout(sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceThreadsafeClient struct { + GraphServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphServiceThreadsafeClient { + return NewGraphServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceThreadsafeClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceThreadsafeClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceThreadsafeClient) Signout(sessionId int64) (err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceThreadsafeClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceThreadsafeClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphServiceChannelClient(channel thrift.RequestChannel) *GraphServiceChannelClient { + return &GraphServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceChannelClient) Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + var result GraphServiceAuthenticateResult + err = p.RequestChannel.Call(ctx, "authenticate", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceChannelClient) Signout(ctx context.Context, sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.RequestChannel.Oneway(ctx, "signout", &args) + if err != nil { return } + + return nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteResult + err = p.RequestChannel.Call(ctx, "execute", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteJsonResult + err = p.RequestChannel.Call(ctx, "executeJson", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphService +} + +func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { + self9 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self9.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} + self9.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} + self9.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} + self9.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} + return self9 +} + +type graphServiceProcessorAuthenticate struct { + handler GraphService +} + +func (p *graphServiceProcessorAuthenticate) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceAuthenticateArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorAuthenticate) 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("authenticate", 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 *graphServiceProcessorAuthenticate) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceAuthenticateArgs) + var result GraphServiceAuthenticateResult + if retval, err := p.handler.Authenticate(ctx, args.Username, args.Password); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing authenticate: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorSignout struct { + handler GraphService +} + +func (p *graphServiceProcessorSignout) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceSignoutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorSignout) 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("signout", 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 *graphServiceProcessorSignout) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceSignoutArgs) + if err := p.handler.Signout(ctx, args.SessionId); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signout: " + err.Error()) + return x, x + } + } + return nil, nil +} + +type graphServiceProcessorExecute struct { + handler GraphService +} + +func (p *graphServiceProcessorExecute) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecute) 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("execute", 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 *graphServiceProcessorExecute) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteArgs) + var result GraphServiceExecuteResult + if retval, err := p.handler.Execute(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing execute: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorExecuteJson struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJson) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteJsonArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecuteJson) 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("executeJson", 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 *graphServiceProcessorExecuteJson) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteJsonArgs) + var result GraphServiceExecuteJsonResult + if retval, err := p.handler.ExecuteJson(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJson: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Username +// - Password +type GraphServiceAuthenticateArgs struct { + thrift.IRequest + Username []byte `thrift:"username,1" db:"username" json:"username"` + Password []byte `thrift:"password,2" db:"password" json:"password"` +} + +func NewGraphServiceAuthenticateArgs() *GraphServiceAuthenticateArgs { + return &GraphServiceAuthenticateArgs{} +} + + +func (p *GraphServiceAuthenticateArgs) GetUsername() []byte { + return p.Username +} + +func (p *GraphServiceAuthenticateArgs) GetPassword() []byte { + return p.Password +} +func (p *GraphServiceAuthenticateArgs) 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 *GraphServiceAuthenticateArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Username = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Password = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 := 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 *GraphServiceAuthenticateArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("username", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:username: ", p), err) } + if err := oprot.WriteBinary(p.Username); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:username: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("password", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:password: ", p), err) } + if err := oprot.WriteBinary(p.Password); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:password: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) String() string { + if p == nil { + return "" + } + + usernameVal := fmt.Sprintf("%v", p.Username) + passwordVal := fmt.Sprintf("%v", p.Password) + return fmt.Sprintf("GraphServiceAuthenticateArgs({Username:%s Password:%s})", usernameVal, passwordVal) +} + +// Attributes: +// - Success +type GraphServiceAuthenticateResult struct { + thrift.IResponse + Success *AuthResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceAuthenticateResult() *GraphServiceAuthenticateResult { + return &GraphServiceAuthenticateResult{} +} + +var GraphServiceAuthenticateResult_Success_DEFAULT *AuthResponse +func (p *GraphServiceAuthenticateResult) GetSuccess() *AuthResponse { + if !p.IsSetSuccess() { + return GraphServiceAuthenticateResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceAuthenticateResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAuthResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceAuthenticateResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +type GraphServiceSignoutArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` +} + +func NewGraphServiceSignoutArgs() *GraphServiceSignoutArgs { + return &GraphServiceSignoutArgs{} +} + + +func (p *GraphServiceSignoutArgs) GetSessionId() int64 { + return p.SessionId +} +func (p *GraphServiceSignoutArgs) 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 *GraphServiceSignoutArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceSignoutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signout_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 *GraphServiceSignoutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceSignoutArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + return fmt.Sprintf("GraphServiceSignoutArgs({SessionId:%s})", sessionIdVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteArgs() *GraphServiceExecuteArgs { + return &GraphServiceExecuteArgs{} +} + + +func (p *GraphServiceExecuteArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteArgs) 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 *GraphServiceExecuteArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 := 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 *GraphServiceExecuteArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteResult struct { + thrift.IResponse + Success *ExecutionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteResult() *GraphServiceExecuteResult { + return &GraphServiceExecuteResult{} +} + +var GraphServiceExecuteResult_Success_DEFAULT *ExecutionResponse +func (p *GraphServiceExecuteResult) GetSuccess() *ExecutionResponse { + if !p.IsSetSuccess() { + return GraphServiceExecuteResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceExecuteResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecutionResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceExecuteResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteJsonArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteJsonArgs() *GraphServiceExecuteJsonArgs { + return &GraphServiceExecuteJsonArgs{} +} + + +func (p *GraphServiceExecuteJsonArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteJsonArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteJsonArgs) 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 *GraphServiceExecuteJsonArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 := 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 *GraphServiceExecuteJsonArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteJsonArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteJsonResult struct { + thrift.IResponse + Success []byte `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteJsonResult() *GraphServiceExecuteJsonResult { + return &GraphServiceExecuteJsonResult{} +} + +var GraphServiceExecuteJsonResult_Success_DEFAULT []byte + +func (p *GraphServiceExecuteJsonResult) GetSuccess() []byte { + return p.Success +} +func (p *GraphServiceExecuteJsonResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteJsonResult) 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 *GraphServiceExecuteJsonResult) ReadField0(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 *GraphServiceExecuteJsonResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteJsonResult) String() string { + if p == nil { + return "" + } + + successVal := fmt.Sprintf("%v", p.Success) + return fmt.Sprintf("GraphServiceExecuteJsonResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_0/graph/ttypes.go b/ccore/nebula/internal/thrift/v2_5_0/graph/ttypes.go new file mode 100644 index 0000000..cbeb7d4 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/graph/ttypes.go @@ -0,0 +1,1724 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +// Attributes: +// - Rows +// - ExecDurationInUs +// - TotalDurationInUs +// - OtherStats +type ProfilingStats struct { + Rows int64 `thrift:"rows,1,required" db:"rows" json:"rows"` + ExecDurationInUs int64 `thrift:"exec_duration_in_us,2,required" db:"exec_duration_in_us" json:"exec_duration_in_us"` + TotalDurationInUs int64 `thrift:"total_duration_in_us,3,required" db:"total_duration_in_us" json:"total_duration_in_us"` + OtherStats map[string][]byte `thrift:"other_stats,4" db:"other_stats" json:"other_stats,omitempty"` +} + +func NewProfilingStats() *ProfilingStats { + return &ProfilingStats{} +} + + +func (p *ProfilingStats) GetRows() int64 { + return p.Rows +} + +func (p *ProfilingStats) GetExecDurationInUs() int64 { + return p.ExecDurationInUs +} + +func (p *ProfilingStats) GetTotalDurationInUs() int64 { + return p.TotalDurationInUs +} +var ProfilingStats_OtherStats_DEFAULT map[string][]byte + +func (p *ProfilingStats) GetOtherStats() map[string][]byte { + return p.OtherStats +} +func (p *ProfilingStats) IsSetOtherStats() bool { + return p != nil && p.OtherStats != nil +} + +func (p *ProfilingStats) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRows bool = false; + var issetExecDurationInUs bool = false; + var issetTotalDurationInUs 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 + } + issetRows = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetExecDurationInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTotalDurationInUs = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRows{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetExecDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExecDurationInUs is not set")); + } + if !issetTotalDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TotalDurationInUs is not set")); + } + return nil +} + +func (p *ProfilingStats) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Rows = v +} + return nil +} + +func (p *ProfilingStats) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExecDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TotalDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.OtherStats = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.OtherStats[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ProfilingStats) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ProfilingStats"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ProfilingStats) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:rows: ", p), err) } + if err := oprot.WriteI64(int64(p.Rows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:rows: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("exec_duration_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:exec_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.ExecDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.exec_duration_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:exec_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("total_duration_in_us", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:total_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.TotalDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_duration_in_us (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:total_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetOtherStats() { + if err := oprot.WriteFieldBegin("other_stats", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:other_stats: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.OtherStats)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.OtherStats { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:other_stats: ", p), err) } + } + return err +} + +func (p *ProfilingStats) String() string { + if p == nil { + return "" + } + + rowsVal := fmt.Sprintf("%v", p.Rows) + execDurationInUsVal := fmt.Sprintf("%v", p.ExecDurationInUs) + totalDurationInUsVal := fmt.Sprintf("%v", p.TotalDurationInUs) + otherStatsVal := fmt.Sprintf("%v", p.OtherStats) + return fmt.Sprintf("ProfilingStats({Rows:%s ExecDurationInUs:%s TotalDurationInUs:%s OtherStats:%s})", rowsVal, execDurationInUsVal, totalDurationInUsVal, otherStatsVal) +} + +// Attributes: +// - IsDoBranch +// - ConditionNodeID +type PlanNodeBranchInfo struct { + IsDoBranch bool `thrift:"is_do_branch,1,required" db:"is_do_branch" json:"is_do_branch"` + ConditionNodeID int64 `thrift:"condition_node_id,2,required" db:"condition_node_id" json:"condition_node_id"` +} + +func NewPlanNodeBranchInfo() *PlanNodeBranchInfo { + return &PlanNodeBranchInfo{} +} + + +func (p *PlanNodeBranchInfo) GetIsDoBranch() bool { + return p.IsDoBranch +} + +func (p *PlanNodeBranchInfo) GetConditionNodeID() int64 { + return p.ConditionNodeID +} +func (p *PlanNodeBranchInfo) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetIsDoBranch bool = false; + var issetConditionNodeID 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 + } + issetIsDoBranch = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetConditionNodeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetIsDoBranch{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsDoBranch is not set")); + } + if !issetConditionNodeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ConditionNodeID is not set")); + } + return nil +} + +func (p *PlanNodeBranchInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.IsDoBranch = v +} + return nil +} + +func (p *PlanNodeBranchInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ConditionNodeID = v +} + return nil +} + +func (p *PlanNodeBranchInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeBranchInfo"); 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 *PlanNodeBranchInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_do_branch", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:is_do_branch: ", p), err) } + if err := oprot.WriteBool(bool(p.IsDoBranch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_do_branch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:is_do_branch: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("condition_node_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:condition_node_id: ", p), err) } + if err := oprot.WriteI64(int64(p.ConditionNodeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition_node_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:condition_node_id: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) String() string { + if p == nil { + return "" + } + + isDoBranchVal := fmt.Sprintf("%v", p.IsDoBranch) + conditionNodeIDVal := fmt.Sprintf("%v", p.ConditionNodeID) + return fmt.Sprintf("PlanNodeBranchInfo({IsDoBranch:%s ConditionNodeID:%s})", isDoBranchVal, conditionNodeIDVal) +} + +// Attributes: +// - Key +// - Value +type Pair struct { + Key []byte `thrift:"key,1,required" db:"key" json:"key"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewPair() *Pair { + return &Pair{} +} + + +func (p *Pair) GetKey() []byte { + return p.Key +} + +func (p *Pair) GetValue() []byte { + return p.Value +} +func (p *Pair) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKey bool = false; + var issetValue 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 + } + issetKey = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetKey{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *Pair) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *Pair) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *Pair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Pair"); 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 *Pair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *Pair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *Pair) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("Pair({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - Name +// - Id +// - OutputVar +// - Description +// - Profiles +// - BranchInfo +// - Dependencies +type PlanNodeDescription struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Id int64 `thrift:"id,2,required" db:"id" json:"id"` + OutputVar []byte `thrift:"output_var,3,required" db:"output_var" json:"output_var"` + Description []*Pair `thrift:"description,4" db:"description" json:"description,omitempty"` + Profiles []*ProfilingStats `thrift:"profiles,5" db:"profiles" json:"profiles,omitempty"` + BranchInfo *PlanNodeBranchInfo `thrift:"branch_info,6" db:"branch_info" json:"branch_info,omitempty"` + Dependencies []int64 `thrift:"dependencies,7" db:"dependencies" json:"dependencies,omitempty"` +} + +func NewPlanNodeDescription() *PlanNodeDescription { + return &PlanNodeDescription{} +} + + +func (p *PlanNodeDescription) GetName() []byte { + return p.Name +} + +func (p *PlanNodeDescription) GetId() int64 { + return p.Id +} + +func (p *PlanNodeDescription) GetOutputVar() []byte { + return p.OutputVar +} +var PlanNodeDescription_Description_DEFAULT []*Pair + +func (p *PlanNodeDescription) GetDescription() []*Pair { + return p.Description +} +var PlanNodeDescription_Profiles_DEFAULT []*ProfilingStats + +func (p *PlanNodeDescription) GetProfiles() []*ProfilingStats { + return p.Profiles +} +var PlanNodeDescription_BranchInfo_DEFAULT *PlanNodeBranchInfo +func (p *PlanNodeDescription) GetBranchInfo() *PlanNodeBranchInfo { + if !p.IsSetBranchInfo() { + return PlanNodeDescription_BranchInfo_DEFAULT + } +return p.BranchInfo +} +var PlanNodeDescription_Dependencies_DEFAULT []int64 + +func (p *PlanNodeDescription) GetDependencies() []int64 { + return p.Dependencies +} +func (p *PlanNodeDescription) IsSetDescription() bool { + return p != nil && p.Description != nil +} + +func (p *PlanNodeDescription) IsSetProfiles() bool { + return p != nil && p.Profiles != nil +} + +func (p *PlanNodeDescription) IsSetBranchInfo() bool { + return p != nil && p.BranchInfo != nil +} + +func (p *PlanNodeDescription) IsSetDependencies() bool { + return p != nil && p.Dependencies != nil +} + +func (p *PlanNodeDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetId bool = false; + var issetOutputVar 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetId = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetOutputVar = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetId{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Id is not set")); + } + if !issetOutputVar{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OutputVar is not set")); + } + return nil +} + +func (p *PlanNodeDescription) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OutputVar = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Pair, 0, size) + p.Description = tSlice + for i := 0; i < size; i ++ { + _elem3 := NewPair() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Description = append(p.Description, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ProfilingStats, 0, size) + p.Profiles = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewProfilingStats() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Profiles = append(p.Profiles, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField6(iprot thrift.Protocol) error { + p.BranchInfo = NewPlanNodeBranchInfo() + if err := p.BranchInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BranchInfo), err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Dependencies = tSlice + for i := 0; i < size; i ++ { +var _elem5 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Dependencies = append(p.Dependencies, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeDescription"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeDescription) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("output_var", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:output_var: ", p), err) } + if err := oprot.WriteBinary(p.OutputVar); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.output_var (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:output_var: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetDescription() { + if err := oprot.WriteFieldBegin("description", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:description: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Description)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Description { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:description: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetProfiles() { + if err := oprot.WriteFieldBegin("profiles", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:profiles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Profiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Profiles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:profiles: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetBranchInfo() { + if err := oprot.WriteFieldBegin("branch_info", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:branch_info: ", p), err) } + if err := p.BranchInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BranchInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:branch_info: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetDependencies() { + if err := oprot.WriteFieldBegin("dependencies", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dependencies: ", p), err) } + if err := oprot.WriteListBegin(thrift.I64, len(p.Dependencies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dependencies { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dependencies: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + idVal := fmt.Sprintf("%v", p.Id) + outputVarVal := fmt.Sprintf("%v", p.OutputVar) + descriptionVal := fmt.Sprintf("%v", p.Description) + profilesVal := fmt.Sprintf("%v", p.Profiles) + var branchInfoVal string + if p.BranchInfo == nil { + branchInfoVal = "" + } else { + branchInfoVal = fmt.Sprintf("%v", p.BranchInfo) + } + dependenciesVal := fmt.Sprintf("%v", p.Dependencies) + return fmt.Sprintf("PlanNodeDescription({Name:%s Id:%s OutputVar:%s Description:%s Profiles:%s BranchInfo:%s Dependencies:%s})", nameVal, idVal, outputVarVal, descriptionVal, profilesVal, branchInfoVal, dependenciesVal) +} + +// Attributes: +// - PlanNodeDescs +// - NodeIndexMap +// - Format +// - OptimizeTimeInUs +type PlanDescription struct { + PlanNodeDescs []*PlanNodeDescription `thrift:"plan_node_descs,1,required" db:"plan_node_descs" json:"plan_node_descs"` + NodeIndexMap map[int64]int64 `thrift:"node_index_map,2,required" db:"node_index_map" json:"node_index_map"` + Format []byte `thrift:"format,3,required" db:"format" json:"format"` + OptimizeTimeInUs int32 `thrift:"optimize_time_in_us,4,required" db:"optimize_time_in_us" json:"optimize_time_in_us"` +} + +func NewPlanDescription() *PlanDescription { + return &PlanDescription{} +} + + +func (p *PlanDescription) GetPlanNodeDescs() []*PlanNodeDescription { + return p.PlanNodeDescs +} + +func (p *PlanDescription) GetNodeIndexMap() map[int64]int64 { + return p.NodeIndexMap +} + +func (p *PlanDescription) GetFormat() []byte { + return p.Format +} + +func (p *PlanDescription) GetOptimizeTimeInUs() int32 { + return p.OptimizeTimeInUs +} +func (p *PlanDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPlanNodeDescs bool = false; + var issetNodeIndexMap bool = false; + var issetFormat bool = false; + var issetOptimizeTimeInUs 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 + } + issetPlanNodeDescs = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetNodeIndexMap = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetFormat = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetOptimizeTimeInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPlanNodeDescs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PlanNodeDescs is not set")); + } + if !issetNodeIndexMap{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NodeIndexMap is not set")); + } + if !issetFormat{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Format is not set")); + } + if !issetOptimizeTimeInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OptimizeTimeInUs is not set")); + } + return nil +} + +func (p *PlanDescription) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PlanNodeDescription, 0, size) + p.PlanNodeDescs = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewPlanNodeDescription() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.PlanNodeDescs = append(p.PlanNodeDescs, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int64]int64, size) + p.NodeIndexMap = tMap + for i := 0; i < size; i ++ { +var _key7 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} +var _val8 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val8 = v +} + p.NodeIndexMap[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Format = v +} + return nil +} + +func (p *PlanDescription) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OptimizeTimeInUs = v +} + return nil +} + +func (p *PlanDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanDescription"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanDescription) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("plan_node_descs", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:plan_node_descs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PlanNodeDescs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PlanNodeDescs { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:plan_node_descs: ", p), err) } + return err +} + +func (p *PlanDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node_index_map", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node_index_map: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.NodeIndexMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NodeIndexMap { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node_index_map: ", p), err) } + return err +} + +func (p *PlanDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("format", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:format: ", p), err) } + if err := oprot.WriteBinary(p.Format); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.format (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:format: ", p), err) } + return err +} + +func (p *PlanDescription) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("optimize_time_in_us", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:optimize_time_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.OptimizeTimeInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.optimize_time_in_us (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:optimize_time_in_us: ", p), err) } + return err +} + +func (p *PlanDescription) String() string { + if p == nil { + return "" + } + + planNodeDescsVal := fmt.Sprintf("%v", p.PlanNodeDescs) + nodeIndexMapVal := fmt.Sprintf("%v", p.NodeIndexMap) + formatVal := fmt.Sprintf("%v", p.Format) + optimizeTimeInUsVal := fmt.Sprintf("%v", p.OptimizeTimeInUs) + return fmt.Sprintf("PlanDescription({PlanNodeDescs:%s NodeIndexMap:%s Format:%s OptimizeTimeInUs:%s})", planNodeDescsVal, nodeIndexMapVal, formatVal, optimizeTimeInUsVal) +} + +// Attributes: +// - ErrorCode +// - LatencyInUs +// - Data +// - SpaceName +// - ErrorMsg +// - PlanDesc +// - Comment +type ExecutionResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + Data *nebula0.DataSet `thrift:"data,3" db:"data" json:"data,omitempty"` + SpaceName []byte `thrift:"space_name,4" db:"space_name" json:"space_name,omitempty"` + ErrorMsg []byte `thrift:"error_msg,5" db:"error_msg" json:"error_msg,omitempty"` + PlanDesc *PlanDescription `thrift:"plan_desc,6" db:"plan_desc" json:"plan_desc,omitempty"` + Comment []byte `thrift:"comment,7" db:"comment" json:"comment,omitempty"` +} + +func NewExecutionResponse() *ExecutionResponse { + return &ExecutionResponse{} +} + + +func (p *ExecutionResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} + +func (p *ExecutionResponse) GetLatencyInUs() int32 { + return p.LatencyInUs +} +var ExecutionResponse_Data_DEFAULT *nebula0.DataSet +func (p *ExecutionResponse) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return ExecutionResponse_Data_DEFAULT + } +return p.Data +} +var ExecutionResponse_SpaceName_DEFAULT []byte + +func (p *ExecutionResponse) GetSpaceName() []byte { + return p.SpaceName +} +var ExecutionResponse_ErrorMsg_DEFAULT []byte + +func (p *ExecutionResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var ExecutionResponse_PlanDesc_DEFAULT *PlanDescription +func (p *ExecutionResponse) GetPlanDesc() *PlanDescription { + if !p.IsSetPlanDesc() { + return ExecutionResponse_PlanDesc_DEFAULT + } +return p.PlanDesc +} +var ExecutionResponse_Comment_DEFAULT []byte + +func (p *ExecutionResponse) GetComment() []byte { + return p.Comment +} +func (p *ExecutionResponse) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *ExecutionResponse) IsSetSpaceName() bool { + return p != nil && p.SpaceName != nil +} + +func (p *ExecutionResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *ExecutionResponse) IsSetPlanDesc() bool { + return p != nil && p.PlanDesc != nil +} + +func (p *ExecutionResponse) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ExecutionResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + var issetLatencyInUs 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 + } + issetErrorCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ExecutionResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *ExecutionResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ExecutionResponse) ReadField3(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ExecutionResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *ExecutionResponse) ReadField6(iprot thrift.Protocol) error { + p.PlanDesc = NewPlanDescription() + if err := p.PlanDesc.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PlanDesc), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ExecutionResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecutionResponse"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecutionResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceName() { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_name: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_msg: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetPlanDesc() { + if err := oprot.WriteFieldBegin("plan_desc", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:plan_desc: ", p), err) } + if err := p.PlanDesc.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PlanDesc), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:plan_desc: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:comment: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var planDescVal string + if p.PlanDesc == nil { + planDescVal = "" + } else { + planDescVal = fmt.Sprintf("%v", p.PlanDesc) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ExecutionResponse({ErrorCode:%s LatencyInUs:%s Data:%s SpaceName:%s ErrorMsg:%s PlanDesc:%s Comment:%s})", errorCodeVal, latencyInUsVal, dataVal, spaceNameVal, errorMsgVal, planDescVal, commentVal) +} + +// Attributes: +// - ErrorCode +// - ErrorMsg +// - SessionID +// - TimeZoneOffsetSeconds +// - TimeZoneName +type AuthResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + ErrorMsg []byte `thrift:"error_msg,2" db:"error_msg" json:"error_msg,omitempty"` + SessionID *int64 `thrift:"session_id,3" db:"session_id" json:"session_id,omitempty"` + TimeZoneOffsetSeconds *int32 `thrift:"time_zone_offset_seconds,4" db:"time_zone_offset_seconds" json:"time_zone_offset_seconds,omitempty"` + TimeZoneName []byte `thrift:"time_zone_name,5" db:"time_zone_name" json:"time_zone_name,omitempty"` +} + +func NewAuthResponse() *AuthResponse { + return &AuthResponse{} +} + + +func (p *AuthResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} +var AuthResponse_ErrorMsg_DEFAULT []byte + +func (p *AuthResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var AuthResponse_SessionID_DEFAULT int64 +func (p *AuthResponse) GetSessionID() int64 { + if !p.IsSetSessionID() { + return AuthResponse_SessionID_DEFAULT + } +return *p.SessionID +} +var AuthResponse_TimeZoneOffsetSeconds_DEFAULT int32 +func (p *AuthResponse) GetTimeZoneOffsetSeconds() int32 { + if !p.IsSetTimeZoneOffsetSeconds() { + return AuthResponse_TimeZoneOffsetSeconds_DEFAULT + } +return *p.TimeZoneOffsetSeconds +} +var AuthResponse_TimeZoneName_DEFAULT []byte + +func (p *AuthResponse) GetTimeZoneName() []byte { + return p.TimeZoneName +} +func (p *AuthResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *AuthResponse) IsSetSessionID() bool { + return p != nil && p.SessionID != nil +} + +func (p *AuthResponse) IsSetTimeZoneOffsetSeconds() bool { + return p != nil && p.TimeZoneOffsetSeconds != nil +} + +func (p *AuthResponse) IsSetTimeZoneName() bool { + return p != nil && p.TimeZoneName != nil +} + +func (p *AuthResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode 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 + } + issetErrorCode = true + 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 + } + 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) + } + if !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *AuthResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *AuthResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *AuthResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SessionID = &v +} + return nil +} + +func (p *AuthResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TimeZoneOffsetSeconds = &v +} + return nil +} + +func (p *AuthResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.TimeZoneName = v +} + return nil +} + +func (p *AuthResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AuthResponse"); 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 *AuthResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *AuthResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session_id: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneOffsetSeconds() { + if err := oprot.WriteFieldBegin("time_zone_offset_seconds", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:time_zone_offset_seconds: ", p), err) } + if err := oprot.WriteI32(int32(*p.TimeZoneOffsetSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_offset_seconds (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:time_zone_offset_seconds: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneName() { + if err := oprot.WriteFieldBegin("time_zone_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:time_zone_name: ", p), err) } + if err := oprot.WriteBinary(p.TimeZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:time_zone_name: ", p), err) } + } + return err +} + +func (p *AuthResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var sessionIDVal string + if p.SessionID == nil { + sessionIDVal = "" + } else { + sessionIDVal = fmt.Sprintf("%v", *p.SessionID) + } + var timeZoneOffsetSecondsVal string + if p.TimeZoneOffsetSeconds == nil { + timeZoneOffsetSecondsVal = "" + } else { + timeZoneOffsetSecondsVal = fmt.Sprintf("%v", *p.TimeZoneOffsetSeconds) + } + timeZoneNameVal := fmt.Sprintf("%v", p.TimeZoneName) + return fmt.Sprintf("AuthResponse({ErrorCode:%s ErrorMsg:%s SessionID:%s TimeZoneOffsetSeconds:%s TimeZoneName:%s})", errorCodeVal, errorMsgVal, sessionIDVal, timeZoneOffsetSecondsVal, timeZoneNameVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/meta/constants.go b/ccore/nebula/internal/thrift/v2_5_0/meta/constants.go new file mode 100644 index 0000000..e679074 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/meta/constants.go @@ -0,0 +1,29 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var const_lit_vid_type_type_length int16 = 8 + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/meta/meta_service-remote/meta_service-remote.go b/ccore/nebula/internal/thrift/v2_5_0/meta/meta_service-remote/meta_service-remote.go new file mode 100755 index 0000000..6bbed6b --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/meta/meta_service-remote/meta_service-remote.go @@ -0,0 +1,2412 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResp createSpace(CreateSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSpace(DropSpaceReq req)") + fmt.Fprintln(os.Stderr, " GetSpaceResp getSpace(GetSpaceReq req)") + fmt.Fprintln(os.Stderr, " ListSpacesResp listSpaces(ListSpacesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTag(CreateTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterTag(AlterTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTag(DropTagReq req)") + fmt.Fprintln(os.Stderr, " GetTagResp getTag(GetTagReq req)") + fmt.Fprintln(os.Stderr, " ListTagsResp listTags(ListTagsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdge(CreateEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterEdge(AlterEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdge(DropEdgeReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeResp getEdge(GetEdgeReq req)") + fmt.Fprintln(os.Stderr, " ListEdgesResp listEdges(ListEdgesReq req)") + fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") + fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") + fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp multiPut(MultiPutReq req)") + fmt.Fprintln(os.Stderr, " GetResp get(GetReq req)") + fmt.Fprintln(os.Stderr, " MultiGetResp multiGet(MultiGetReq req)") + fmt.Fprintln(os.Stderr, " ExecResp remove(RemoveReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeRange(RemoveRangeReq req)") + fmt.Fprintln(os.Stderr, " ScanResp scan(ScanReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTagIndex(CreateTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTagIndex(DropTagIndexReq req)") + fmt.Fprintln(os.Stderr, " GetTagIndexResp getTagIndex(GetTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ListTagIndexesResp listTagIndexes(ListTagIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildTagIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listTagIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdgeIndex(CreateEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdgeIndex(DropEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeIndexResp getEdgeIndex(GetEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ListEdgeIndexesResp listEdgeIndexes(ListEdgeIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildEdgeIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listEdgeIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createUser(CreateUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropUser(DropUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterUser(AlterUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp grantRole(GrantRoleReq req)") + fmt.Fprintln(os.Stderr, " ExecResp revokeRole(RevokeRoleReq req)") + fmt.Fprintln(os.Stderr, " ListUsersResp listUsers(ListUsersReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp listRoles(ListRolesReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp getUserRoles(GetUserRolesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp changePassword(ChangePasswordReq req)") + fmt.Fprintln(os.Stderr, " HBResp heartBeat(HBReq req)") + fmt.Fprintln(os.Stderr, " BalanceResp balance(BalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp leaderBalance(LeaderBalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp regConfig(RegConfigReq req)") + fmt.Fprintln(os.Stderr, " GetConfigResp getConfig(GetConfigReq req)") + fmt.Fprintln(os.Stderr, " ExecResp setConfig(SetConfigReq req)") + fmt.Fprintln(os.Stderr, " ListConfigsResp listConfigs(ListConfigsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createSnapshot(CreateSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSnapshot(DropSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ListSnapshotsResp listSnapshots(ListSnapshotsReq req)") + fmt.Fprintln(os.Stderr, " AdminJobResp runAdminJob(AdminJobReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZone(AddZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostIntoZone(AddHostIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHostFromZone(DropHostFromZoneReq req)") + fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") + fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addGroup(AddGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropGroup(DropGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZoneIntoGroup(AddZoneIntoGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZoneFromGroup(DropZoneFromGroupReq req)") + fmt.Fprintln(os.Stderr, " GetGroupResp getGroup(GetGroupReq req)") + fmt.Fprintln(os.Stderr, " ListGroupsResp listGroups(ListGroupsReq req)") + fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp restoreMeta(RestoreMetaReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addListener(AddListenerReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeListener(RemoveListenerReq req)") + fmt.Fprintln(os.Stderr, " ListListenerResp listListener(ListListenerReq req)") + fmt.Fprintln(os.Stderr, " GetStatisResp getStatis(GetStatisReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signInFTService(SignInFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signOutFTService(SignOutFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ListFTClientsResp listFTClients(ListFTClientsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createFTIndex(CreateFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropFTIndex(DropFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ListFTIndexesResp listFTIndexes(ListFTIndexesReq req)") + fmt.Fprintln(os.Stderr, " CreateSessionResp createSession(CreateSessionReq req)") + fmt.Fprintln(os.Stderr, " UpdateSessionsResp updateSessions(UpdateSessionsReq req)") + fmt.Fprintln(os.Stderr, " ListSessionsResp listSessions(ListSessionsReq req)") + fmt.Fprintln(os.Stderr, " GetSessionResp getSession(GetSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeSession(RemoveSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp killQuery(KillQueryReq req)") + fmt.Fprintln(os.Stderr, " ExecResp reportTaskFinish(ReportTaskReq req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listCluster(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr, " GetMetaDirInfoResp getMetaDirInfo(GetMetaDirInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := meta.NewMetaServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "createSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") + flag.Usage() + } + arg99 := flag.Arg(1) + mbTrans100 := thrift.NewMemoryBufferLen(len(arg99)) + defer mbTrans100.Close() + _, err101 := mbTrans100.WriteString(arg99) + if err101 != nil { + Usage() + return + } + factory102 := thrift.NewSimpleJSONProtocolFactory() + jsProt103 := factory102.GetProtocol(mbTrans100) + argvalue0 := meta.NewCreateSpaceReq() + err104 := argvalue0.Read(jsProt103) + if err104 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpace(value0)) + fmt.Print("\n") + break + case "dropSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") + flag.Usage() + } + arg105 := flag.Arg(1) + mbTrans106 := thrift.NewMemoryBufferLen(len(arg105)) + defer mbTrans106.Close() + _, err107 := mbTrans106.WriteString(arg105) + if err107 != nil { + Usage() + return + } + factory108 := thrift.NewSimpleJSONProtocolFactory() + jsProt109 := factory108.GetProtocol(mbTrans106) + argvalue0 := meta.NewDropSpaceReq() + err110 := argvalue0.Read(jsProt109) + if err110 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSpace(value0)) + fmt.Print("\n") + break + case "getSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") + flag.Usage() + } + arg111 := flag.Arg(1) + mbTrans112 := thrift.NewMemoryBufferLen(len(arg111)) + defer mbTrans112.Close() + _, err113 := mbTrans112.WriteString(arg111) + if err113 != nil { + Usage() + return + } + factory114 := thrift.NewSimpleJSONProtocolFactory() + jsProt115 := factory114.GetProtocol(mbTrans112) + argvalue0 := meta.NewGetSpaceReq() + err116 := argvalue0.Read(jsProt115) + if err116 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSpace(value0)) + fmt.Print("\n") + break + case "listSpaces": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") + flag.Usage() + } + arg117 := flag.Arg(1) + mbTrans118 := thrift.NewMemoryBufferLen(len(arg117)) + defer mbTrans118.Close() + _, err119 := mbTrans118.WriteString(arg117) + if err119 != nil { + Usage() + return + } + factory120 := thrift.NewSimpleJSONProtocolFactory() + jsProt121 := factory120.GetProtocol(mbTrans118) + argvalue0 := meta.NewListSpacesReq() + err122 := argvalue0.Read(jsProt121) + if err122 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSpaces(value0)) + fmt.Print("\n") + break + case "createTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") + flag.Usage() + } + arg123 := flag.Arg(1) + mbTrans124 := thrift.NewMemoryBufferLen(len(arg123)) + defer mbTrans124.Close() + _, err125 := mbTrans124.WriteString(arg123) + if err125 != nil { + Usage() + return + } + factory126 := thrift.NewSimpleJSONProtocolFactory() + jsProt127 := factory126.GetProtocol(mbTrans124) + argvalue0 := meta.NewCreateTagReq() + err128 := argvalue0.Read(jsProt127) + if err128 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTag(value0)) + fmt.Print("\n") + break + case "alterTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") + flag.Usage() + } + arg129 := flag.Arg(1) + mbTrans130 := thrift.NewMemoryBufferLen(len(arg129)) + defer mbTrans130.Close() + _, err131 := mbTrans130.WriteString(arg129) + if err131 != nil { + Usage() + return + } + factory132 := thrift.NewSimpleJSONProtocolFactory() + jsProt133 := factory132.GetProtocol(mbTrans130) + argvalue0 := meta.NewAlterTagReq() + err134 := argvalue0.Read(jsProt133) + if err134 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterTag(value0)) + fmt.Print("\n") + break + case "dropTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTag requires 1 args") + flag.Usage() + } + arg135 := flag.Arg(1) + mbTrans136 := thrift.NewMemoryBufferLen(len(arg135)) + defer mbTrans136.Close() + _, err137 := mbTrans136.WriteString(arg135) + if err137 != nil { + Usage() + return + } + factory138 := thrift.NewSimpleJSONProtocolFactory() + jsProt139 := factory138.GetProtocol(mbTrans136) + argvalue0 := meta.NewDropTagReq() + err140 := argvalue0.Read(jsProt139) + if err140 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTag(value0)) + fmt.Print("\n") + break + case "getTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTag requires 1 args") + flag.Usage() + } + arg141 := flag.Arg(1) + mbTrans142 := thrift.NewMemoryBufferLen(len(arg141)) + defer mbTrans142.Close() + _, err143 := mbTrans142.WriteString(arg141) + if err143 != nil { + Usage() + return + } + factory144 := thrift.NewSimpleJSONProtocolFactory() + jsProt145 := factory144.GetProtocol(mbTrans142) + argvalue0 := meta.NewGetTagReq() + err146 := argvalue0.Read(jsProt145) + if err146 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTag(value0)) + fmt.Print("\n") + break + case "listTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTags requires 1 args") + flag.Usage() + } + arg147 := flag.Arg(1) + mbTrans148 := thrift.NewMemoryBufferLen(len(arg147)) + defer mbTrans148.Close() + _, err149 := mbTrans148.WriteString(arg147) + if err149 != nil { + Usage() + return + } + factory150 := thrift.NewSimpleJSONProtocolFactory() + jsProt151 := factory150.GetProtocol(mbTrans148) + argvalue0 := meta.NewListTagsReq() + err152 := argvalue0.Read(jsProt151) + if err152 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTags(value0)) + fmt.Print("\n") + break + case "createEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") + flag.Usage() + } + arg153 := flag.Arg(1) + mbTrans154 := thrift.NewMemoryBufferLen(len(arg153)) + defer mbTrans154.Close() + _, err155 := mbTrans154.WriteString(arg153) + if err155 != nil { + Usage() + return + } + factory156 := thrift.NewSimpleJSONProtocolFactory() + jsProt157 := factory156.GetProtocol(mbTrans154) + argvalue0 := meta.NewCreateEdgeReq() + err158 := argvalue0.Read(jsProt157) + if err158 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdge(value0)) + fmt.Print("\n") + break + case "alterEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") + flag.Usage() + } + arg159 := flag.Arg(1) + mbTrans160 := thrift.NewMemoryBufferLen(len(arg159)) + defer mbTrans160.Close() + _, err161 := mbTrans160.WriteString(arg159) + if err161 != nil { + Usage() + return + } + factory162 := thrift.NewSimpleJSONProtocolFactory() + jsProt163 := factory162.GetProtocol(mbTrans160) + argvalue0 := meta.NewAlterEdgeReq() + err164 := argvalue0.Read(jsProt163) + if err164 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterEdge(value0)) + fmt.Print("\n") + break + case "dropEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") + flag.Usage() + } + arg165 := flag.Arg(1) + mbTrans166 := thrift.NewMemoryBufferLen(len(arg165)) + defer mbTrans166.Close() + _, err167 := mbTrans166.WriteString(arg165) + if err167 != nil { + Usage() + return + } + factory168 := thrift.NewSimpleJSONProtocolFactory() + jsProt169 := factory168.GetProtocol(mbTrans166) + argvalue0 := meta.NewDropEdgeReq() + err170 := argvalue0.Read(jsProt169) + if err170 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdge(value0)) + fmt.Print("\n") + break + case "getEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") + flag.Usage() + } + arg171 := flag.Arg(1) + mbTrans172 := thrift.NewMemoryBufferLen(len(arg171)) + defer mbTrans172.Close() + _, err173 := mbTrans172.WriteString(arg171) + if err173 != nil { + Usage() + return + } + factory174 := thrift.NewSimpleJSONProtocolFactory() + jsProt175 := factory174.GetProtocol(mbTrans172) + argvalue0 := meta.NewGetEdgeReq() + err176 := argvalue0.Read(jsProt175) + if err176 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdge(value0)) + fmt.Print("\n") + break + case "listEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") + flag.Usage() + } + arg177 := flag.Arg(1) + mbTrans178 := thrift.NewMemoryBufferLen(len(arg177)) + defer mbTrans178.Close() + _, err179 := mbTrans178.WriteString(arg177) + if err179 != nil { + Usage() + return + } + factory180 := thrift.NewSimpleJSONProtocolFactory() + jsProt181 := factory180.GetProtocol(mbTrans178) + argvalue0 := meta.NewListEdgesReq() + err182 := argvalue0.Read(jsProt181) + if err182 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdges(value0)) + fmt.Print("\n") + break + case "listHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") + flag.Usage() + } + arg183 := flag.Arg(1) + mbTrans184 := thrift.NewMemoryBufferLen(len(arg183)) + defer mbTrans184.Close() + _, err185 := mbTrans184.WriteString(arg183) + if err185 != nil { + Usage() + return + } + factory186 := thrift.NewSimpleJSONProtocolFactory() + jsProt187 := factory186.GetProtocol(mbTrans184) + argvalue0 := meta.NewListHostsReq() + err188 := argvalue0.Read(jsProt187) + if err188 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListHosts(value0)) + fmt.Print("\n") + break + case "getPartsAlloc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") + flag.Usage() + } + arg189 := flag.Arg(1) + mbTrans190 := thrift.NewMemoryBufferLen(len(arg189)) + defer mbTrans190.Close() + _, err191 := mbTrans190.WriteString(arg189) + if err191 != nil { + Usage() + return + } + factory192 := thrift.NewSimpleJSONProtocolFactory() + jsProt193 := factory192.GetProtocol(mbTrans190) + argvalue0 := meta.NewGetPartsAllocReq() + err194 := argvalue0.Read(jsProt193) + if err194 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPartsAlloc(value0)) + fmt.Print("\n") + break + case "listParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListParts requires 1 args") + flag.Usage() + } + arg195 := flag.Arg(1) + mbTrans196 := thrift.NewMemoryBufferLen(len(arg195)) + defer mbTrans196.Close() + _, err197 := mbTrans196.WriteString(arg195) + if err197 != nil { + Usage() + return + } + factory198 := thrift.NewSimpleJSONProtocolFactory() + jsProt199 := factory198.GetProtocol(mbTrans196) + argvalue0 := meta.NewListPartsReq() + err200 := argvalue0.Read(jsProt199) + if err200 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListParts(value0)) + fmt.Print("\n") + break + case "multiPut": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") + flag.Usage() + } + arg201 := flag.Arg(1) + mbTrans202 := thrift.NewMemoryBufferLen(len(arg201)) + defer mbTrans202.Close() + _, err203 := mbTrans202.WriteString(arg201) + if err203 != nil { + Usage() + return + } + factory204 := thrift.NewSimpleJSONProtocolFactory() + jsProt205 := factory204.GetProtocol(mbTrans202) + argvalue0 := meta.NewMultiPutReq() + err206 := argvalue0.Read(jsProt205) + if err206 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiPut(value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg207 := flag.Arg(1) + mbTrans208 := thrift.NewMemoryBufferLen(len(arg207)) + defer mbTrans208.Close() + _, err209 := mbTrans208.WriteString(arg207) + if err209 != nil { + Usage() + return + } + factory210 := thrift.NewSimpleJSONProtocolFactory() + jsProt211 := factory210.GetProtocol(mbTrans208) + argvalue0 := meta.NewGetReq() + err212 := argvalue0.Read(jsProt211) + if err212 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "multiGet": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") + flag.Usage() + } + arg213 := flag.Arg(1) + mbTrans214 := thrift.NewMemoryBufferLen(len(arg213)) + defer mbTrans214.Close() + _, err215 := mbTrans214.WriteString(arg213) + if err215 != nil { + Usage() + return + } + factory216 := thrift.NewSimpleJSONProtocolFactory() + jsProt217 := factory216.GetProtocol(mbTrans214) + argvalue0 := meta.NewMultiGetReq() + err218 := argvalue0.Read(jsProt217) + if err218 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiGet(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg219 := flag.Arg(1) + mbTrans220 := thrift.NewMemoryBufferLen(len(arg219)) + defer mbTrans220.Close() + _, err221 := mbTrans220.WriteString(arg219) + if err221 != nil { + Usage() + return + } + factory222 := thrift.NewSimpleJSONProtocolFactory() + jsProt223 := factory222.GetProtocol(mbTrans220) + argvalue0 := meta.NewRemoveReq() + err224 := argvalue0.Read(jsProt223) + if err224 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "removeRange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveRange requires 1 args") + flag.Usage() + } + arg225 := flag.Arg(1) + mbTrans226 := thrift.NewMemoryBufferLen(len(arg225)) + defer mbTrans226.Close() + _, err227 := mbTrans226.WriteString(arg225) + if err227 != nil { + Usage() + return + } + factory228 := thrift.NewSimpleJSONProtocolFactory() + jsProt229 := factory228.GetProtocol(mbTrans226) + argvalue0 := meta.NewRemoveRangeReq() + err230 := argvalue0.Read(jsProt229) + if err230 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveRange(value0)) + fmt.Print("\n") + break + case "scan": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Scan requires 1 args") + flag.Usage() + } + arg231 := flag.Arg(1) + mbTrans232 := thrift.NewMemoryBufferLen(len(arg231)) + defer mbTrans232.Close() + _, err233 := mbTrans232.WriteString(arg231) + if err233 != nil { + Usage() + return + } + factory234 := thrift.NewSimpleJSONProtocolFactory() + jsProt235 := factory234.GetProtocol(mbTrans232) + argvalue0 := meta.NewScanReq() + err236 := argvalue0.Read(jsProt235) + if err236 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Scan(value0)) + fmt.Print("\n") + break + case "createTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") + flag.Usage() + } + arg237 := flag.Arg(1) + mbTrans238 := thrift.NewMemoryBufferLen(len(arg237)) + defer mbTrans238.Close() + _, err239 := mbTrans238.WriteString(arg237) + if err239 != nil { + Usage() + return + } + factory240 := thrift.NewSimpleJSONProtocolFactory() + jsProt241 := factory240.GetProtocol(mbTrans238) + argvalue0 := meta.NewCreateTagIndexReq() + err242 := argvalue0.Read(jsProt241) + if err242 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTagIndex(value0)) + fmt.Print("\n") + break + case "dropTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") + flag.Usage() + } + arg243 := flag.Arg(1) + mbTrans244 := thrift.NewMemoryBufferLen(len(arg243)) + defer mbTrans244.Close() + _, err245 := mbTrans244.WriteString(arg243) + if err245 != nil { + Usage() + return + } + factory246 := thrift.NewSimpleJSONProtocolFactory() + jsProt247 := factory246.GetProtocol(mbTrans244) + argvalue0 := meta.NewDropTagIndexReq() + err248 := argvalue0.Read(jsProt247) + if err248 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTagIndex(value0)) + fmt.Print("\n") + break + case "getTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") + flag.Usage() + } + arg249 := flag.Arg(1) + mbTrans250 := thrift.NewMemoryBufferLen(len(arg249)) + defer mbTrans250.Close() + _, err251 := mbTrans250.WriteString(arg249) + if err251 != nil { + Usage() + return + } + factory252 := thrift.NewSimpleJSONProtocolFactory() + jsProt253 := factory252.GetProtocol(mbTrans250) + argvalue0 := meta.NewGetTagIndexReq() + err254 := argvalue0.Read(jsProt253) + if err254 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") + flag.Usage() + } + arg255 := flag.Arg(1) + mbTrans256 := thrift.NewMemoryBufferLen(len(arg255)) + defer mbTrans256.Close() + _, err257 := mbTrans256.WriteString(arg255) + if err257 != nil { + Usage() + return + } + factory258 := thrift.NewSimpleJSONProtocolFactory() + jsProt259 := factory258.GetProtocol(mbTrans256) + argvalue0 := meta.NewListTagIndexesReq() + err260 := argvalue0.Read(jsProt259) + if err260 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexes(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg261 := flag.Arg(1) + mbTrans262 := thrift.NewMemoryBufferLen(len(arg261)) + defer mbTrans262.Close() + _, err263 := mbTrans262.WriteString(arg261) + if err263 != nil { + Usage() + return + } + factory264 := thrift.NewSimpleJSONProtocolFactory() + jsProt265 := factory264.GetProtocol(mbTrans262) + argvalue0 := meta.NewRebuildIndexReq() + err266 := argvalue0.Read(jsProt265) + if err266 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") + flag.Usage() + } + arg267 := flag.Arg(1) + mbTrans268 := thrift.NewMemoryBufferLen(len(arg267)) + defer mbTrans268.Close() + _, err269 := mbTrans268.WriteString(arg267) + if err269 != nil { + Usage() + return + } + factory270 := thrift.NewSimpleJSONProtocolFactory() + jsProt271 := factory270.GetProtocol(mbTrans268) + argvalue0 := meta.NewListIndexStatusReq() + err272 := argvalue0.Read(jsProt271) + if err272 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexStatus(value0)) + fmt.Print("\n") + break + case "createEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") + flag.Usage() + } + arg273 := flag.Arg(1) + mbTrans274 := thrift.NewMemoryBufferLen(len(arg273)) + defer mbTrans274.Close() + _, err275 := mbTrans274.WriteString(arg273) + if err275 != nil { + Usage() + return + } + factory276 := thrift.NewSimpleJSONProtocolFactory() + jsProt277 := factory276.GetProtocol(mbTrans274) + argvalue0 := meta.NewCreateEdgeIndexReq() + err278 := argvalue0.Read(jsProt277) + if err278 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdgeIndex(value0)) + fmt.Print("\n") + break + case "dropEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") + flag.Usage() + } + arg279 := flag.Arg(1) + mbTrans280 := thrift.NewMemoryBufferLen(len(arg279)) + defer mbTrans280.Close() + _, err281 := mbTrans280.WriteString(arg279) + if err281 != nil { + Usage() + return + } + factory282 := thrift.NewSimpleJSONProtocolFactory() + jsProt283 := factory282.GetProtocol(mbTrans280) + argvalue0 := meta.NewDropEdgeIndexReq() + err284 := argvalue0.Read(jsProt283) + if err284 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdgeIndex(value0)) + fmt.Print("\n") + break + case "getEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") + flag.Usage() + } + arg285 := flag.Arg(1) + mbTrans286 := thrift.NewMemoryBufferLen(len(arg285)) + defer mbTrans286.Close() + _, err287 := mbTrans286.WriteString(arg285) + if err287 != nil { + Usage() + return + } + factory288 := thrift.NewSimpleJSONProtocolFactory() + jsProt289 := factory288.GetProtocol(mbTrans286) + argvalue0 := meta.NewGetEdgeIndexReq() + err290 := argvalue0.Read(jsProt289) + if err290 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") + flag.Usage() + } + arg291 := flag.Arg(1) + mbTrans292 := thrift.NewMemoryBufferLen(len(arg291)) + defer mbTrans292.Close() + _, err293 := mbTrans292.WriteString(arg291) + if err293 != nil { + Usage() + return + } + factory294 := thrift.NewSimpleJSONProtocolFactory() + jsProt295 := factory294.GetProtocol(mbTrans292) + argvalue0 := meta.NewListEdgeIndexesReq() + err296 := argvalue0.Read(jsProt295) + if err296 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexes(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg297 := flag.Arg(1) + mbTrans298 := thrift.NewMemoryBufferLen(len(arg297)) + defer mbTrans298.Close() + _, err299 := mbTrans298.WriteString(arg297) + if err299 != nil { + Usage() + return + } + factory300 := thrift.NewSimpleJSONProtocolFactory() + jsProt301 := factory300.GetProtocol(mbTrans298) + argvalue0 := meta.NewRebuildIndexReq() + err302 := argvalue0.Read(jsProt301) + if err302 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") + flag.Usage() + } + arg303 := flag.Arg(1) + mbTrans304 := thrift.NewMemoryBufferLen(len(arg303)) + defer mbTrans304.Close() + _, err305 := mbTrans304.WriteString(arg303) + if err305 != nil { + Usage() + return + } + factory306 := thrift.NewSimpleJSONProtocolFactory() + jsProt307 := factory306.GetProtocol(mbTrans304) + argvalue0 := meta.NewListIndexStatusReq() + err308 := argvalue0.Read(jsProt307) + if err308 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexStatus(value0)) + fmt.Print("\n") + break + case "createUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") + flag.Usage() + } + arg309 := flag.Arg(1) + mbTrans310 := thrift.NewMemoryBufferLen(len(arg309)) + defer mbTrans310.Close() + _, err311 := mbTrans310.WriteString(arg309) + if err311 != nil { + Usage() + return + } + factory312 := thrift.NewSimpleJSONProtocolFactory() + jsProt313 := factory312.GetProtocol(mbTrans310) + argvalue0 := meta.NewCreateUserReq() + err314 := argvalue0.Read(jsProt313) + if err314 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateUser(value0)) + fmt.Print("\n") + break + case "dropUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropUser requires 1 args") + flag.Usage() + } + arg315 := flag.Arg(1) + mbTrans316 := thrift.NewMemoryBufferLen(len(arg315)) + defer mbTrans316.Close() + _, err317 := mbTrans316.WriteString(arg315) + if err317 != nil { + Usage() + return + } + factory318 := thrift.NewSimpleJSONProtocolFactory() + jsProt319 := factory318.GetProtocol(mbTrans316) + argvalue0 := meta.NewDropUserReq() + err320 := argvalue0.Read(jsProt319) + if err320 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropUser(value0)) + fmt.Print("\n") + break + case "alterUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") + flag.Usage() + } + arg321 := flag.Arg(1) + mbTrans322 := thrift.NewMemoryBufferLen(len(arg321)) + defer mbTrans322.Close() + _, err323 := mbTrans322.WriteString(arg321) + if err323 != nil { + Usage() + return + } + factory324 := thrift.NewSimpleJSONProtocolFactory() + jsProt325 := factory324.GetProtocol(mbTrans322) + argvalue0 := meta.NewAlterUserReq() + err326 := argvalue0.Read(jsProt325) + if err326 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterUser(value0)) + fmt.Print("\n") + break + case "grantRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") + flag.Usage() + } + arg327 := flag.Arg(1) + mbTrans328 := thrift.NewMemoryBufferLen(len(arg327)) + defer mbTrans328.Close() + _, err329 := mbTrans328.WriteString(arg327) + if err329 != nil { + Usage() + return + } + factory330 := thrift.NewSimpleJSONProtocolFactory() + jsProt331 := factory330.GetProtocol(mbTrans328) + argvalue0 := meta.NewGrantRoleReq() + err332 := argvalue0.Read(jsProt331) + if err332 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GrantRole(value0)) + fmt.Print("\n") + break + case "revokeRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") + flag.Usage() + } + arg333 := flag.Arg(1) + mbTrans334 := thrift.NewMemoryBufferLen(len(arg333)) + defer mbTrans334.Close() + _, err335 := mbTrans334.WriteString(arg333) + if err335 != nil { + Usage() + return + } + factory336 := thrift.NewSimpleJSONProtocolFactory() + jsProt337 := factory336.GetProtocol(mbTrans334) + argvalue0 := meta.NewRevokeRoleReq() + err338 := argvalue0.Read(jsProt337) + if err338 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RevokeRole(value0)) + fmt.Print("\n") + break + case "listUsers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") + flag.Usage() + } + arg339 := flag.Arg(1) + mbTrans340 := thrift.NewMemoryBufferLen(len(arg339)) + defer mbTrans340.Close() + _, err341 := mbTrans340.WriteString(arg339) + if err341 != nil { + Usage() + return + } + factory342 := thrift.NewSimpleJSONProtocolFactory() + jsProt343 := factory342.GetProtocol(mbTrans340) + argvalue0 := meta.NewListUsersReq() + err344 := argvalue0.Read(jsProt343) + if err344 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListUsers(value0)) + fmt.Print("\n") + break + case "listRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") + flag.Usage() + } + arg345 := flag.Arg(1) + mbTrans346 := thrift.NewMemoryBufferLen(len(arg345)) + defer mbTrans346.Close() + _, err347 := mbTrans346.WriteString(arg345) + if err347 != nil { + Usage() + return + } + factory348 := thrift.NewSimpleJSONProtocolFactory() + jsProt349 := factory348.GetProtocol(mbTrans346) + argvalue0 := meta.NewListRolesReq() + err350 := argvalue0.Read(jsProt349) + if err350 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListRoles(value0)) + fmt.Print("\n") + break + case "getUserRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") + flag.Usage() + } + arg351 := flag.Arg(1) + mbTrans352 := thrift.NewMemoryBufferLen(len(arg351)) + defer mbTrans352.Close() + _, err353 := mbTrans352.WriteString(arg351) + if err353 != nil { + Usage() + return + } + factory354 := thrift.NewSimpleJSONProtocolFactory() + jsProt355 := factory354.GetProtocol(mbTrans352) + argvalue0 := meta.NewGetUserRolesReq() + err356 := argvalue0.Read(jsProt355) + if err356 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUserRoles(value0)) + fmt.Print("\n") + break + case "changePassword": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") + flag.Usage() + } + arg357 := flag.Arg(1) + mbTrans358 := thrift.NewMemoryBufferLen(len(arg357)) + defer mbTrans358.Close() + _, err359 := mbTrans358.WriteString(arg357) + if err359 != nil { + Usage() + return + } + factory360 := thrift.NewSimpleJSONProtocolFactory() + jsProt361 := factory360.GetProtocol(mbTrans358) + argvalue0 := meta.NewChangePasswordReq() + err362 := argvalue0.Read(jsProt361) + if err362 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChangePassword(value0)) + fmt.Print("\n") + break + case "heartBeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") + flag.Usage() + } + arg363 := flag.Arg(1) + mbTrans364 := thrift.NewMemoryBufferLen(len(arg363)) + defer mbTrans364.Close() + _, err365 := mbTrans364.WriteString(arg363) + if err365 != nil { + Usage() + return + } + factory366 := thrift.NewSimpleJSONProtocolFactory() + jsProt367 := factory366.GetProtocol(mbTrans364) + argvalue0 := meta.NewHBReq() + err368 := argvalue0.Read(jsProt367) + if err368 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.HeartBeat(value0)) + fmt.Print("\n") + break + case "balance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Balance requires 1 args") + flag.Usage() + } + arg369 := flag.Arg(1) + mbTrans370 := thrift.NewMemoryBufferLen(len(arg369)) + defer mbTrans370.Close() + _, err371 := mbTrans370.WriteString(arg369) + if err371 != nil { + Usage() + return + } + factory372 := thrift.NewSimpleJSONProtocolFactory() + jsProt373 := factory372.GetProtocol(mbTrans370) + argvalue0 := meta.NewBalanceReq() + err374 := argvalue0.Read(jsProt373) + if err374 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Balance(value0)) + fmt.Print("\n") + break + case "leaderBalance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LeaderBalance requires 1 args") + flag.Usage() + } + arg375 := flag.Arg(1) + mbTrans376 := thrift.NewMemoryBufferLen(len(arg375)) + defer mbTrans376.Close() + _, err377 := mbTrans376.WriteString(arg375) + if err377 != nil { + Usage() + return + } + factory378 := thrift.NewSimpleJSONProtocolFactory() + jsProt379 := factory378.GetProtocol(mbTrans376) + argvalue0 := meta.NewLeaderBalanceReq() + err380 := argvalue0.Read(jsProt379) + if err380 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LeaderBalance(value0)) + fmt.Print("\n") + break + case "regConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") + flag.Usage() + } + arg381 := flag.Arg(1) + mbTrans382 := thrift.NewMemoryBufferLen(len(arg381)) + defer mbTrans382.Close() + _, err383 := mbTrans382.WriteString(arg381) + if err383 != nil { + Usage() + return + } + factory384 := thrift.NewSimpleJSONProtocolFactory() + jsProt385 := factory384.GetProtocol(mbTrans382) + argvalue0 := meta.NewRegConfigReq() + err386 := argvalue0.Read(jsProt385) + if err386 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RegConfig(value0)) + fmt.Print("\n") + break + case "getConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") + flag.Usage() + } + arg387 := flag.Arg(1) + mbTrans388 := thrift.NewMemoryBufferLen(len(arg387)) + defer mbTrans388.Close() + _, err389 := mbTrans388.WriteString(arg387) + if err389 != nil { + Usage() + return + } + factory390 := thrift.NewSimpleJSONProtocolFactory() + jsProt391 := factory390.GetProtocol(mbTrans388) + argvalue0 := meta.NewGetConfigReq() + err392 := argvalue0.Read(jsProt391) + if err392 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetConfig(value0)) + fmt.Print("\n") + break + case "setConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") + flag.Usage() + } + arg393 := flag.Arg(1) + mbTrans394 := thrift.NewMemoryBufferLen(len(arg393)) + defer mbTrans394.Close() + _, err395 := mbTrans394.WriteString(arg393) + if err395 != nil { + Usage() + return + } + factory396 := thrift.NewSimpleJSONProtocolFactory() + jsProt397 := factory396.GetProtocol(mbTrans394) + argvalue0 := meta.NewSetConfigReq() + err398 := argvalue0.Read(jsProt397) + if err398 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetConfig(value0)) + fmt.Print("\n") + break + case "listConfigs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") + flag.Usage() + } + arg399 := flag.Arg(1) + mbTrans400 := thrift.NewMemoryBufferLen(len(arg399)) + defer mbTrans400.Close() + _, err401 := mbTrans400.WriteString(arg399) + if err401 != nil { + Usage() + return + } + factory402 := thrift.NewSimpleJSONProtocolFactory() + jsProt403 := factory402.GetProtocol(mbTrans400) + argvalue0 := meta.NewListConfigsReq() + err404 := argvalue0.Read(jsProt403) + if err404 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListConfigs(value0)) + fmt.Print("\n") + break + case "createSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") + flag.Usage() + } + arg405 := flag.Arg(1) + mbTrans406 := thrift.NewMemoryBufferLen(len(arg405)) + defer mbTrans406.Close() + _, err407 := mbTrans406.WriteString(arg405) + if err407 != nil { + Usage() + return + } + factory408 := thrift.NewSimpleJSONProtocolFactory() + jsProt409 := factory408.GetProtocol(mbTrans406) + argvalue0 := meta.NewCreateSnapshotReq() + err410 := argvalue0.Read(jsProt409) + if err410 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSnapshot(value0)) + fmt.Print("\n") + break + case "dropSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") + flag.Usage() + } + arg411 := flag.Arg(1) + mbTrans412 := thrift.NewMemoryBufferLen(len(arg411)) + defer mbTrans412.Close() + _, err413 := mbTrans412.WriteString(arg411) + if err413 != nil { + Usage() + return + } + factory414 := thrift.NewSimpleJSONProtocolFactory() + jsProt415 := factory414.GetProtocol(mbTrans412) + argvalue0 := meta.NewDropSnapshotReq() + err416 := argvalue0.Read(jsProt415) + if err416 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSnapshot(value0)) + fmt.Print("\n") + break + case "listSnapshots": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") + flag.Usage() + } + arg417 := flag.Arg(1) + mbTrans418 := thrift.NewMemoryBufferLen(len(arg417)) + defer mbTrans418.Close() + _, err419 := mbTrans418.WriteString(arg417) + if err419 != nil { + Usage() + return + } + factory420 := thrift.NewSimpleJSONProtocolFactory() + jsProt421 := factory420.GetProtocol(mbTrans418) + argvalue0 := meta.NewListSnapshotsReq() + err422 := argvalue0.Read(jsProt421) + if err422 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSnapshots(value0)) + fmt.Print("\n") + break + case "runAdminJob": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") + flag.Usage() + } + arg423 := flag.Arg(1) + mbTrans424 := thrift.NewMemoryBufferLen(len(arg423)) + defer mbTrans424.Close() + _, err425 := mbTrans424.WriteString(arg423) + if err425 != nil { + Usage() + return + } + factory426 := thrift.NewSimpleJSONProtocolFactory() + jsProt427 := factory426.GetProtocol(mbTrans424) + argvalue0 := meta.NewAdminJobReq() + err428 := argvalue0.Read(jsProt427) + if err428 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RunAdminJob(value0)) + fmt.Print("\n") + break + case "addZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZone requires 1 args") + flag.Usage() + } + arg429 := flag.Arg(1) + mbTrans430 := thrift.NewMemoryBufferLen(len(arg429)) + defer mbTrans430.Close() + _, err431 := mbTrans430.WriteString(arg429) + if err431 != nil { + Usage() + return + } + factory432 := thrift.NewSimpleJSONProtocolFactory() + jsProt433 := factory432.GetProtocol(mbTrans430) + argvalue0 := meta.NewAddZoneReq() + err434 := argvalue0.Read(jsProt433) + if err434 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZone(value0)) + fmt.Print("\n") + break + case "dropZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZone requires 1 args") + flag.Usage() + } + arg435 := flag.Arg(1) + mbTrans436 := thrift.NewMemoryBufferLen(len(arg435)) + defer mbTrans436.Close() + _, err437 := mbTrans436.WriteString(arg435) + if err437 != nil { + Usage() + return + } + factory438 := thrift.NewSimpleJSONProtocolFactory() + jsProt439 := factory438.GetProtocol(mbTrans436) + argvalue0 := meta.NewDropZoneReq() + err440 := argvalue0.Read(jsProt439) + if err440 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZone(value0)) + fmt.Print("\n") + break + case "addHostIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostIntoZone requires 1 args") + flag.Usage() + } + arg441 := flag.Arg(1) + mbTrans442 := thrift.NewMemoryBufferLen(len(arg441)) + defer mbTrans442.Close() + _, err443 := mbTrans442.WriteString(arg441) + if err443 != nil { + Usage() + return + } + factory444 := thrift.NewSimpleJSONProtocolFactory() + jsProt445 := factory444.GetProtocol(mbTrans442) + argvalue0 := meta.NewAddHostIntoZoneReq() + err446 := argvalue0.Read(jsProt445) + if err446 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostIntoZone(value0)) + fmt.Print("\n") + break + case "dropHostFromZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHostFromZone requires 1 args") + flag.Usage() + } + arg447 := flag.Arg(1) + mbTrans448 := thrift.NewMemoryBufferLen(len(arg447)) + defer mbTrans448.Close() + _, err449 := mbTrans448.WriteString(arg447) + if err449 != nil { + Usage() + return + } + factory450 := thrift.NewSimpleJSONProtocolFactory() + jsProt451 := factory450.GetProtocol(mbTrans448) + argvalue0 := meta.NewDropHostFromZoneReq() + err452 := argvalue0.Read(jsProt451) + if err452 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHostFromZone(value0)) + fmt.Print("\n") + break + case "getZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetZone requires 1 args") + flag.Usage() + } + arg453 := flag.Arg(1) + mbTrans454 := thrift.NewMemoryBufferLen(len(arg453)) + defer mbTrans454.Close() + _, err455 := mbTrans454.WriteString(arg453) + if err455 != nil { + Usage() + return + } + factory456 := thrift.NewSimpleJSONProtocolFactory() + jsProt457 := factory456.GetProtocol(mbTrans454) + argvalue0 := meta.NewGetZoneReq() + err458 := argvalue0.Read(jsProt457) + if err458 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetZone(value0)) + fmt.Print("\n") + break + case "listZones": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListZones requires 1 args") + flag.Usage() + } + arg459 := flag.Arg(1) + mbTrans460 := thrift.NewMemoryBufferLen(len(arg459)) + defer mbTrans460.Close() + _, err461 := mbTrans460.WriteString(arg459) + if err461 != nil { + Usage() + return + } + factory462 := thrift.NewSimpleJSONProtocolFactory() + jsProt463 := factory462.GetProtocol(mbTrans460) + argvalue0 := meta.NewListZonesReq() + err464 := argvalue0.Read(jsProt463) + if err464 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListZones(value0)) + fmt.Print("\n") + break + case "addGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddGroup requires 1 args") + flag.Usage() + } + arg465 := flag.Arg(1) + mbTrans466 := thrift.NewMemoryBufferLen(len(arg465)) + defer mbTrans466.Close() + _, err467 := mbTrans466.WriteString(arg465) + if err467 != nil { + Usage() + return + } + factory468 := thrift.NewSimpleJSONProtocolFactory() + jsProt469 := factory468.GetProtocol(mbTrans466) + argvalue0 := meta.NewAddGroupReq() + err470 := argvalue0.Read(jsProt469) + if err470 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddGroup(value0)) + fmt.Print("\n") + break + case "dropGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropGroup requires 1 args") + flag.Usage() + } + arg471 := flag.Arg(1) + mbTrans472 := thrift.NewMemoryBufferLen(len(arg471)) + defer mbTrans472.Close() + _, err473 := mbTrans472.WriteString(arg471) + if err473 != nil { + Usage() + return + } + factory474 := thrift.NewSimpleJSONProtocolFactory() + jsProt475 := factory474.GetProtocol(mbTrans472) + argvalue0 := meta.NewDropGroupReq() + err476 := argvalue0.Read(jsProt475) + if err476 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropGroup(value0)) + fmt.Print("\n") + break + case "addZoneIntoGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZoneIntoGroup requires 1 args") + flag.Usage() + } + arg477 := flag.Arg(1) + mbTrans478 := thrift.NewMemoryBufferLen(len(arg477)) + defer mbTrans478.Close() + _, err479 := mbTrans478.WriteString(arg477) + if err479 != nil { + Usage() + return + } + factory480 := thrift.NewSimpleJSONProtocolFactory() + jsProt481 := factory480.GetProtocol(mbTrans478) + argvalue0 := meta.NewAddZoneIntoGroupReq() + err482 := argvalue0.Read(jsProt481) + if err482 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZoneIntoGroup(value0)) + fmt.Print("\n") + break + case "dropZoneFromGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZoneFromGroup requires 1 args") + flag.Usage() + } + arg483 := flag.Arg(1) + mbTrans484 := thrift.NewMemoryBufferLen(len(arg483)) + defer mbTrans484.Close() + _, err485 := mbTrans484.WriteString(arg483) + if err485 != nil { + Usage() + return + } + factory486 := thrift.NewSimpleJSONProtocolFactory() + jsProt487 := factory486.GetProtocol(mbTrans484) + argvalue0 := meta.NewDropZoneFromGroupReq() + err488 := argvalue0.Read(jsProt487) + if err488 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZoneFromGroup(value0)) + fmt.Print("\n") + break + case "getGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetGroup requires 1 args") + flag.Usage() + } + arg489 := flag.Arg(1) + mbTrans490 := thrift.NewMemoryBufferLen(len(arg489)) + defer mbTrans490.Close() + _, err491 := mbTrans490.WriteString(arg489) + if err491 != nil { + Usage() + return + } + factory492 := thrift.NewSimpleJSONProtocolFactory() + jsProt493 := factory492.GetProtocol(mbTrans490) + argvalue0 := meta.NewGetGroupReq() + err494 := argvalue0.Read(jsProt493) + if err494 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetGroup(value0)) + fmt.Print("\n") + break + case "listGroups": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListGroups requires 1 args") + flag.Usage() + } + arg495 := flag.Arg(1) + mbTrans496 := thrift.NewMemoryBufferLen(len(arg495)) + defer mbTrans496.Close() + _, err497 := mbTrans496.WriteString(arg495) + if err497 != nil { + Usage() + return + } + factory498 := thrift.NewSimpleJSONProtocolFactory() + jsProt499 := factory498.GetProtocol(mbTrans496) + argvalue0 := meta.NewListGroupsReq() + err500 := argvalue0.Read(jsProt499) + if err500 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListGroups(value0)) + fmt.Print("\n") + break + case "createBackup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") + flag.Usage() + } + arg501 := flag.Arg(1) + mbTrans502 := thrift.NewMemoryBufferLen(len(arg501)) + defer mbTrans502.Close() + _, err503 := mbTrans502.WriteString(arg501) + if err503 != nil { + Usage() + return + } + factory504 := thrift.NewSimpleJSONProtocolFactory() + jsProt505 := factory504.GetProtocol(mbTrans502) + argvalue0 := meta.NewCreateBackupReq() + err506 := argvalue0.Read(jsProt505) + if err506 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateBackup(value0)) + fmt.Print("\n") + break + case "restoreMeta": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") + flag.Usage() + } + arg507 := flag.Arg(1) + mbTrans508 := thrift.NewMemoryBufferLen(len(arg507)) + defer mbTrans508.Close() + _, err509 := mbTrans508.WriteString(arg507) + if err509 != nil { + Usage() + return + } + factory510 := thrift.NewSimpleJSONProtocolFactory() + jsProt511 := factory510.GetProtocol(mbTrans508) + argvalue0 := meta.NewRestoreMetaReq() + err512 := argvalue0.Read(jsProt511) + if err512 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RestoreMeta(value0)) + fmt.Print("\n") + break + case "addListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddListener requires 1 args") + flag.Usage() + } + arg513 := flag.Arg(1) + mbTrans514 := thrift.NewMemoryBufferLen(len(arg513)) + defer mbTrans514.Close() + _, err515 := mbTrans514.WriteString(arg513) + if err515 != nil { + Usage() + return + } + factory516 := thrift.NewSimpleJSONProtocolFactory() + jsProt517 := factory516.GetProtocol(mbTrans514) + argvalue0 := meta.NewAddListenerReq() + err518 := argvalue0.Read(jsProt517) + if err518 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddListener(value0)) + fmt.Print("\n") + break + case "removeListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") + flag.Usage() + } + arg519 := flag.Arg(1) + mbTrans520 := thrift.NewMemoryBufferLen(len(arg519)) + defer mbTrans520.Close() + _, err521 := mbTrans520.WriteString(arg519) + if err521 != nil { + Usage() + return + } + factory522 := thrift.NewSimpleJSONProtocolFactory() + jsProt523 := factory522.GetProtocol(mbTrans520) + argvalue0 := meta.NewRemoveListenerReq() + err524 := argvalue0.Read(jsProt523) + if err524 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveListener(value0)) + fmt.Print("\n") + break + case "listListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListListener requires 1 args") + flag.Usage() + } + arg525 := flag.Arg(1) + mbTrans526 := thrift.NewMemoryBufferLen(len(arg525)) + defer mbTrans526.Close() + _, err527 := mbTrans526.WriteString(arg525) + if err527 != nil { + Usage() + return + } + factory528 := thrift.NewSimpleJSONProtocolFactory() + jsProt529 := factory528.GetProtocol(mbTrans526) + argvalue0 := meta.NewListListenerReq() + err530 := argvalue0.Read(jsProt529) + if err530 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListListener(value0)) + fmt.Print("\n") + break + case "getStatis": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetStatis requires 1 args") + flag.Usage() + } + arg531 := flag.Arg(1) + mbTrans532 := thrift.NewMemoryBufferLen(len(arg531)) + defer mbTrans532.Close() + _, err533 := mbTrans532.WriteString(arg531) + if err533 != nil { + Usage() + return + } + factory534 := thrift.NewSimpleJSONProtocolFactory() + jsProt535 := factory534.GetProtocol(mbTrans532) + argvalue0 := meta.NewGetStatisReq() + err536 := argvalue0.Read(jsProt535) + if err536 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetStatis(value0)) + fmt.Print("\n") + break + case "signInFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignInFTService requires 1 args") + flag.Usage() + } + arg537 := flag.Arg(1) + mbTrans538 := thrift.NewMemoryBufferLen(len(arg537)) + defer mbTrans538.Close() + _, err539 := mbTrans538.WriteString(arg537) + if err539 != nil { + Usage() + return + } + factory540 := thrift.NewSimpleJSONProtocolFactory() + jsProt541 := factory540.GetProtocol(mbTrans538) + argvalue0 := meta.NewSignInFTServiceReq() + err542 := argvalue0.Read(jsProt541) + if err542 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignInFTService(value0)) + fmt.Print("\n") + break + case "signOutFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignOutFTService requires 1 args") + flag.Usage() + } + arg543 := flag.Arg(1) + mbTrans544 := thrift.NewMemoryBufferLen(len(arg543)) + defer mbTrans544.Close() + _, err545 := mbTrans544.WriteString(arg543) + if err545 != nil { + Usage() + return + } + factory546 := thrift.NewSimpleJSONProtocolFactory() + jsProt547 := factory546.GetProtocol(mbTrans544) + argvalue0 := meta.NewSignOutFTServiceReq() + err548 := argvalue0.Read(jsProt547) + if err548 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignOutFTService(value0)) + fmt.Print("\n") + break + case "listFTClients": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTClients requires 1 args") + flag.Usage() + } + arg549 := flag.Arg(1) + mbTrans550 := thrift.NewMemoryBufferLen(len(arg549)) + defer mbTrans550.Close() + _, err551 := mbTrans550.WriteString(arg549) + if err551 != nil { + Usage() + return + } + factory552 := thrift.NewSimpleJSONProtocolFactory() + jsProt553 := factory552.GetProtocol(mbTrans550) + argvalue0 := meta.NewListFTClientsReq() + err554 := argvalue0.Read(jsProt553) + if err554 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTClients(value0)) + fmt.Print("\n") + break + case "createFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateFTIndex requires 1 args") + flag.Usage() + } + arg555 := flag.Arg(1) + mbTrans556 := thrift.NewMemoryBufferLen(len(arg555)) + defer mbTrans556.Close() + _, err557 := mbTrans556.WriteString(arg555) + if err557 != nil { + Usage() + return + } + factory558 := thrift.NewSimpleJSONProtocolFactory() + jsProt559 := factory558.GetProtocol(mbTrans556) + argvalue0 := meta.NewCreateFTIndexReq() + err560 := argvalue0.Read(jsProt559) + if err560 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateFTIndex(value0)) + fmt.Print("\n") + break + case "dropFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropFTIndex requires 1 args") + flag.Usage() + } + arg561 := flag.Arg(1) + mbTrans562 := thrift.NewMemoryBufferLen(len(arg561)) + defer mbTrans562.Close() + _, err563 := mbTrans562.WriteString(arg561) + if err563 != nil { + Usage() + return + } + factory564 := thrift.NewSimpleJSONProtocolFactory() + jsProt565 := factory564.GetProtocol(mbTrans562) + argvalue0 := meta.NewDropFTIndexReq() + err566 := argvalue0.Read(jsProt565) + if err566 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropFTIndex(value0)) + fmt.Print("\n") + break + case "listFTIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTIndexes requires 1 args") + flag.Usage() + } + arg567 := flag.Arg(1) + mbTrans568 := thrift.NewMemoryBufferLen(len(arg567)) + defer mbTrans568.Close() + _, err569 := mbTrans568.WriteString(arg567) + if err569 != nil { + Usage() + return + } + factory570 := thrift.NewSimpleJSONProtocolFactory() + jsProt571 := factory570.GetProtocol(mbTrans568) + argvalue0 := meta.NewListFTIndexesReq() + err572 := argvalue0.Read(jsProt571) + if err572 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTIndexes(value0)) + fmt.Print("\n") + break + case "createSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") + flag.Usage() + } + arg573 := flag.Arg(1) + mbTrans574 := thrift.NewMemoryBufferLen(len(arg573)) + defer mbTrans574.Close() + _, err575 := mbTrans574.WriteString(arg573) + if err575 != nil { + Usage() + return + } + factory576 := thrift.NewSimpleJSONProtocolFactory() + jsProt577 := factory576.GetProtocol(mbTrans574) + argvalue0 := meta.NewCreateSessionReq() + err578 := argvalue0.Read(jsProt577) + if err578 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSession(value0)) + fmt.Print("\n") + break + case "updateSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") + flag.Usage() + } + arg579 := flag.Arg(1) + mbTrans580 := thrift.NewMemoryBufferLen(len(arg579)) + defer mbTrans580.Close() + _, err581 := mbTrans580.WriteString(arg579) + if err581 != nil { + Usage() + return + } + factory582 := thrift.NewSimpleJSONProtocolFactory() + jsProt583 := factory582.GetProtocol(mbTrans580) + argvalue0 := meta.NewUpdateSessionsReq() + err584 := argvalue0.Read(jsProt583) + if err584 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateSessions(value0)) + fmt.Print("\n") + break + case "listSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") + flag.Usage() + } + arg585 := flag.Arg(1) + mbTrans586 := thrift.NewMemoryBufferLen(len(arg585)) + defer mbTrans586.Close() + _, err587 := mbTrans586.WriteString(arg585) + if err587 != nil { + Usage() + return + } + factory588 := thrift.NewSimpleJSONProtocolFactory() + jsProt589 := factory588.GetProtocol(mbTrans586) + argvalue0 := meta.NewListSessionsReq() + err590 := argvalue0.Read(jsProt589) + if err590 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSessions(value0)) + fmt.Print("\n") + break + case "getSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSession requires 1 args") + flag.Usage() + } + arg591 := flag.Arg(1) + mbTrans592 := thrift.NewMemoryBufferLen(len(arg591)) + defer mbTrans592.Close() + _, err593 := mbTrans592.WriteString(arg591) + if err593 != nil { + Usage() + return + } + factory594 := thrift.NewSimpleJSONProtocolFactory() + jsProt595 := factory594.GetProtocol(mbTrans592) + argvalue0 := meta.NewGetSessionReq() + err596 := argvalue0.Read(jsProt595) + if err596 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSession(value0)) + fmt.Print("\n") + break + case "removeSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") + flag.Usage() + } + arg597 := flag.Arg(1) + mbTrans598 := thrift.NewMemoryBufferLen(len(arg597)) + defer mbTrans598.Close() + _, err599 := mbTrans598.WriteString(arg597) + if err599 != nil { + Usage() + return + } + factory600 := thrift.NewSimpleJSONProtocolFactory() + jsProt601 := factory600.GetProtocol(mbTrans598) + argvalue0 := meta.NewRemoveSessionReq() + err602 := argvalue0.Read(jsProt601) + if err602 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveSession(value0)) + fmt.Print("\n") + break + case "killQuery": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "KillQuery requires 1 args") + flag.Usage() + } + arg603 := flag.Arg(1) + mbTrans604 := thrift.NewMemoryBufferLen(len(arg603)) + defer mbTrans604.Close() + _, err605 := mbTrans604.WriteString(arg603) + if err605 != nil { + Usage() + return + } + factory606 := thrift.NewSimpleJSONProtocolFactory() + jsProt607 := factory606.GetProtocol(mbTrans604) + argvalue0 := meta.NewKillQueryReq() + err608 := argvalue0.Read(jsProt607) + if err608 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.KillQuery(value0)) + fmt.Print("\n") + break + case "reportTaskFinish": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") + flag.Usage() + } + arg609 := flag.Arg(1) + mbTrans610 := thrift.NewMemoryBufferLen(len(arg609)) + defer mbTrans610.Close() + _, err611 := mbTrans610.WriteString(arg609) + if err611 != nil { + Usage() + return + } + factory612 := thrift.NewSimpleJSONProtocolFactory() + jsProt613 := factory612.GetProtocol(mbTrans610) + argvalue0 := meta.NewReportTaskReq() + err614 := argvalue0.Read(jsProt613) + if err614 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ReportTaskFinish(value0)) + fmt.Print("\n") + break + case "listCluster": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListCluster requires 1 args") + flag.Usage() + } + arg615 := flag.Arg(1) + mbTrans616 := thrift.NewMemoryBufferLen(len(arg615)) + defer mbTrans616.Close() + _, err617 := mbTrans616.WriteString(arg615) + if err617 != nil { + Usage() + return + } + factory618 := thrift.NewSimpleJSONProtocolFactory() + jsProt619 := factory618.GetProtocol(mbTrans616) + argvalue0 := meta.NewListClusterInfoReq() + err620 := argvalue0.Read(jsProt619) + if err620 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListCluster(value0)) + fmt.Print("\n") + break + case "getMetaDirInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetMetaDirInfo requires 1 args") + flag.Usage() + } + arg621 := flag.Arg(1) + mbTrans622 := thrift.NewMemoryBufferLen(len(arg621)) + defer mbTrans622.Close() + _, err623 := mbTrans622.WriteString(arg621) + if err623 != nil { + Usage() + return + } + factory624 := thrift.NewSimpleJSONProtocolFactory() + jsProt625 := factory624.GetProtocol(mbTrans622) + argvalue0 := meta.NewGetMetaDirInfoReq() + err626 := argvalue0.Read(jsProt625) + if err626 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetMetaDirInfo(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/meta/metaservice.go b/ccore/nebula/internal/thrift/v2_5_0/meta/metaservice.go new file mode 100644 index 0000000..344515e --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/meta/metaservice.go @@ -0,0 +1,27604 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type MetaService interface { + // Parameters: + // - Req + CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStatis(ctx context.Context, req *GetStatisReq) (_r *GetStatisResp, err error) + // Parameters: + // - Req + SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) +} + +type MetaServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateTag(req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) + // Parameters: + // - Req + SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) +} + +type MetaServiceClient struct { + MetaServiceClientInterface + CC thrift.ClientConn +} + +func(client *MetaServiceClient) Open() error { + return client.CC.Open() +} + +func(client *MetaServiceClient) Close() error { + return client.CC.Close() +} + +func(client *MetaServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewMetaServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceClientProtocol(prot thrift.Protocol) *MetaServiceClient { + return NewMetaServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Get(req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) { + args := MetaServiceGetStatisArgs{ + Req : req, + } + err = p.CC.SendMsg("getStatis", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStatis() +} + + +func (p *MetaServiceClient) recvGetStatis() (value *GetStatisResp, err error) { + var result MetaServiceGetStatisResult + err = p.CC.RecvMsg("getStatis", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceThreadsafeClient struct { + MetaServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *MetaServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *MetaServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *MetaServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewMetaServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceThreadsafeClientProtocol(prot thrift.Protocol) *MetaServiceThreadsafeClient { + return NewMetaServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceThreadsafeClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceThreadsafeClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceThreadsafeClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceThreadsafeClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceThreadsafeClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Get(req *GetReq) (_r *GetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceThreadsafeClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceThreadsafeClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceThreadsafeClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceThreadsafeClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceThreadsafeClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceThreadsafeClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceThreadsafeClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceThreadsafeClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceThreadsafeClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceThreadsafeClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceThreadsafeClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceThreadsafeClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceThreadsafeClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceThreadsafeClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceThreadsafeClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceThreadsafeClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceThreadsafeClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetStatisArgs{ + Req : req, + } + err = p.CC.SendMsg("getStatis", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStatis() +} + + +func (p *MetaServiceThreadsafeClient) recvGetStatis() (value *GetStatisResp, err error) { + var result MetaServiceGetStatisResult + err = p.CC.RecvMsg("getStatis", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceThreadsafeClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceThreadsafeClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceThreadsafeClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceThreadsafeClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *MetaServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *MetaServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *MetaServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewMetaServiceChannelClient(channel thrift.RequestChannel) *MetaServiceChannelClient { + return &MetaServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + var result MetaServiceCreateSpaceResult + err = p.RequestChannel.Call(ctx, "createSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + var result MetaServiceDropSpaceResult + err = p.RequestChannel.Call(ctx, "dropSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + var result MetaServiceGetSpaceResult + err = p.RequestChannel.Call(ctx, "getSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + var result MetaServiceListSpacesResult + err = p.RequestChannel.Call(ctx, "listSpaces", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + var result MetaServiceCreateTagResult + err = p.RequestChannel.Call(ctx, "createTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + var result MetaServiceAlterTagResult + err = p.RequestChannel.Call(ctx, "alterTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + var result MetaServiceDropTagResult + err = p.RequestChannel.Call(ctx, "dropTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + var result MetaServiceGetTagResult + err = p.RequestChannel.Call(ctx, "getTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + var result MetaServiceListTagsResult + err = p.RequestChannel.Call(ctx, "listTags", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + var result MetaServiceCreateEdgeResult + err = p.RequestChannel.Call(ctx, "createEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + var result MetaServiceAlterEdgeResult + err = p.RequestChannel.Call(ctx, "alterEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + var result MetaServiceDropEdgeResult + err = p.RequestChannel.Call(ctx, "dropEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + var result MetaServiceGetEdgeResult + err = p.RequestChannel.Call(ctx, "getEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + var result MetaServiceListEdgesResult + err = p.RequestChannel.Call(ctx, "listEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + var result MetaServiceListHostsResult + err = p.RequestChannel.Call(ctx, "listHosts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + var result MetaServiceGetPartsAllocResult + err = p.RequestChannel.Call(ctx, "getPartsAlloc", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + var result MetaServiceListPartsResult + err = p.RequestChannel.Call(ctx, "listParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + var result MetaServiceMultiPutResult + err = p.RequestChannel.Call(ctx, "multiPut", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + var result MetaServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + var result MetaServiceMultiGetResult + err = p.RequestChannel.Call(ctx, "multiGet", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + var result MetaServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + var result MetaServiceRemoveRangeResult + err = p.RequestChannel.Call(ctx, "removeRange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + var result MetaServiceScanResult + err = p.RequestChannel.Call(ctx, "scan", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + var result MetaServiceCreateTagIndexResult + err = p.RequestChannel.Call(ctx, "createTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + var result MetaServiceDropTagIndexResult + err = p.RequestChannel.Call(ctx, "dropTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + var result MetaServiceGetTagIndexResult + err = p.RequestChannel.Call(ctx, "getTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + var result MetaServiceListTagIndexesResult + err = p.RequestChannel.Call(ctx, "listTagIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + var result MetaServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + var result MetaServiceListTagIndexStatusResult + err = p.RequestChannel.Call(ctx, "listTagIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + var result MetaServiceCreateEdgeIndexResult + err = p.RequestChannel.Call(ctx, "createEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + var result MetaServiceDropEdgeIndexResult + err = p.RequestChannel.Call(ctx, "dropEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + var result MetaServiceGetEdgeIndexResult + err = p.RequestChannel.Call(ctx, "getEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexesResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result MetaServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexStatusResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + var result MetaServiceCreateUserResult + err = p.RequestChannel.Call(ctx, "createUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + var result MetaServiceDropUserResult + err = p.RequestChannel.Call(ctx, "dropUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + var result MetaServiceAlterUserResult + err = p.RequestChannel.Call(ctx, "alterUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + var result MetaServiceGrantRoleResult + err = p.RequestChannel.Call(ctx, "grantRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + var result MetaServiceRevokeRoleResult + err = p.RequestChannel.Call(ctx, "revokeRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + var result MetaServiceListUsersResult + err = p.RequestChannel.Call(ctx, "listUsers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + var result MetaServiceListRolesResult + err = p.RequestChannel.Call(ctx, "listRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + var result MetaServiceGetUserRolesResult + err = p.RequestChannel.Call(ctx, "getUserRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + var result MetaServiceChangePasswordResult + err = p.RequestChannel.Call(ctx, "changePassword", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + var result MetaServiceHeartBeatResult + err = p.RequestChannel.Call(ctx, "heartBeat", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + var result MetaServiceBalanceResult + err = p.RequestChannel.Call(ctx, "balance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + var result MetaServiceLeaderBalanceResult + err = p.RequestChannel.Call(ctx, "leaderBalance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + var result MetaServiceRegConfigResult + err = p.RequestChannel.Call(ctx, "regConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + var result MetaServiceGetConfigResult + err = p.RequestChannel.Call(ctx, "getConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + var result MetaServiceSetConfigResult + err = p.RequestChannel.Call(ctx, "setConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + var result MetaServiceListConfigsResult + err = p.RequestChannel.Call(ctx, "listConfigs", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + var result MetaServiceCreateSnapshotResult + err = p.RequestChannel.Call(ctx, "createSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + var result MetaServiceDropSnapshotResult + err = p.RequestChannel.Call(ctx, "dropSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + var result MetaServiceListSnapshotsResult + err = p.RequestChannel.Call(ctx, "listSnapshots", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + var result MetaServiceRunAdminJobResult + err = p.RequestChannel.Call(ctx, "runAdminJob", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + var result MetaServiceAddZoneResult + err = p.RequestChannel.Call(ctx, "addZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + var result MetaServiceDropZoneResult + err = p.RequestChannel.Call(ctx, "dropZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + var result MetaServiceAddHostIntoZoneResult + err = p.RequestChannel.Call(ctx, "addHostIntoZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + var result MetaServiceDropHostFromZoneResult + err = p.RequestChannel.Call(ctx, "dropHostFromZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + var result MetaServiceGetZoneResult + err = p.RequestChannel.Call(ctx, "getZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + var result MetaServiceListZonesResult + err = p.RequestChannel.Call(ctx, "listZones", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + var result MetaServiceAddGroupResult + err = p.RequestChannel.Call(ctx, "addGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + var result MetaServiceDropGroupResult + err = p.RequestChannel.Call(ctx, "dropGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + var result MetaServiceAddZoneIntoGroupResult + err = p.RequestChannel.Call(ctx, "addZoneIntoGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + var result MetaServiceDropZoneFromGroupResult + err = p.RequestChannel.Call(ctx, "dropZoneFromGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + var result MetaServiceGetGroupResult + err = p.RequestChannel.Call(ctx, "getGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + var result MetaServiceListGroupsResult + err = p.RequestChannel.Call(ctx, "listGroups", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + var result MetaServiceCreateBackupResult + err = p.RequestChannel.Call(ctx, "createBackup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + var result MetaServiceRestoreMetaResult + err = p.RequestChannel.Call(ctx, "restoreMeta", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + var result MetaServiceAddListenerResult + err = p.RequestChannel.Call(ctx, "addListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + var result MetaServiceRemoveListenerResult + err = p.RequestChannel.Call(ctx, "removeListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + var result MetaServiceListListenerResult + err = p.RequestChannel.Call(ctx, "listListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetStatis(ctx context.Context, req *GetStatisReq) (_r *GetStatisResp, err error) { + args := MetaServiceGetStatisArgs{ + Req : req, + } + var result MetaServiceGetStatisResult + err = p.RequestChannel.Call(ctx, "getStatis", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + var result MetaServiceSignInFTServiceResult + err = p.RequestChannel.Call(ctx, "signInFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + var result MetaServiceSignOutFTServiceResult + err = p.RequestChannel.Call(ctx, "signOutFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + var result MetaServiceListFTClientsResult + err = p.RequestChannel.Call(ctx, "listFTClients", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + var result MetaServiceCreateFTIndexResult + err = p.RequestChannel.Call(ctx, "createFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + var result MetaServiceDropFTIndexResult + err = p.RequestChannel.Call(ctx, "dropFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + var result MetaServiceListFTIndexesResult + err = p.RequestChannel.Call(ctx, "listFTIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + var result MetaServiceCreateSessionResult + err = p.RequestChannel.Call(ctx, "createSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + var result MetaServiceUpdateSessionsResult + err = p.RequestChannel.Call(ctx, "updateSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + var result MetaServiceListSessionsResult + err = p.RequestChannel.Call(ctx, "listSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + var result MetaServiceGetSessionResult + err = p.RequestChannel.Call(ctx, "getSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + var result MetaServiceRemoveSessionResult + err = p.RequestChannel.Call(ctx, "removeSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + var result MetaServiceKillQueryResult + err = p.RequestChannel.Call(ctx, "killQuery", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + var result MetaServiceReportTaskFinishResult + err = p.RequestChannel.Call(ctx, "reportTaskFinish", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + var result MetaServiceListClusterResult + err = p.RequestChannel.Call(ctx, "listCluster", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + var result MetaServiceGetMetaDirInfoResult + err = p.RequestChannel.Call(ctx, "getMetaDirInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler MetaService +} + +func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *MetaServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { + self97 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self97.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self97.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self97.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self97.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self97.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self97.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self97.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self97.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self97.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self97.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self97.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self97.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self97.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self97.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self97.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self97.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self97.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self97.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} + self97.processorMap["get"] = &metaServiceProcessorGet{handler:handler} + self97.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} + self97.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} + self97.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} + self97.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} + self97.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self97.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self97.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self97.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self97.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self97.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self97.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self97.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self97.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self97.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self97.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self97.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self97.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self97.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self97.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self97.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self97.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self97.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self97.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self97.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self97.processorMap["balance"] = &metaServiceProcessorBalance{handler:handler} + self97.processorMap["leaderBalance"] = &metaServiceProcessorLeaderBalance{handler:handler} + self97.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self97.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self97.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self97.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self97.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self97.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self97.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self97.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self97.processorMap["addZone"] = &metaServiceProcessorAddZone{handler:handler} + self97.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self97.processorMap["addHostIntoZone"] = &metaServiceProcessorAddHostIntoZone{handler:handler} + self97.processorMap["dropHostFromZone"] = &metaServiceProcessorDropHostFromZone{handler:handler} + self97.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self97.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self97.processorMap["addGroup"] = &metaServiceProcessorAddGroup{handler:handler} + self97.processorMap["dropGroup"] = &metaServiceProcessorDropGroup{handler:handler} + self97.processorMap["addZoneIntoGroup"] = &metaServiceProcessorAddZoneIntoGroup{handler:handler} + self97.processorMap["dropZoneFromGroup"] = &metaServiceProcessorDropZoneFromGroup{handler:handler} + self97.processorMap["getGroup"] = &metaServiceProcessorGetGroup{handler:handler} + self97.processorMap["listGroups"] = &metaServiceProcessorListGroups{handler:handler} + self97.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self97.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self97.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self97.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self97.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self97.processorMap["getStatis"] = &metaServiceProcessorGetStatis{handler:handler} + self97.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} + self97.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} + self97.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} + self97.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self97.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self97.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self97.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self97.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self97.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self97.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self97.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self97.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self97.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self97.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self97.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + return self97 +} + +type metaServiceProcessorCreateSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSpace) 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("createSpace", 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 *metaServiceProcessorCreateSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSpaceArgs) + var result MetaServiceCreateSpaceResult + if retval, err := p.handler.CreateSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSpace) 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("dropSpace", 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 *metaServiceProcessorDropSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSpaceArgs) + var result MetaServiceDropSpaceResult + if retval, err := p.handler.DropSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSpace) 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("getSpace", 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 *metaServiceProcessorGetSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSpaceArgs) + var result MetaServiceGetSpaceResult + if retval, err := p.handler.GetSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSpaces struct { + handler MetaService +} + +func (p *metaServiceProcessorListSpaces) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSpacesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSpaces) 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("listSpaces", 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 *metaServiceProcessorListSpaces) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSpacesArgs) + var result MetaServiceListSpacesResult + if retval, err := p.handler.ListSpaces(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSpaces: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTag struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTag) 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("createTag", 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 *metaServiceProcessorCreateTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagArgs) + var result MetaServiceCreateTagResult + if retval, err := p.handler.CreateTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterTag struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterTag) 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("alterTag", 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 *metaServiceProcessorAlterTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterTagArgs) + var result MetaServiceAlterTagResult + if retval, err := p.handler.AlterTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTag struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTag) 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("dropTag", 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 *metaServiceProcessorDropTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagArgs) + var result MetaServiceDropTagResult + if retval, err := p.handler.DropTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTag struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTag) 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("getTag", 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 *metaServiceProcessorGetTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagArgs) + var result MetaServiceGetTagResult + if retval, err := p.handler.GetTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTags struct { + handler MetaService +} + +func (p *metaServiceProcessorListTags) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTags) 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("listTags", 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 *metaServiceProcessorListTags) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagsArgs) + var result MetaServiceListTagsResult + if retval, err := p.handler.ListTags(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTags: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdge) 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("createEdge", 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 *metaServiceProcessorCreateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeArgs) + var result MetaServiceCreateEdgeResult + if retval, err := p.handler.CreateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterEdge) 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("alterEdge", 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 *metaServiceProcessorAlterEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterEdgeArgs) + var result MetaServiceAlterEdgeResult + if retval, err := p.handler.AlterEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdge) 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("dropEdge", 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 *metaServiceProcessorDropEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeArgs) + var result MetaServiceDropEdgeResult + if retval, err := p.handler.DropEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdge) 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("getEdge", 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 *metaServiceProcessorGetEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeArgs) + var result MetaServiceGetEdgeResult + if retval, err := p.handler.GetEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdges struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdges) 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("listEdges", 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 *metaServiceProcessorListEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgesArgs) + var result MetaServiceListEdgesResult + if retval, err := p.handler.ListEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorListHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListHosts) 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("listHosts", 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 *metaServiceProcessorListHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListHostsArgs) + var result MetaServiceListHostsResult + if retval, err := p.handler.ListHosts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetPartsAlloc struct { + handler MetaService +} + +func (p *metaServiceProcessorGetPartsAlloc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetPartsAllocArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetPartsAlloc) 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("getPartsAlloc", 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 *metaServiceProcessorGetPartsAlloc) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetPartsAllocArgs) + var result MetaServiceGetPartsAllocResult + if retval, err := p.handler.GetPartsAlloc(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartsAlloc: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListParts struct { + handler MetaService +} + +func (p *metaServiceProcessorListParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListParts) 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("listParts", 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 *metaServiceProcessorListParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListPartsArgs) + var result MetaServiceListPartsResult + if retval, err := p.handler.ListParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiPut struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiPutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiPut) 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("multiPut", 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 *metaServiceProcessorMultiPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiPutArgs) + var result MetaServiceMultiPutResult + if retval, err := p.handler.MultiPut(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiPut: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGet struct { + handler MetaService +} + +func (p *metaServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetArgs) + var result MetaServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiGet struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiGet) 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("multiGet", 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 *metaServiceProcessorMultiGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiGetArgs) + var result MetaServiceMultiGetResult + if retval, err := p.handler.MultiGet(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiGet: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemove struct { + handler MetaService +} + +func (p *metaServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveArgs) + var result MetaServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveRange struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveRange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveRangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveRange) 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("removeRange", 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 *metaServiceProcessorRemoveRange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveRangeArgs) + var result MetaServiceRemoveRangeResult + if retval, err := p.handler.RemoveRange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeRange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorScan struct { + handler MetaService +} + +func (p *metaServiceProcessorScan) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceScanArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorScan) 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("scan", 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 *metaServiceProcessorScan) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceScanArgs) + var result MetaServiceScanResult + if retval, err := p.handler.Scan(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTagIndex) 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("createTagIndex", 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 *metaServiceProcessorCreateTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagIndexArgs) + var result MetaServiceCreateTagIndexResult + if retval, err := p.handler.CreateTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTagIndex) 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("dropTagIndex", 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 *metaServiceProcessorDropTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagIndexArgs) + var result MetaServiceDropTagIndexResult + if retval, err := p.handler.DropTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTagIndex) 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("getTagIndex", 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 *metaServiceProcessorGetTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagIndexArgs) + var result MetaServiceGetTagIndexResult + if retval, err := p.handler.GetTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexes) 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("listTagIndexes", 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 *metaServiceProcessorListTagIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexesArgs) + var result MetaServiceListTagIndexesResult + if retval, err := p.handler.ListTagIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *metaServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildTagIndexArgs) + var result MetaServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexStatus) 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("listTagIndexStatus", 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 *metaServiceProcessorListTagIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexStatusArgs) + var result MetaServiceListTagIndexStatusResult + if retval, err := p.handler.ListTagIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdgeIndex) 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("createEdgeIndex", 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 *metaServiceProcessorCreateEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeIndexArgs) + var result MetaServiceCreateEdgeIndexResult + if retval, err := p.handler.CreateEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdgeIndex) 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("dropEdgeIndex", 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 *metaServiceProcessorDropEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeIndexArgs) + var result MetaServiceDropEdgeIndexResult + if retval, err := p.handler.DropEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdgeIndex) 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("getEdgeIndex", 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 *metaServiceProcessorGetEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeIndexArgs) + var result MetaServiceGetEdgeIndexResult + if retval, err := p.handler.GetEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexes) 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("listEdgeIndexes", 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 *metaServiceProcessorListEdgeIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexesArgs) + var result MetaServiceListEdgeIndexesResult + if retval, err := p.handler.ListEdgeIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *metaServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildEdgeIndexArgs) + var result MetaServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexStatus) 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("listEdgeIndexStatus", 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 *metaServiceProcessorListEdgeIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexStatusArgs) + var result MetaServiceListEdgeIndexStatusResult + if retval, err := p.handler.ListEdgeIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateUser struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateUser) 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("createUser", 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 *metaServiceProcessorCreateUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateUserArgs) + var result MetaServiceCreateUserResult + if retval, err := p.handler.CreateUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropUser struct { + handler MetaService +} + +func (p *metaServiceProcessorDropUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropUser) 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("dropUser", 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 *metaServiceProcessorDropUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropUserArgs) + var result MetaServiceDropUserResult + if retval, err := p.handler.DropUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterUser struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterUser) 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("alterUser", 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 *metaServiceProcessorAlterUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterUserArgs) + var result MetaServiceAlterUserResult + if retval, err := p.handler.AlterUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGrantRole struct { + handler MetaService +} + +func (p *metaServiceProcessorGrantRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGrantRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGrantRole) 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("grantRole", 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 *metaServiceProcessorGrantRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGrantRoleArgs) + var result MetaServiceGrantRoleResult + if retval, err := p.handler.GrantRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grantRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRevokeRole struct { + handler MetaService +} + +func (p *metaServiceProcessorRevokeRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRevokeRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRevokeRole) 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("revokeRole", 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 *metaServiceProcessorRevokeRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRevokeRoleArgs) + var result MetaServiceRevokeRoleResult + if retval, err := p.handler.RevokeRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListUsers struct { + handler MetaService +} + +func (p *metaServiceProcessorListUsers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListUsersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListUsers) 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("listUsers", 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 *metaServiceProcessorListUsers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListUsersArgs) + var result MetaServiceListUsersResult + if retval, err := p.handler.ListUsers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listUsers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorListRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListRoles) 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("listRoles", 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 *metaServiceProcessorListRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListRolesArgs) + var result MetaServiceListRolesResult + if retval, err := p.handler.ListRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetUserRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorGetUserRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetUserRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetUserRoles) 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("getUserRoles", 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 *metaServiceProcessorGetUserRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetUserRolesArgs) + var result MetaServiceGetUserRolesResult + if retval, err := p.handler.GetUserRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUserRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorChangePassword struct { + handler MetaService +} + +func (p *metaServiceProcessorChangePassword) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceChangePasswordArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorChangePassword) 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("changePassword", 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 *metaServiceProcessorChangePassword) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceChangePasswordArgs) + var result MetaServiceChangePasswordResult + if retval, err := p.handler.ChangePassword(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changePassword: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorHeartBeat struct { + handler MetaService +} + +func (p *metaServiceProcessorHeartBeat) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceHeartBeatArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorHeartBeat) 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("heartBeat", 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 *metaServiceProcessorHeartBeat) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceHeartBeatArgs) + var result MetaServiceHeartBeatResult + if retval, err := p.handler.HeartBeat(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing heartBeat: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorBalance) 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("balance", 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 *metaServiceProcessorBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceBalanceArgs) + var result MetaServiceBalanceResult + if retval, err := p.handler.Balance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing balance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorLeaderBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorLeaderBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceLeaderBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorLeaderBalance) 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("leaderBalance", 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 *metaServiceProcessorLeaderBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceLeaderBalanceArgs) + var result MetaServiceLeaderBalanceResult + if retval, err := p.handler.LeaderBalance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing leaderBalance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRegConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorRegConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRegConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRegConfig) 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("regConfig", 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 *metaServiceProcessorRegConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRegConfigArgs) + var result MetaServiceRegConfigResult + if retval, err := p.handler.RegConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing regConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorGetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetConfig) 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("getConfig", 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 *metaServiceProcessorGetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetConfigArgs) + var result MetaServiceGetConfigResult + if retval, err := p.handler.GetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorSetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSetConfig) 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("setConfig", 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 *metaServiceProcessorSetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSetConfigArgs) + var result MetaServiceSetConfigResult + if retval, err := p.handler.SetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListConfigs struct { + handler MetaService +} + +func (p *metaServiceProcessorListConfigs) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListConfigsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListConfigs) 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("listConfigs", 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 *metaServiceProcessorListConfigs) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListConfigsArgs) + var result MetaServiceListConfigsResult + if retval, err := p.handler.ListConfigs(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listConfigs: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSnapshot) 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("createSnapshot", 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 *metaServiceProcessorCreateSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSnapshotArgs) + var result MetaServiceCreateSnapshotResult + if retval, err := p.handler.CreateSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSnapshot) 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("dropSnapshot", 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 *metaServiceProcessorDropSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSnapshotArgs) + var result MetaServiceDropSnapshotResult + if retval, err := p.handler.DropSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSnapshots struct { + handler MetaService +} + +func (p *metaServiceProcessorListSnapshots) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSnapshotsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSnapshots) 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("listSnapshots", 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 *metaServiceProcessorListSnapshots) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSnapshotsArgs) + var result MetaServiceListSnapshotsResult + if retval, err := p.handler.ListSnapshots(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSnapshots: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRunAdminJob struct { + handler MetaService +} + +func (p *metaServiceProcessorRunAdminJob) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRunAdminJobArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRunAdminJob) 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("runAdminJob", 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 *metaServiceProcessorRunAdminJob) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRunAdminJobArgs) + var result MetaServiceRunAdminJobResult + if retval, err := p.handler.RunAdminJob(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing runAdminJob: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneArgs) + var result MetaServiceAddZoneResult + if retval, err := p.handler.AddZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZone) 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("dropZone", 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 *metaServiceProcessorDropZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneArgs) + var result MetaServiceDropZoneResult + if retval, err := p.handler.DropZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddHostIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostIntoZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHostIntoZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddHostIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostIntoZoneArgs) + var result MetaServiceAddHostIntoZoneResult + if retval, err := p.handler.AddHostIntoZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostIntoZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropHostFromZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropHostFromZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("dropHostFromZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorDropHostFromZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropHostFromZoneArgs) + var result MetaServiceDropHostFromZoneResult + if retval, err := p.handler.DropHostFromZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHostFromZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetZone struct { + handler MetaService +} + +func (p *metaServiceProcessorGetZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetZone) 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("getZone", 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 *metaServiceProcessorGetZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetZoneArgs) + var result MetaServiceGetZoneResult + if retval, err := p.handler.GetZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListZones struct { + handler MetaService +} + +func (p *metaServiceProcessorListZones) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListZonesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListZones) 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("listZones", 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 *metaServiceProcessorListZones) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListZonesArgs) + var result MetaServiceListZonesResult + if retval, err := p.handler.ListZones(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listZones: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddGroup) 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("addGroup", 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 *metaServiceProcessorAddGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddGroupArgs) + var result MetaServiceAddGroupResult + if retval, err := p.handler.AddGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropGroup) 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("dropGroup", 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 *metaServiceProcessorDropGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropGroupArgs) + var result MetaServiceDropGroupResult + if retval, err := p.handler.DropGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZoneIntoGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZoneIntoGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneIntoGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZoneIntoGroup) 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("addZoneIntoGroup", 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 *metaServiceProcessorAddZoneIntoGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneIntoGroupArgs) + var result MetaServiceAddZoneIntoGroupResult + if retval, err := p.handler.AddZoneIntoGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZoneIntoGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZoneFromGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZoneFromGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneFromGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZoneFromGroup) 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("dropZoneFromGroup", 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 *metaServiceProcessorDropZoneFromGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneFromGroupArgs) + var result MetaServiceDropZoneFromGroupResult + if retval, err := p.handler.DropZoneFromGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZoneFromGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorGetGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetGroup) 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("getGroup", 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 *metaServiceProcessorGetGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetGroupArgs) + var result MetaServiceGetGroupResult + if retval, err := p.handler.GetGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListGroups struct { + handler MetaService +} + +func (p *metaServiceProcessorListGroups) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListGroupsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListGroups) 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("listGroups", 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 *metaServiceProcessorListGroups) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListGroupsArgs) + var result MetaServiceListGroupsResult + if retval, err := p.handler.ListGroups(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listGroups: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateBackup struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateBackup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateBackupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateBackup) 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("createBackup", 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 *metaServiceProcessorCreateBackup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateBackupArgs) + var result MetaServiceCreateBackupResult + if retval, err := p.handler.CreateBackup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createBackup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRestoreMeta struct { + handler MetaService +} + +func (p *metaServiceProcessorRestoreMeta) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRestoreMetaArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRestoreMeta) 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("restoreMeta", 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 *metaServiceProcessorRestoreMeta) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRestoreMetaArgs) + var result MetaServiceRestoreMetaResult + if retval, err := p.handler.RestoreMeta(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restoreMeta: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddListener struct { + handler MetaService +} + +func (p *metaServiceProcessorAddListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddListener) 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("addListener", 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 *metaServiceProcessorAddListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddListenerArgs) + var result MetaServiceAddListenerResult + if retval, err := p.handler.AddListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveListener struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveListener) 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("removeListener", 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 *metaServiceProcessorRemoveListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveListenerArgs) + var result MetaServiceRemoveListenerResult + if retval, err := p.handler.RemoveListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListListener struct { + handler MetaService +} + +func (p *metaServiceProcessorListListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListListener) 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("listListener", 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 *metaServiceProcessorListListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListListenerArgs) + var result MetaServiceListListenerResult + if retval, err := p.handler.ListListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetStatis struct { + handler MetaService +} + +func (p *metaServiceProcessorGetStatis) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetStatisArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetStatis) 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("getStatis", 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 *metaServiceProcessorGetStatis) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetStatisArgs) + var result MetaServiceGetStatisResult + if retval, err := p.handler.GetStatis(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStatis: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignInFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignInFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignInFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignInFTService) 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("signInFTService", 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 *metaServiceProcessorSignInFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignInFTServiceArgs) + var result MetaServiceSignInFTServiceResult + if retval, err := p.handler.SignInFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignOutFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignOutFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignOutFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignOutFTService) 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("signOutFTService", 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 *metaServiceProcessorSignOutFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignOutFTServiceArgs) + var result MetaServiceSignOutFTServiceResult + if retval, err := p.handler.SignOutFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTClients struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTClients) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTClientsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTClients) 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("listFTClients", 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 *metaServiceProcessorListFTClients) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTClientsArgs) + var result MetaServiceListFTClientsResult + if retval, err := p.handler.ListFTClients(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTClients: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateFTIndex) 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("createFTIndex", 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 *metaServiceProcessorCreateFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateFTIndexArgs) + var result MetaServiceCreateFTIndexResult + if retval, err := p.handler.CreateFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropFTIndex) 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("dropFTIndex", 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 *metaServiceProcessorDropFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropFTIndexArgs) + var result MetaServiceDropFTIndexResult + if retval, err := p.handler.DropFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTIndexes) 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("listFTIndexes", 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 *metaServiceProcessorListFTIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTIndexesArgs) + var result MetaServiceListFTIndexesResult + if retval, err := p.handler.ListFTIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSession struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSession) 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("createSession", 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 *metaServiceProcessorCreateSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSessionArgs) + var result MetaServiceCreateSessionResult + if retval, err := p.handler.CreateSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorUpdateSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorUpdateSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceUpdateSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorUpdateSessions) 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("updateSessions", 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 *metaServiceProcessorUpdateSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceUpdateSessionsArgs) + var result MetaServiceUpdateSessionsResult + if retval, err := p.handler.UpdateSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorListSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSessions) 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("listSessions", 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 *metaServiceProcessorListSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSessionsArgs) + var result MetaServiceListSessionsResult + if retval, err := p.handler.ListSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSession struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSession) 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("getSession", 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 *metaServiceProcessorGetSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSessionArgs) + var result MetaServiceGetSessionResult + if retval, err := p.handler.GetSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveSession struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveSession) 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("removeSession", 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 *metaServiceProcessorRemoveSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveSessionArgs) + var result MetaServiceRemoveSessionResult + if retval, err := p.handler.RemoveSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorKillQuery struct { + handler MetaService +} + +func (p *metaServiceProcessorKillQuery) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceKillQueryArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorKillQuery) 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("killQuery", 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 *metaServiceProcessorKillQuery) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceKillQueryArgs) + var result MetaServiceKillQueryResult + if retval, err := p.handler.KillQuery(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killQuery: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorReportTaskFinish struct { + handler MetaService +} + +func (p *metaServiceProcessorReportTaskFinish) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceReportTaskFinishArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorReportTaskFinish) 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("reportTaskFinish", 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 *metaServiceProcessorReportTaskFinish) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceReportTaskFinishArgs) + var result MetaServiceReportTaskFinishResult + if retval, err := p.handler.ReportTaskFinish(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reportTaskFinish: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListCluster struct { + handler MetaService +} + +func (p *metaServiceProcessorListCluster) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListClusterArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListCluster) 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("listCluster", 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 *metaServiceProcessorListCluster) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListClusterArgs) + var result MetaServiceListClusterResult + if retval, err := p.handler.ListCluster(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listCluster: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetMetaDirInfo struct { + handler MetaService +} + +func (p *metaServiceProcessorGetMetaDirInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetMetaDirInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetMetaDirInfo) 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("getMetaDirInfo", 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 *metaServiceProcessorGetMetaDirInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetMetaDirInfoArgs) + var result MetaServiceGetMetaDirInfoResult + if retval, err := p.handler.GetMetaDirInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMetaDirInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type MetaServiceCreateSpaceArgs struct { + thrift.IRequest + Req *CreateSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceArgs() *MetaServiceCreateSpaceArgs { + return &MetaServiceCreateSpaceArgs{ + Req: NewCreateSpaceReq(), + } +} + +var MetaServiceCreateSpaceArgs_Req_DEFAULT *CreateSpaceReq +func (p *MetaServiceCreateSpaceArgs) GetReq() *CreateSpaceReq { + if !p.IsSetReq() { + return MetaServiceCreateSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSpaceResult() *MetaServiceCreateSpaceResult { + return &MetaServiceCreateSpaceResult{} +} + +var MetaServiceCreateSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSpaceArgs struct { + thrift.IRequest + Req *DropSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSpaceArgs() *MetaServiceDropSpaceArgs { + return &MetaServiceDropSpaceArgs{ + Req: NewDropSpaceReq(), + } +} + +var MetaServiceDropSpaceArgs_Req_DEFAULT *DropSpaceReq +func (p *MetaServiceDropSpaceArgs) GetReq() *DropSpaceReq { + if !p.IsSetReq() { + return MetaServiceDropSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSpaceResult() *MetaServiceDropSpaceResult { + return &MetaServiceDropSpaceResult{} +} + +var MetaServiceDropSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSpaceArgs struct { + thrift.IRequest + Req *GetSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSpaceArgs() *MetaServiceGetSpaceArgs { + return &MetaServiceGetSpaceArgs{ + Req: NewGetSpaceReq(), + } +} + +var MetaServiceGetSpaceArgs_Req_DEFAULT *GetSpaceReq +func (p *MetaServiceGetSpaceArgs) GetReq() *GetSpaceReq { + if !p.IsSetReq() { + return MetaServiceGetSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSpaceResult struct { + thrift.IResponse + Success *GetSpaceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSpaceResult() *MetaServiceGetSpaceResult { + return &MetaServiceGetSpaceResult{} +} + +var MetaServiceGetSpaceResult_Success_DEFAULT *GetSpaceResp +func (p *MetaServiceGetSpaceResult) GetSuccess() *GetSpaceResp { + if !p.IsSetSuccess() { + return MetaServiceGetSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSpaceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSpacesArgs struct { + thrift.IRequest + Req *ListSpacesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSpacesArgs() *MetaServiceListSpacesArgs { + return &MetaServiceListSpacesArgs{ + Req: NewListSpacesReq(), + } +} + +var MetaServiceListSpacesArgs_Req_DEFAULT *ListSpacesReq +func (p *MetaServiceListSpacesArgs) GetReq() *ListSpacesReq { + if !p.IsSetReq() { + return MetaServiceListSpacesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSpacesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSpacesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSpacesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSpacesResult struct { + thrift.IResponse + Success *ListSpacesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSpacesResult() *MetaServiceListSpacesResult { + return &MetaServiceListSpacesResult{} +} + +var MetaServiceListSpacesResult_Success_DEFAULT *ListSpacesResp +func (p *MetaServiceListSpacesResult) GetSuccess() *ListSpacesResp { + if !p.IsSetSuccess() { + return MetaServiceListSpacesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSpacesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSpacesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSpacesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagArgs struct { + thrift.IRequest + Req *CreateTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagArgs() *MetaServiceCreateTagArgs { + return &MetaServiceCreateTagArgs{ + Req: NewCreateTagReq(), + } +} + +var MetaServiceCreateTagArgs_Req_DEFAULT *CreateTagReq +func (p *MetaServiceCreateTagArgs) GetReq() *CreateTagReq { + if !p.IsSetReq() { + return MetaServiceCreateTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagResult() *MetaServiceCreateTagResult { + return &MetaServiceCreateTagResult{} +} + +var MetaServiceCreateTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterTagArgs struct { + thrift.IRequest + Req *AlterTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterTagArgs() *MetaServiceAlterTagArgs { + return &MetaServiceAlterTagArgs{ + Req: NewAlterTagReq(), + } +} + +var MetaServiceAlterTagArgs_Req_DEFAULT *AlterTagReq +func (p *MetaServiceAlterTagArgs) GetReq() *AlterTagReq { + if !p.IsSetReq() { + return MetaServiceAlterTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterTagResult() *MetaServiceAlterTagResult { + return &MetaServiceAlterTagResult{} +} + +var MetaServiceAlterTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagArgs struct { + thrift.IRequest + Req *DropTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagArgs() *MetaServiceDropTagArgs { + return &MetaServiceDropTagArgs{ + Req: NewDropTagReq(), + } +} + +var MetaServiceDropTagArgs_Req_DEFAULT *DropTagReq +func (p *MetaServiceDropTagArgs) GetReq() *DropTagReq { + if !p.IsSetReq() { + return MetaServiceDropTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagResult() *MetaServiceDropTagResult { + return &MetaServiceDropTagResult{} +} + +var MetaServiceDropTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagArgs struct { + thrift.IRequest + Req *GetTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagArgs() *MetaServiceGetTagArgs { + return &MetaServiceGetTagArgs{ + Req: NewGetTagReq(), + } +} + +var MetaServiceGetTagArgs_Req_DEFAULT *GetTagReq +func (p *MetaServiceGetTagArgs) GetReq() *GetTagReq { + if !p.IsSetReq() { + return MetaServiceGetTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagResult struct { + thrift.IResponse + Success *GetTagResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagResult() *MetaServiceGetTagResult { + return &MetaServiceGetTagResult{} +} + +var MetaServiceGetTagResult_Success_DEFAULT *GetTagResp +func (p *MetaServiceGetTagResult) GetSuccess() *GetTagResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagsArgs struct { + thrift.IRequest + Req *ListTagsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagsArgs() *MetaServiceListTagsArgs { + return &MetaServiceListTagsArgs{ + Req: NewListTagsReq(), + } +} + +var MetaServiceListTagsArgs_Req_DEFAULT *ListTagsReq +func (p *MetaServiceListTagsArgs) GetReq() *ListTagsReq { + if !p.IsSetReq() { + return MetaServiceListTagsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagsResult struct { + thrift.IResponse + Success *ListTagsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagsResult() *MetaServiceListTagsResult { + return &MetaServiceListTagsResult{} +} + +var MetaServiceListTagsResult_Success_DEFAULT *ListTagsResp +func (p *MetaServiceListTagsResult) GetSuccess() *ListTagsResp { + if !p.IsSetSuccess() { + return MetaServiceListTagsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeArgs struct { + thrift.IRequest + Req *CreateEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeArgs() *MetaServiceCreateEdgeArgs { + return &MetaServiceCreateEdgeArgs{ + Req: NewCreateEdgeReq(), + } +} + +var MetaServiceCreateEdgeArgs_Req_DEFAULT *CreateEdgeReq +func (p *MetaServiceCreateEdgeArgs) GetReq() *CreateEdgeReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeResult() *MetaServiceCreateEdgeResult { + return &MetaServiceCreateEdgeResult{} +} + +var MetaServiceCreateEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterEdgeArgs struct { + thrift.IRequest + Req *AlterEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterEdgeArgs() *MetaServiceAlterEdgeArgs { + return &MetaServiceAlterEdgeArgs{ + Req: NewAlterEdgeReq(), + } +} + +var MetaServiceAlterEdgeArgs_Req_DEFAULT *AlterEdgeReq +func (p *MetaServiceAlterEdgeArgs) GetReq() *AlterEdgeReq { + if !p.IsSetReq() { + return MetaServiceAlterEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterEdgeResult() *MetaServiceAlterEdgeResult { + return &MetaServiceAlterEdgeResult{} +} + +var MetaServiceAlterEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeArgs struct { + thrift.IRequest + Req *DropEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeArgs() *MetaServiceDropEdgeArgs { + return &MetaServiceDropEdgeArgs{ + Req: NewDropEdgeReq(), + } +} + +var MetaServiceDropEdgeArgs_Req_DEFAULT *DropEdgeReq +func (p *MetaServiceDropEdgeArgs) GetReq() *DropEdgeReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeResult() *MetaServiceDropEdgeResult { + return &MetaServiceDropEdgeResult{} +} + +var MetaServiceDropEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeArgs struct { + thrift.IRequest + Req *GetEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeArgs() *MetaServiceGetEdgeArgs { + return &MetaServiceGetEdgeArgs{ + Req: NewGetEdgeReq(), + } +} + +var MetaServiceGetEdgeArgs_Req_DEFAULT *GetEdgeReq +func (p *MetaServiceGetEdgeArgs) GetReq() *GetEdgeReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeResult struct { + thrift.IResponse + Success *GetEdgeResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeResult() *MetaServiceGetEdgeResult { + return &MetaServiceGetEdgeResult{} +} + +var MetaServiceGetEdgeResult_Success_DEFAULT *GetEdgeResp +func (p *MetaServiceGetEdgeResult) GetSuccess() *GetEdgeResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgesArgs struct { + thrift.IRequest + Req *ListEdgesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgesArgs() *MetaServiceListEdgesArgs { + return &MetaServiceListEdgesArgs{ + Req: NewListEdgesReq(), + } +} + +var MetaServiceListEdgesArgs_Req_DEFAULT *ListEdgesReq +func (p *MetaServiceListEdgesArgs) GetReq() *ListEdgesReq { + if !p.IsSetReq() { + return MetaServiceListEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgesResult struct { + thrift.IResponse + Success *ListEdgesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgesResult() *MetaServiceListEdgesResult { + return &MetaServiceListEdgesResult{} +} + +var MetaServiceListEdgesResult_Success_DEFAULT *ListEdgesResp +func (p *MetaServiceListEdgesResult) GetSuccess() *ListEdgesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListHostsArgs struct { + thrift.IRequest + Req *ListHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListHostsArgs() *MetaServiceListHostsArgs { + return &MetaServiceListHostsArgs{ + Req: NewListHostsReq(), + } +} + +var MetaServiceListHostsArgs_Req_DEFAULT *ListHostsReq +func (p *MetaServiceListHostsArgs) GetReq() *ListHostsReq { + if !p.IsSetReq() { + return MetaServiceListHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListHostsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListHostsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListHostsResult struct { + thrift.IResponse + Success *ListHostsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListHostsResult() *MetaServiceListHostsResult { + return &MetaServiceListHostsResult{} +} + +var MetaServiceListHostsResult_Success_DEFAULT *ListHostsResp +func (p *MetaServiceListHostsResult) GetSuccess() *ListHostsResp { + if !p.IsSetSuccess() { + return MetaServiceListHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListHostsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListHostsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListHostsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetPartsAllocArgs struct { + thrift.IRequest + Req *GetPartsAllocReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetPartsAllocArgs() *MetaServiceGetPartsAllocArgs { + return &MetaServiceGetPartsAllocArgs{ + Req: NewGetPartsAllocReq(), + } +} + +var MetaServiceGetPartsAllocArgs_Req_DEFAULT *GetPartsAllocReq +func (p *MetaServiceGetPartsAllocArgs) GetReq() *GetPartsAllocReq { + if !p.IsSetReq() { + return MetaServiceGetPartsAllocArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetPartsAllocArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPartsAllocReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetPartsAllocArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetPartsAllocResult struct { + thrift.IResponse + Success *GetPartsAllocResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetPartsAllocResult() *MetaServiceGetPartsAllocResult { + return &MetaServiceGetPartsAllocResult{} +} + +var MetaServiceGetPartsAllocResult_Success_DEFAULT *GetPartsAllocResp +func (p *MetaServiceGetPartsAllocResult) GetSuccess() *GetPartsAllocResp { + if !p.IsSetSuccess() { + return MetaServiceGetPartsAllocResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetPartsAllocResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPartsAllocResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetPartsAllocResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListPartsArgs struct { + thrift.IRequest + Req *ListPartsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListPartsArgs() *MetaServiceListPartsArgs { + return &MetaServiceListPartsArgs{ + Req: NewListPartsReq(), + } +} + +var MetaServiceListPartsArgs_Req_DEFAULT *ListPartsReq +func (p *MetaServiceListPartsArgs) GetReq() *ListPartsReq { + if !p.IsSetReq() { + return MetaServiceListPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListPartsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListPartsResult struct { + thrift.IResponse + Success *ListPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListPartsResult() *MetaServiceListPartsResult { + return &MetaServiceListPartsResult{} +} + +var MetaServiceListPartsResult_Success_DEFAULT *ListPartsResp +func (p *MetaServiceListPartsResult) GetSuccess() *ListPartsResp { + if !p.IsSetSuccess() { + return MetaServiceListPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiPutArgs struct { + thrift.IRequest + Req *MultiPutReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiPutArgs() *MetaServiceMultiPutArgs { + return &MetaServiceMultiPutArgs{ + Req: NewMultiPutReq(), + } +} + +var MetaServiceMultiPutArgs_Req_DEFAULT *MultiPutReq +func (p *MetaServiceMultiPutArgs) GetReq() *MultiPutReq { + if !p.IsSetReq() { + return MetaServiceMultiPutArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiPutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiPutReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiPutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiPutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiPutResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiPutResult() *MetaServiceMultiPutResult { + return &MetaServiceMultiPutResult{} +} + +var MetaServiceMultiPutResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMultiPutResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceMultiPutResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiPutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiPutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiPutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetArgs struct { + thrift.IRequest + Req *GetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetArgs() *MetaServiceGetArgs { + return &MetaServiceGetArgs{ + Req: NewGetReq(), + } +} + +var MetaServiceGetArgs_Req_DEFAULT *GetReq +func (p *MetaServiceGetArgs) GetReq() *GetReq { + if !p.IsSetReq() { + return MetaServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetResult struct { + thrift.IResponse + Success *GetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetResult() *MetaServiceGetResult { + return &MetaServiceGetResult{} +} + +var MetaServiceGetResult_Success_DEFAULT *GetResp +func (p *MetaServiceGetResult) GetSuccess() *GetResp { + if !p.IsSetSuccess() { + return MetaServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiGetArgs struct { + thrift.IRequest + Req *MultiGetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiGetArgs() *MetaServiceMultiGetArgs { + return &MetaServiceMultiGetArgs{ + Req: NewMultiGetReq(), + } +} + +var MetaServiceMultiGetArgs_Req_DEFAULT *MultiGetReq +func (p *MetaServiceMultiGetArgs) GetReq() *MultiGetReq { + if !p.IsSetReq() { + return MetaServiceMultiGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiGetResult struct { + thrift.IResponse + Success *MultiGetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiGetResult() *MetaServiceMultiGetResult { + return &MetaServiceMultiGetResult{} +} + +var MetaServiceMultiGetResult_Success_DEFAULT *MultiGetResp +func (p *MetaServiceMultiGetResult) GetSuccess() *MultiGetResp { + if !p.IsSetSuccess() { + return MetaServiceMultiGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewMultiGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveArgs struct { + thrift.IRequest + Req *RemoveReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveArgs() *MetaServiceRemoveArgs { + return &MetaServiceRemoveArgs{ + Req: NewRemoveReq(), + } +} + +var MetaServiceRemoveArgs_Req_DEFAULT *RemoveReq +func (p *MetaServiceRemoveArgs) GetReq() *RemoveReq { + if !p.IsSetReq() { + return MetaServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveResult() *MetaServiceRemoveResult { + return &MetaServiceRemoveResult{} +} + +var MetaServiceRemoveResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveRangeArgs struct { + thrift.IRequest + Req *RemoveRangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveRangeArgs() *MetaServiceRemoveRangeArgs { + return &MetaServiceRemoveRangeArgs{ + Req: NewRemoveRangeReq(), + } +} + +var MetaServiceRemoveRangeArgs_Req_DEFAULT *RemoveRangeReq +func (p *MetaServiceRemoveRangeArgs) GetReq() *RemoveRangeReq { + if !p.IsSetReq() { + return MetaServiceRemoveRangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveRangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveRangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveRangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveRangeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveRangeResult() *MetaServiceRemoveRangeResult { + return &MetaServiceRemoveRangeResult{} +} + +var MetaServiceRemoveRangeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveRangeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveRangeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveRangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveRangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceScanArgs struct { + thrift.IRequest + Req *ScanReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceScanArgs() *MetaServiceScanArgs { + return &MetaServiceScanArgs{ + Req: NewScanReq(), + } +} + +var MetaServiceScanArgs_Req_DEFAULT *ScanReq +func (p *MetaServiceScanArgs) GetReq() *ScanReq { + if !p.IsSetReq() { + return MetaServiceScanArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceScanArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceScanArgs) 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 *MetaServiceScanArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceScanArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanArgs) 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 *MetaServiceScanArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceScanArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceScanResult struct { + thrift.IResponse + Success *ScanResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceScanResult() *MetaServiceScanResult { + return &MetaServiceScanResult{} +} + +var MetaServiceScanResult_Success_DEFAULT *ScanResp +func (p *MetaServiceScanResult) GetSuccess() *ScanResp { + if !p.IsSetSuccess() { + return MetaServiceScanResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceScanResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceScanResult) 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 *MetaServiceScanResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceScanResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanResult) 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 *MetaServiceScanResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceScanResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagIndexArgs struct { + thrift.IRequest + Req *CreateTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagIndexArgs() *MetaServiceCreateTagIndexArgs { + return &MetaServiceCreateTagIndexArgs{ + Req: NewCreateTagIndexReq(), + } +} + +var MetaServiceCreateTagIndexArgs_Req_DEFAULT *CreateTagIndexReq +func (p *MetaServiceCreateTagIndexArgs) GetReq() *CreateTagIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagIndexResult() *MetaServiceCreateTagIndexResult { + return &MetaServiceCreateTagIndexResult{} +} + +var MetaServiceCreateTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagIndexArgs struct { + thrift.IRequest + Req *DropTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagIndexArgs() *MetaServiceDropTagIndexArgs { + return &MetaServiceDropTagIndexArgs{ + Req: NewDropTagIndexReq(), + } +} + +var MetaServiceDropTagIndexArgs_Req_DEFAULT *DropTagIndexReq +func (p *MetaServiceDropTagIndexArgs) GetReq() *DropTagIndexReq { + if !p.IsSetReq() { + return MetaServiceDropTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagIndexResult() *MetaServiceDropTagIndexResult { + return &MetaServiceDropTagIndexResult{} +} + +var MetaServiceDropTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagIndexArgs struct { + thrift.IRequest + Req *GetTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagIndexArgs() *MetaServiceGetTagIndexArgs { + return &MetaServiceGetTagIndexArgs{ + Req: NewGetTagIndexReq(), + } +} + +var MetaServiceGetTagIndexArgs_Req_DEFAULT *GetTagIndexReq +func (p *MetaServiceGetTagIndexArgs) GetReq() *GetTagIndexReq { + if !p.IsSetReq() { + return MetaServiceGetTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagIndexResult struct { + thrift.IResponse + Success *GetTagIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagIndexResult() *MetaServiceGetTagIndexResult { + return &MetaServiceGetTagIndexResult{} +} + +var MetaServiceGetTagIndexResult_Success_DEFAULT *GetTagIndexResp +func (p *MetaServiceGetTagIndexResult) GetSuccess() *GetTagIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexesArgs struct { + thrift.IRequest + Req *ListTagIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexesArgs() *MetaServiceListTagIndexesArgs { + return &MetaServiceListTagIndexesArgs{ + Req: NewListTagIndexesReq(), + } +} + +var MetaServiceListTagIndexesArgs_Req_DEFAULT *ListTagIndexesReq +func (p *MetaServiceListTagIndexesArgs) GetReq() *ListTagIndexesReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexesResult struct { + thrift.IResponse + Success *ListTagIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexesResult() *MetaServiceListTagIndexesResult { + return &MetaServiceListTagIndexesResult{} +} + +var MetaServiceListTagIndexesResult_Success_DEFAULT *ListTagIndexesResp +func (p *MetaServiceListTagIndexesResult) GetSuccess() *ListTagIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildTagIndexArgs() *MetaServiceRebuildTagIndexArgs { + return &MetaServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildTagIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildTagIndexResult() *MetaServiceRebuildTagIndexResult { + return &MetaServiceRebuildTagIndexResult{} +} + +var MetaServiceRebuildTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexStatusArgs() *MetaServiceListTagIndexStatusArgs { + return &MetaServiceListTagIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListTagIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListTagIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexStatusResult() *MetaServiceListTagIndexStatusResult { + return &MetaServiceListTagIndexStatusResult{} +} + +var MetaServiceListTagIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListTagIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeIndexArgs struct { + thrift.IRequest + Req *CreateEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeIndexArgs() *MetaServiceCreateEdgeIndexArgs { + return &MetaServiceCreateEdgeIndexArgs{ + Req: NewCreateEdgeIndexReq(), + } +} + +var MetaServiceCreateEdgeIndexArgs_Req_DEFAULT *CreateEdgeIndexReq +func (p *MetaServiceCreateEdgeIndexArgs) GetReq() *CreateEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeIndexResult() *MetaServiceCreateEdgeIndexResult { + return &MetaServiceCreateEdgeIndexResult{} +} + +var MetaServiceCreateEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeIndexArgs struct { + thrift.IRequest + Req *DropEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeIndexArgs() *MetaServiceDropEdgeIndexArgs { + return &MetaServiceDropEdgeIndexArgs{ + Req: NewDropEdgeIndexReq(), + } +} + +var MetaServiceDropEdgeIndexArgs_Req_DEFAULT *DropEdgeIndexReq +func (p *MetaServiceDropEdgeIndexArgs) GetReq() *DropEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeIndexResult() *MetaServiceDropEdgeIndexResult { + return &MetaServiceDropEdgeIndexResult{} +} + +var MetaServiceDropEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeIndexArgs struct { + thrift.IRequest + Req *GetEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeIndexArgs() *MetaServiceGetEdgeIndexArgs { + return &MetaServiceGetEdgeIndexArgs{ + Req: NewGetEdgeIndexReq(), + } +} + +var MetaServiceGetEdgeIndexArgs_Req_DEFAULT *GetEdgeIndexReq +func (p *MetaServiceGetEdgeIndexArgs) GetReq() *GetEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeIndexResult struct { + thrift.IResponse + Success *GetEdgeIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeIndexResult() *MetaServiceGetEdgeIndexResult { + return &MetaServiceGetEdgeIndexResult{} +} + +var MetaServiceGetEdgeIndexResult_Success_DEFAULT *GetEdgeIndexResp +func (p *MetaServiceGetEdgeIndexResult) GetSuccess() *GetEdgeIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexesArgs struct { + thrift.IRequest + Req *ListEdgeIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexesArgs() *MetaServiceListEdgeIndexesArgs { + return &MetaServiceListEdgeIndexesArgs{ + Req: NewListEdgeIndexesReq(), + } +} + +var MetaServiceListEdgeIndexesArgs_Req_DEFAULT *ListEdgeIndexesReq +func (p *MetaServiceListEdgeIndexesArgs) GetReq() *ListEdgeIndexesReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgeIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexesResult struct { + thrift.IResponse + Success *ListEdgeIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexesResult() *MetaServiceListEdgeIndexesResult { + return &MetaServiceListEdgeIndexesResult{} +} + +var MetaServiceListEdgeIndexesResult_Success_DEFAULT *ListEdgeIndexesResp +func (p *MetaServiceListEdgeIndexesResult) GetSuccess() *ListEdgeIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgeIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildEdgeIndexArgs() *MetaServiceRebuildEdgeIndexArgs { + return &MetaServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildEdgeIndexResult() *MetaServiceRebuildEdgeIndexResult { + return &MetaServiceRebuildEdgeIndexResult{} +} + +var MetaServiceRebuildEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexStatusArgs() *MetaServiceListEdgeIndexStatusArgs { + return &MetaServiceListEdgeIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListEdgeIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexStatusResult() *MetaServiceListEdgeIndexStatusResult { + return &MetaServiceListEdgeIndexStatusResult{} +} + +var MetaServiceListEdgeIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListEdgeIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateUserArgs struct { + thrift.IRequest + Req *CreateUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateUserArgs() *MetaServiceCreateUserArgs { + return &MetaServiceCreateUserArgs{ + Req: NewCreateUserReq(), + } +} + +var MetaServiceCreateUserArgs_Req_DEFAULT *CreateUserReq +func (p *MetaServiceCreateUserArgs) GetReq() *CreateUserReq { + if !p.IsSetReq() { + return MetaServiceCreateUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateUserResult() *MetaServiceCreateUserResult { + return &MetaServiceCreateUserResult{} +} + +var MetaServiceCreateUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropUserArgs struct { + thrift.IRequest + Req *DropUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropUserArgs() *MetaServiceDropUserArgs { + return &MetaServiceDropUserArgs{ + Req: NewDropUserReq(), + } +} + +var MetaServiceDropUserArgs_Req_DEFAULT *DropUserReq +func (p *MetaServiceDropUserArgs) GetReq() *DropUserReq { + if !p.IsSetReq() { + return MetaServiceDropUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropUserResult() *MetaServiceDropUserResult { + return &MetaServiceDropUserResult{} +} + +var MetaServiceDropUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterUserArgs struct { + thrift.IRequest + Req *AlterUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterUserArgs() *MetaServiceAlterUserArgs { + return &MetaServiceAlterUserArgs{ + Req: NewAlterUserReq(), + } +} + +var MetaServiceAlterUserArgs_Req_DEFAULT *AlterUserReq +func (p *MetaServiceAlterUserArgs) GetReq() *AlterUserReq { + if !p.IsSetReq() { + return MetaServiceAlterUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterUserResult() *MetaServiceAlterUserResult { + return &MetaServiceAlterUserResult{} +} + +var MetaServiceAlterUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGrantRoleArgs struct { + thrift.IRequest + Req *GrantRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGrantRoleArgs() *MetaServiceGrantRoleArgs { + return &MetaServiceGrantRoleArgs{ + Req: NewGrantRoleReq(), + } +} + +var MetaServiceGrantRoleArgs_Req_DEFAULT *GrantRoleReq +func (p *MetaServiceGrantRoleArgs) GetReq() *GrantRoleReq { + if !p.IsSetReq() { + return MetaServiceGrantRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGrantRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGrantRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGrantRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGrantRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGrantRoleResult() *MetaServiceGrantRoleResult { + return &MetaServiceGrantRoleResult{} +} + +var MetaServiceGrantRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceGrantRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceGrantRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGrantRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGrantRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRevokeRoleArgs struct { + thrift.IRequest + Req *RevokeRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRevokeRoleArgs() *MetaServiceRevokeRoleArgs { + return &MetaServiceRevokeRoleArgs{ + Req: NewRevokeRoleReq(), + } +} + +var MetaServiceRevokeRoleArgs_Req_DEFAULT *RevokeRoleReq +func (p *MetaServiceRevokeRoleArgs) GetReq() *RevokeRoleReq { + if !p.IsSetReq() { + return MetaServiceRevokeRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRevokeRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRevokeRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRevokeRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRevokeRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRevokeRoleResult() *MetaServiceRevokeRoleResult { + return &MetaServiceRevokeRoleResult{} +} + +var MetaServiceRevokeRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRevokeRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRevokeRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRevokeRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRevokeRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListUsersArgs struct { + thrift.IRequest + Req *ListUsersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListUsersArgs() *MetaServiceListUsersArgs { + return &MetaServiceListUsersArgs{ + Req: NewListUsersReq(), + } +} + +var MetaServiceListUsersArgs_Req_DEFAULT *ListUsersReq +func (p *MetaServiceListUsersArgs) GetReq() *ListUsersReq { + if !p.IsSetReq() { + return MetaServiceListUsersArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListUsersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListUsersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListUsersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListUsersResult struct { + thrift.IResponse + Success *ListUsersResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListUsersResult() *MetaServiceListUsersResult { + return &MetaServiceListUsersResult{} +} + +var MetaServiceListUsersResult_Success_DEFAULT *ListUsersResp +func (p *MetaServiceListUsersResult) GetSuccess() *ListUsersResp { + if !p.IsSetSuccess() { + return MetaServiceListUsersResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListUsersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListUsersResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListUsersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListRolesArgs struct { + thrift.IRequest + Req *ListRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListRolesArgs() *MetaServiceListRolesArgs { + return &MetaServiceListRolesArgs{ + Req: NewListRolesReq(), + } +} + +var MetaServiceListRolesArgs_Req_DEFAULT *ListRolesReq +func (p *MetaServiceListRolesArgs) GetReq() *ListRolesReq { + if !p.IsSetReq() { + return MetaServiceListRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListRolesResult() *MetaServiceListRolesResult { + return &MetaServiceListRolesResult{} +} + +var MetaServiceListRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceListRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceListRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetUserRolesArgs struct { + thrift.IRequest + Req *GetUserRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetUserRolesArgs() *MetaServiceGetUserRolesArgs { + return &MetaServiceGetUserRolesArgs{ + Req: NewGetUserRolesReq(), + } +} + +var MetaServiceGetUserRolesArgs_Req_DEFAULT *GetUserRolesReq +func (p *MetaServiceGetUserRolesArgs) GetReq() *GetUserRolesReq { + if !p.IsSetReq() { + return MetaServiceGetUserRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetUserRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUserRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetUserRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetUserRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetUserRolesResult() *MetaServiceGetUserRolesResult { + return &MetaServiceGetUserRolesResult{} +} + +var MetaServiceGetUserRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceGetUserRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceGetUserRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetUserRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetUserRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceChangePasswordArgs struct { + thrift.IRequest + Req *ChangePasswordReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceChangePasswordArgs() *MetaServiceChangePasswordArgs { + return &MetaServiceChangePasswordArgs{ + Req: NewChangePasswordReq(), + } +} + +var MetaServiceChangePasswordArgs_Req_DEFAULT *ChangePasswordReq +func (p *MetaServiceChangePasswordArgs) GetReq() *ChangePasswordReq { + if !p.IsSetReq() { + return MetaServiceChangePasswordArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceChangePasswordArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewChangePasswordReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceChangePasswordArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceChangePasswordResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceChangePasswordResult() *MetaServiceChangePasswordResult { + return &MetaServiceChangePasswordResult{} +} + +var MetaServiceChangePasswordResult_Success_DEFAULT *ExecResp +func (p *MetaServiceChangePasswordResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceChangePasswordResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceChangePasswordResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceChangePasswordResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceHeartBeatArgs struct { + thrift.IRequest + Req *HBReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceHeartBeatArgs() *MetaServiceHeartBeatArgs { + return &MetaServiceHeartBeatArgs{ + Req: NewHBReq(), + } +} + +var MetaServiceHeartBeatArgs_Req_DEFAULT *HBReq +func (p *MetaServiceHeartBeatArgs) GetReq() *HBReq { + if !p.IsSetReq() { + return MetaServiceHeartBeatArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceHeartBeatArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewHBReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceHeartBeatArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceHeartBeatResult struct { + thrift.IResponse + Success *HBResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceHeartBeatResult() *MetaServiceHeartBeatResult { + return &MetaServiceHeartBeatResult{} +} + +var MetaServiceHeartBeatResult_Success_DEFAULT *HBResp +func (p *MetaServiceHeartBeatResult) GetSuccess() *HBResp { + if !p.IsSetSuccess() { + return MetaServiceHeartBeatResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceHeartBeatResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewHBResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceHeartBeatResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceBalanceArgs struct { + thrift.IRequest + Req *BalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceBalanceArgs() *MetaServiceBalanceArgs { + return &MetaServiceBalanceArgs{ + Req: NewBalanceReq(), + } +} + +var MetaServiceBalanceArgs_Req_DEFAULT *BalanceReq +func (p *MetaServiceBalanceArgs) GetReq() *BalanceReq { + if !p.IsSetReq() { + return MetaServiceBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceBalanceResult struct { + thrift.IResponse + Success *BalanceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceBalanceResult() *MetaServiceBalanceResult { + return &MetaServiceBalanceResult{} +} + +var MetaServiceBalanceResult_Success_DEFAULT *BalanceResp +func (p *MetaServiceBalanceResult) GetSuccess() *BalanceResp { + if !p.IsSetSuccess() { + return MetaServiceBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewBalanceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceLeaderBalanceArgs struct { + thrift.IRequest + Req *LeaderBalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceLeaderBalanceArgs() *MetaServiceLeaderBalanceArgs { + return &MetaServiceLeaderBalanceArgs{ + Req: NewLeaderBalanceReq(), + } +} + +var MetaServiceLeaderBalanceArgs_Req_DEFAULT *LeaderBalanceReq +func (p *MetaServiceLeaderBalanceArgs) GetReq() *LeaderBalanceReq { + if !p.IsSetReq() { + return MetaServiceLeaderBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceLeaderBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLeaderBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceLeaderBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceLeaderBalanceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceLeaderBalanceResult() *MetaServiceLeaderBalanceResult { + return &MetaServiceLeaderBalanceResult{} +} + +var MetaServiceLeaderBalanceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceLeaderBalanceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceLeaderBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceLeaderBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceLeaderBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRegConfigArgs struct { + thrift.IRequest + Req *RegConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRegConfigArgs() *MetaServiceRegConfigArgs { + return &MetaServiceRegConfigArgs{ + Req: NewRegConfigReq(), + } +} + +var MetaServiceRegConfigArgs_Req_DEFAULT *RegConfigReq +func (p *MetaServiceRegConfigArgs) GetReq() *RegConfigReq { + if !p.IsSetReq() { + return MetaServiceRegConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRegConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRegConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRegConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRegConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRegConfigResult() *MetaServiceRegConfigResult { + return &MetaServiceRegConfigResult{} +} + +var MetaServiceRegConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRegConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRegConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRegConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRegConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetConfigArgs struct { + thrift.IRequest + Req *GetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetConfigArgs() *MetaServiceGetConfigArgs { + return &MetaServiceGetConfigArgs{ + Req: NewGetConfigReq(), + } +} + +var MetaServiceGetConfigArgs_Req_DEFAULT *GetConfigReq +func (p *MetaServiceGetConfigArgs) GetReq() *GetConfigReq { + if !p.IsSetReq() { + return MetaServiceGetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetConfigResult struct { + thrift.IResponse + Success *GetConfigResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetConfigResult() *MetaServiceGetConfigResult { + return &MetaServiceGetConfigResult{} +} + +var MetaServiceGetConfigResult_Success_DEFAULT *GetConfigResp +func (p *MetaServiceGetConfigResult) GetSuccess() *GetConfigResp { + if !p.IsSetSuccess() { + return MetaServiceGetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetConfigResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSetConfigArgs struct { + thrift.IRequest + Req *SetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSetConfigArgs() *MetaServiceSetConfigArgs { + return &MetaServiceSetConfigArgs{ + Req: NewSetConfigReq(), + } +} + +var MetaServiceSetConfigArgs_Req_DEFAULT *SetConfigReq +func (p *MetaServiceSetConfigArgs) GetReq() *SetConfigReq { + if !p.IsSetReq() { + return MetaServiceSetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSetConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSetConfigResult() *MetaServiceSetConfigResult { + return &MetaServiceSetConfigResult{} +} + +var MetaServiceSetConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSetConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListConfigsArgs struct { + thrift.IRequest + Req *ListConfigsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListConfigsArgs() *MetaServiceListConfigsArgs { + return &MetaServiceListConfigsArgs{ + Req: NewListConfigsReq(), + } +} + +var MetaServiceListConfigsArgs_Req_DEFAULT *ListConfigsReq +func (p *MetaServiceListConfigsArgs) GetReq() *ListConfigsReq { + if !p.IsSetReq() { + return MetaServiceListConfigsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListConfigsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListConfigsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListConfigsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListConfigsResult struct { + thrift.IResponse + Success *ListConfigsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListConfigsResult() *MetaServiceListConfigsResult { + return &MetaServiceListConfigsResult{} +} + +var MetaServiceListConfigsResult_Success_DEFAULT *ListConfigsResp +func (p *MetaServiceListConfigsResult) GetSuccess() *ListConfigsResp { + if !p.IsSetSuccess() { + return MetaServiceListConfigsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListConfigsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListConfigsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListConfigsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSnapshotArgs struct { + thrift.IRequest + Req *CreateSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSnapshotArgs() *MetaServiceCreateSnapshotArgs { + return &MetaServiceCreateSnapshotArgs{ + Req: NewCreateSnapshotReq(), + } +} + +var MetaServiceCreateSnapshotArgs_Req_DEFAULT *CreateSnapshotReq +func (p *MetaServiceCreateSnapshotArgs) GetReq() *CreateSnapshotReq { + if !p.IsSetReq() { + return MetaServiceCreateSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSnapshotResult() *MetaServiceCreateSnapshotResult { + return &MetaServiceCreateSnapshotResult{} +} + +var MetaServiceCreateSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSnapshotArgs struct { + thrift.IRequest + Req *DropSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSnapshotArgs() *MetaServiceDropSnapshotArgs { + return &MetaServiceDropSnapshotArgs{ + Req: NewDropSnapshotReq(), + } +} + +var MetaServiceDropSnapshotArgs_Req_DEFAULT *DropSnapshotReq +func (p *MetaServiceDropSnapshotArgs) GetReq() *DropSnapshotReq { + if !p.IsSetReq() { + return MetaServiceDropSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSnapshotResult() *MetaServiceDropSnapshotResult { + return &MetaServiceDropSnapshotResult{} +} + +var MetaServiceDropSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSnapshotsArgs struct { + thrift.IRequest + Req *ListSnapshotsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSnapshotsArgs() *MetaServiceListSnapshotsArgs { + return &MetaServiceListSnapshotsArgs{ + Req: NewListSnapshotsReq(), + } +} + +var MetaServiceListSnapshotsArgs_Req_DEFAULT *ListSnapshotsReq +func (p *MetaServiceListSnapshotsArgs) GetReq() *ListSnapshotsReq { + if !p.IsSetReq() { + return MetaServiceListSnapshotsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSnapshotsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSnapshotsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSnapshotsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSnapshotsResult struct { + thrift.IResponse + Success *ListSnapshotsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSnapshotsResult() *MetaServiceListSnapshotsResult { + return &MetaServiceListSnapshotsResult{} +} + +var MetaServiceListSnapshotsResult_Success_DEFAULT *ListSnapshotsResp +func (p *MetaServiceListSnapshotsResult) GetSuccess() *ListSnapshotsResp { + if !p.IsSetSuccess() { + return MetaServiceListSnapshotsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSnapshotsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSnapshotsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSnapshotsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRunAdminJobArgs struct { + thrift.IRequest + Req *AdminJobReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRunAdminJobArgs() *MetaServiceRunAdminJobArgs { + return &MetaServiceRunAdminJobArgs{ + Req: NewAdminJobReq(), + } +} + +var MetaServiceRunAdminJobArgs_Req_DEFAULT *AdminJobReq +func (p *MetaServiceRunAdminJobArgs) GetReq() *AdminJobReq { + if !p.IsSetReq() { + return MetaServiceRunAdminJobArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRunAdminJobArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAdminJobReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRunAdminJobArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRunAdminJobResult struct { + thrift.IResponse + Success *AdminJobResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRunAdminJobResult() *MetaServiceRunAdminJobResult { + return &MetaServiceRunAdminJobResult{} +} + +var MetaServiceRunAdminJobResult_Success_DEFAULT *AdminJobResp +func (p *MetaServiceRunAdminJobResult) GetSuccess() *AdminJobResp { + if !p.IsSetSuccess() { + return MetaServiceRunAdminJobResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRunAdminJobResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminJobResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRunAdminJobResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneArgs struct { + thrift.IRequest + Req *AddZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneArgs() *MetaServiceAddZoneArgs { + return &MetaServiceAddZoneArgs{ + Req: NewAddZoneReq(), + } +} + +var MetaServiceAddZoneArgs_Req_DEFAULT *AddZoneReq +func (p *MetaServiceAddZoneArgs) GetReq() *AddZoneReq { + if !p.IsSetReq() { + return MetaServiceAddZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_args"); err != nil { + 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 *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneResult() *MetaServiceAddZoneResult { + return &MetaServiceAddZoneResult{} +} + +var MetaServiceAddZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_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 *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneArgs struct { + thrift.IRequest + Req *DropZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneArgs() *MetaServiceDropZoneArgs { + return &MetaServiceDropZoneArgs{ + Req: NewDropZoneReq(), + } +} + +var MetaServiceDropZoneArgs_Req_DEFAULT *DropZoneReq +func (p *MetaServiceDropZoneArgs) GetReq() *DropZoneReq { + if !p.IsSetReq() { + return MetaServiceDropZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneResult() *MetaServiceDropZoneResult { + return &MetaServiceDropZoneResult{} +} + +var MetaServiceDropZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddHostIntoZoneArgs struct { + thrift.IRequest + Req *AddHostIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostIntoZoneArgs() *MetaServiceAddHostIntoZoneArgs { + return &MetaServiceAddHostIntoZoneArgs{ + Req: NewAddHostIntoZoneReq(), + } +} + +var MetaServiceAddHostIntoZoneArgs_Req_DEFAULT *AddHostIntoZoneReq +func (p *MetaServiceAddHostIntoZoneArgs) GetReq() *AddHostIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostIntoZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostIntoZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_args"); err != nil { + 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 *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddHostIntoZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostIntoZoneResult() *MetaServiceAddHostIntoZoneResult { + return &MetaServiceAddHostIntoZoneResult{} +} + +var MetaServiceAddHostIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostIntoZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_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 *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropHostFromZoneArgs struct { + thrift.IRequest + Req *DropHostFromZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostFromZoneArgs() *MetaServiceDropHostFromZoneArgs { + return &MetaServiceDropHostFromZoneArgs{ + Req: NewDropHostFromZoneReq(), + } +} + +var MetaServiceDropHostFromZoneArgs_Req_DEFAULT *DropHostFromZoneReq +func (p *MetaServiceDropHostFromZoneArgs) GetReq() *DropHostFromZoneReq { + if !p.IsSetReq() { + return MetaServiceDropHostFromZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostFromZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropHostFromZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_args"); err != nil { + 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 *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropHostFromZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostFromZoneResult() *MetaServiceDropHostFromZoneResult { + return &MetaServiceDropHostFromZoneResult{} +} + +var MetaServiceDropHostFromZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostFromZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostFromZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostFromZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_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 *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetZoneArgs struct { + thrift.IRequest + Req *GetZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetZoneArgs() *MetaServiceGetZoneArgs { + return &MetaServiceGetZoneArgs{ + Req: NewGetZoneReq(), + } +} + +var MetaServiceGetZoneArgs_Req_DEFAULT *GetZoneReq +func (p *MetaServiceGetZoneArgs) GetReq() *GetZoneReq { + if !p.IsSetReq() { + return MetaServiceGetZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetZoneResult struct { + thrift.IResponse + Success *GetZoneResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetZoneResult() *MetaServiceGetZoneResult { + return &MetaServiceGetZoneResult{} +} + +var MetaServiceGetZoneResult_Success_DEFAULT *GetZoneResp +func (p *MetaServiceGetZoneResult) GetSuccess() *GetZoneResp { + if !p.IsSetSuccess() { + return MetaServiceGetZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetZoneResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListZonesArgs struct { + thrift.IRequest + Req *ListZonesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListZonesArgs() *MetaServiceListZonesArgs { + return &MetaServiceListZonesArgs{ + Req: NewListZonesReq(), + } +} + +var MetaServiceListZonesArgs_Req_DEFAULT *ListZonesReq +func (p *MetaServiceListZonesArgs) GetReq() *ListZonesReq { + if !p.IsSetReq() { + return MetaServiceListZonesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListZonesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListZonesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListZonesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListZonesResult struct { + thrift.IResponse + Success *ListZonesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListZonesResult() *MetaServiceListZonesResult { + return &MetaServiceListZonesResult{} +} + +var MetaServiceListZonesResult_Success_DEFAULT *ListZonesResp +func (p *MetaServiceListZonesResult) GetSuccess() *ListZonesResp { + if !p.IsSetSuccess() { + return MetaServiceListZonesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListZonesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListZonesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListZonesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddGroupArgs struct { + thrift.IRequest + Req *AddGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddGroupArgs() *MetaServiceAddGroupArgs { + return &MetaServiceAddGroupArgs{ + Req: NewAddGroupReq(), + } +} + +var MetaServiceAddGroupArgs_Req_DEFAULT *AddGroupReq +func (p *MetaServiceAddGroupArgs) GetReq() *AddGroupReq { + if !p.IsSetReq() { + return MetaServiceAddGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddGroupResult() *MetaServiceAddGroupResult { + return &MetaServiceAddGroupResult{} +} + +var MetaServiceAddGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropGroupArgs struct { + thrift.IRequest + Req *DropGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropGroupArgs() *MetaServiceDropGroupArgs { + return &MetaServiceDropGroupArgs{ + Req: NewDropGroupReq(), + } +} + +var MetaServiceDropGroupArgs_Req_DEFAULT *DropGroupReq +func (p *MetaServiceDropGroupArgs) GetReq() *DropGroupReq { + if !p.IsSetReq() { + return MetaServiceDropGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropGroupResult() *MetaServiceDropGroupResult { + return &MetaServiceDropGroupResult{} +} + +var MetaServiceDropGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneIntoGroupArgs struct { + thrift.IRequest + Req *AddZoneIntoGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneIntoGroupArgs() *MetaServiceAddZoneIntoGroupArgs { + return &MetaServiceAddZoneIntoGroupArgs{ + Req: NewAddZoneIntoGroupReq(), + } +} + +var MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT *AddZoneIntoGroupReq +func (p *MetaServiceAddZoneIntoGroupArgs) GetReq() *AddZoneIntoGroupReq { + if !p.IsSetReq() { + return MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneIntoGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneIntoGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneIntoGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneIntoGroupResult() *MetaServiceAddZoneIntoGroupResult { + return &MetaServiceAddZoneIntoGroupResult{} +} + +var MetaServiceAddZoneIntoGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneIntoGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneIntoGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneIntoGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneFromGroupArgs struct { + thrift.IRequest + Req *DropZoneFromGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneFromGroupArgs() *MetaServiceDropZoneFromGroupArgs { + return &MetaServiceDropZoneFromGroupArgs{ + Req: NewDropZoneFromGroupReq(), + } +} + +var MetaServiceDropZoneFromGroupArgs_Req_DEFAULT *DropZoneFromGroupReq +func (p *MetaServiceDropZoneFromGroupArgs) GetReq() *DropZoneFromGroupReq { + if !p.IsSetReq() { + return MetaServiceDropZoneFromGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneFromGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneFromGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneFromGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneFromGroupResult() *MetaServiceDropZoneFromGroupResult { + return &MetaServiceDropZoneFromGroupResult{} +} + +var MetaServiceDropZoneFromGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneFromGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneFromGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneFromGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetGroupArgs struct { + thrift.IRequest + Req *GetGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetGroupArgs() *MetaServiceGetGroupArgs { + return &MetaServiceGetGroupArgs{ + Req: NewGetGroupReq(), + } +} + +var MetaServiceGetGroupArgs_Req_DEFAULT *GetGroupReq +func (p *MetaServiceGetGroupArgs) GetReq() *GetGroupReq { + if !p.IsSetReq() { + return MetaServiceGetGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetGroupResult struct { + thrift.IResponse + Success *GetGroupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetGroupResult() *MetaServiceGetGroupResult { + return &MetaServiceGetGroupResult{} +} + +var MetaServiceGetGroupResult_Success_DEFAULT *GetGroupResp +func (p *MetaServiceGetGroupResult) GetSuccess() *GetGroupResp { + if !p.IsSetSuccess() { + return MetaServiceGetGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetGroupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListGroupsArgs struct { + thrift.IRequest + Req *ListGroupsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListGroupsArgs() *MetaServiceListGroupsArgs { + return &MetaServiceListGroupsArgs{ + Req: NewListGroupsReq(), + } +} + +var MetaServiceListGroupsArgs_Req_DEFAULT *ListGroupsReq +func (p *MetaServiceListGroupsArgs) GetReq() *ListGroupsReq { + if !p.IsSetReq() { + return MetaServiceListGroupsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListGroupsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListGroupsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListGroupsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListGroupsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListGroupsResult struct { + thrift.IResponse + Success *ListGroupsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListGroupsResult() *MetaServiceListGroupsResult { + return &MetaServiceListGroupsResult{} +} + +var MetaServiceListGroupsResult_Success_DEFAULT *ListGroupsResp +func (p *MetaServiceListGroupsResult) GetSuccess() *ListGroupsResp { + if !p.IsSetSuccess() { + return MetaServiceListGroupsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListGroupsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListGroupsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListGroupsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListGroupsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateBackupArgs struct { + thrift.IRequest + Req *CreateBackupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateBackupArgs() *MetaServiceCreateBackupArgs { + return &MetaServiceCreateBackupArgs{ + Req: NewCreateBackupReq(), + } +} + +var MetaServiceCreateBackupArgs_Req_DEFAULT *CreateBackupReq +func (p *MetaServiceCreateBackupArgs) GetReq() *CreateBackupReq { + if !p.IsSetReq() { + return MetaServiceCreateBackupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateBackupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateBackupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateBackupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateBackupResult struct { + thrift.IResponse + Success *CreateBackupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateBackupResult() *MetaServiceCreateBackupResult { + return &MetaServiceCreateBackupResult{} +} + +var MetaServiceCreateBackupResult_Success_DEFAULT *CreateBackupResp +func (p *MetaServiceCreateBackupResult) GetSuccess() *CreateBackupResp { + if !p.IsSetSuccess() { + return MetaServiceCreateBackupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateBackupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateBackupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateBackupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRestoreMetaArgs struct { + thrift.IRequest + Req *RestoreMetaReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRestoreMetaArgs() *MetaServiceRestoreMetaArgs { + return &MetaServiceRestoreMetaArgs{ + Req: NewRestoreMetaReq(), + } +} + +var MetaServiceRestoreMetaArgs_Req_DEFAULT *RestoreMetaReq +func (p *MetaServiceRestoreMetaArgs) GetReq() *RestoreMetaReq { + if !p.IsSetReq() { + return MetaServiceRestoreMetaArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRestoreMetaArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRestoreMetaReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRestoreMetaArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRestoreMetaResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { + return &MetaServiceRestoreMetaResult{} +} + +var MetaServiceRestoreMetaResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRestoreMetaResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRestoreMetaResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddListenerArgs struct { + thrift.IRequest + Req *AddListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddListenerArgs() *MetaServiceAddListenerArgs { + return &MetaServiceAddListenerArgs{ + Req: NewAddListenerReq(), + } +} + +var MetaServiceAddListenerArgs_Req_DEFAULT *AddListenerReq +func (p *MetaServiceAddListenerArgs) GetReq() *AddListenerReq { + if !p.IsSetReq() { + return MetaServiceAddListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddListenerResult() *MetaServiceAddListenerResult { + return &MetaServiceAddListenerResult{} +} + +var MetaServiceAddListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveListenerArgs struct { + thrift.IRequest + Req *RemoveListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveListenerArgs() *MetaServiceRemoveListenerArgs { + return &MetaServiceRemoveListenerArgs{ + Req: NewRemoveListenerReq(), + } +} + +var MetaServiceRemoveListenerArgs_Req_DEFAULT *RemoveListenerReq +func (p *MetaServiceRemoveListenerArgs) GetReq() *RemoveListenerReq { + if !p.IsSetReq() { + return MetaServiceRemoveListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveListenerResult() *MetaServiceRemoveListenerResult { + return &MetaServiceRemoveListenerResult{} +} + +var MetaServiceRemoveListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListListenerArgs struct { + thrift.IRequest + Req *ListListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListListenerArgs() *MetaServiceListListenerArgs { + return &MetaServiceListListenerArgs{ + Req: NewListListenerReq(), + } +} + +var MetaServiceListListenerArgs_Req_DEFAULT *ListListenerReq +func (p *MetaServiceListListenerArgs) GetReq() *ListListenerReq { + if !p.IsSetReq() { + return MetaServiceListListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListListenerResult struct { + thrift.IResponse + Success *ListListenerResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListListenerResult() *MetaServiceListListenerResult { + return &MetaServiceListListenerResult{} +} + +var MetaServiceListListenerResult_Success_DEFAULT *ListListenerResp +func (p *MetaServiceListListenerResult) GetSuccess() *ListListenerResp { + if !p.IsSetSuccess() { + return MetaServiceListListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListListenerResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetStatisArgs struct { + thrift.IRequest + Req *GetStatisReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetStatisArgs() *MetaServiceGetStatisArgs { + return &MetaServiceGetStatisArgs{ + Req: NewGetStatisReq(), + } +} + +var MetaServiceGetStatisArgs_Req_DEFAULT *GetStatisReq +func (p *MetaServiceGetStatisArgs) GetReq() *GetStatisReq { + if !p.IsSetReq() { + return MetaServiceGetStatisArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetStatisArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetStatisReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetStatisArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetStatisArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetStatisResult struct { + thrift.IResponse + Success *GetStatisResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetStatisResult() *MetaServiceGetStatisResult { + return &MetaServiceGetStatisResult{} +} + +var MetaServiceGetStatisResult_Success_DEFAULT *GetStatisResp +func (p *MetaServiceGetStatisResult) GetSuccess() *GetStatisResp { + if !p.IsSetSuccess() { + return MetaServiceGetStatisResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetStatisResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetStatisResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetStatisResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetStatisResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignInFTServiceArgs struct { + thrift.IRequest + Req *SignInFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignInFTServiceArgs() *MetaServiceSignInFTServiceArgs { + return &MetaServiceSignInFTServiceArgs{ + Req: NewSignInFTServiceReq(), + } +} + +var MetaServiceSignInFTServiceArgs_Req_DEFAULT *SignInFTServiceReq +func (p *MetaServiceSignInFTServiceArgs) GetReq() *SignInFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignInFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignInFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignInFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignInFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignInFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignInFTServiceResult() *MetaServiceSignInFTServiceResult { + return &MetaServiceSignInFTServiceResult{} +} + +var MetaServiceSignInFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignInFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignInFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignInFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignInFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignOutFTServiceArgs struct { + thrift.IRequest + Req *SignOutFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignOutFTServiceArgs() *MetaServiceSignOutFTServiceArgs { + return &MetaServiceSignOutFTServiceArgs{ + Req: NewSignOutFTServiceReq(), + } +} + +var MetaServiceSignOutFTServiceArgs_Req_DEFAULT *SignOutFTServiceReq +func (p *MetaServiceSignOutFTServiceArgs) GetReq() *SignOutFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignOutFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignOutFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignOutFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignOutFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignOutFTServiceResult() *MetaServiceSignOutFTServiceResult { + return &MetaServiceSignOutFTServiceResult{} +} + +var MetaServiceSignOutFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignOutFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignOutFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignOutFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTClientsArgs struct { + thrift.IRequest + Req *ListFTClientsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTClientsArgs() *MetaServiceListFTClientsArgs { + return &MetaServiceListFTClientsArgs{ + Req: NewListFTClientsReq(), + } +} + +var MetaServiceListFTClientsArgs_Req_DEFAULT *ListFTClientsReq +func (p *MetaServiceListFTClientsArgs) GetReq() *ListFTClientsReq { + if !p.IsSetReq() { + return MetaServiceListFTClientsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTClientsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTClientsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTClientsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTClientsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTClientsResult struct { + thrift.IResponse + Success *ListFTClientsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTClientsResult() *MetaServiceListFTClientsResult { + return &MetaServiceListFTClientsResult{} +} + +var MetaServiceListFTClientsResult_Success_DEFAULT *ListFTClientsResp +func (p *MetaServiceListFTClientsResult) GetSuccess() *ListFTClientsResp { + if !p.IsSetSuccess() { + return MetaServiceListFTClientsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTClientsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTClientsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTClientsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTClientsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateFTIndexArgs struct { + thrift.IRequest + Req *CreateFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateFTIndexArgs() *MetaServiceCreateFTIndexArgs { + return &MetaServiceCreateFTIndexArgs{ + Req: NewCreateFTIndexReq(), + } +} + +var MetaServiceCreateFTIndexArgs_Req_DEFAULT *CreateFTIndexReq +func (p *MetaServiceCreateFTIndexArgs) GetReq() *CreateFTIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateFTIndexResult() *MetaServiceCreateFTIndexResult { + return &MetaServiceCreateFTIndexResult{} +} + +var MetaServiceCreateFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropFTIndexArgs struct { + thrift.IRequest + Req *DropFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropFTIndexArgs() *MetaServiceDropFTIndexArgs { + return &MetaServiceDropFTIndexArgs{ + Req: NewDropFTIndexReq(), + } +} + +var MetaServiceDropFTIndexArgs_Req_DEFAULT *DropFTIndexReq +func (p *MetaServiceDropFTIndexArgs) GetReq() *DropFTIndexReq { + if !p.IsSetReq() { + return MetaServiceDropFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropFTIndexResult() *MetaServiceDropFTIndexResult { + return &MetaServiceDropFTIndexResult{} +} + +var MetaServiceDropFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTIndexesArgs struct { + thrift.IRequest + Req *ListFTIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTIndexesArgs() *MetaServiceListFTIndexesArgs { + return &MetaServiceListFTIndexesArgs{ + Req: NewListFTIndexesReq(), + } +} + +var MetaServiceListFTIndexesArgs_Req_DEFAULT *ListFTIndexesReq +func (p *MetaServiceListFTIndexesArgs) GetReq() *ListFTIndexesReq { + if !p.IsSetReq() { + return MetaServiceListFTIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTIndexesResult struct { + thrift.IResponse + Success *ListFTIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTIndexesResult() *MetaServiceListFTIndexesResult { + return &MetaServiceListFTIndexesResult{} +} + +var MetaServiceListFTIndexesResult_Success_DEFAULT *ListFTIndexesResp +func (p *MetaServiceListFTIndexesResult) GetSuccess() *ListFTIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListFTIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSessionArgs struct { + thrift.IRequest + Req *CreateSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSessionArgs() *MetaServiceCreateSessionArgs { + return &MetaServiceCreateSessionArgs{ + Req: NewCreateSessionReq(), + } +} + +var MetaServiceCreateSessionArgs_Req_DEFAULT *CreateSessionReq +func (p *MetaServiceCreateSessionArgs) GetReq() *CreateSessionReq { + if !p.IsSetReq() { + return MetaServiceCreateSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSessionResult struct { + thrift.IResponse + Success *CreateSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSessionResult() *MetaServiceCreateSessionResult { + return &MetaServiceCreateSessionResult{} +} + +var MetaServiceCreateSessionResult_Success_DEFAULT *CreateSessionResp +func (p *MetaServiceCreateSessionResult) GetSuccess() *CreateSessionResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceUpdateSessionsArgs struct { + thrift.IRequest + Req *UpdateSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceUpdateSessionsArgs() *MetaServiceUpdateSessionsArgs { + return &MetaServiceUpdateSessionsArgs{ + Req: NewUpdateSessionsReq(), + } +} + +var MetaServiceUpdateSessionsArgs_Req_DEFAULT *UpdateSessionsReq +func (p *MetaServiceUpdateSessionsArgs) GetReq() *UpdateSessionsReq { + if !p.IsSetReq() { + return MetaServiceUpdateSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceUpdateSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceUpdateSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceUpdateSessionsResult struct { + thrift.IResponse + Success *UpdateSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceUpdateSessionsResult() *MetaServiceUpdateSessionsResult { + return &MetaServiceUpdateSessionsResult{} +} + +var MetaServiceUpdateSessionsResult_Success_DEFAULT *UpdateSessionsResp +func (p *MetaServiceUpdateSessionsResult) GetSuccess() *UpdateSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceUpdateSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceUpdateSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceUpdateSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSessionsArgs struct { + thrift.IRequest + Req *ListSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSessionsArgs() *MetaServiceListSessionsArgs { + return &MetaServiceListSessionsArgs{ + Req: NewListSessionsReq(), + } +} + +var MetaServiceListSessionsArgs_Req_DEFAULT *ListSessionsReq +func (p *MetaServiceListSessionsArgs) GetReq() *ListSessionsReq { + if !p.IsSetReq() { + return MetaServiceListSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSessionsResult struct { + thrift.IResponse + Success *ListSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSessionsResult() *MetaServiceListSessionsResult { + return &MetaServiceListSessionsResult{} +} + +var MetaServiceListSessionsResult_Success_DEFAULT *ListSessionsResp +func (p *MetaServiceListSessionsResult) GetSuccess() *ListSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceListSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSessionArgs struct { + thrift.IRequest + Req *GetSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSessionArgs() *MetaServiceGetSessionArgs { + return &MetaServiceGetSessionArgs{ + Req: NewGetSessionReq(), + } +} + +var MetaServiceGetSessionArgs_Req_DEFAULT *GetSessionReq +func (p *MetaServiceGetSessionArgs) GetReq() *GetSessionReq { + if !p.IsSetReq() { + return MetaServiceGetSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSessionResult struct { + thrift.IResponse + Success *GetSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSessionResult() *MetaServiceGetSessionResult { + return &MetaServiceGetSessionResult{} +} + +var MetaServiceGetSessionResult_Success_DEFAULT *GetSessionResp +func (p *MetaServiceGetSessionResult) GetSuccess() *GetSessionResp { + if !p.IsSetSuccess() { + return MetaServiceGetSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveSessionArgs struct { + thrift.IRequest + Req *RemoveSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveSessionArgs() *MetaServiceRemoveSessionArgs { + return &MetaServiceRemoveSessionArgs{ + Req: NewRemoveSessionReq(), + } +} + +var MetaServiceRemoveSessionArgs_Req_DEFAULT *RemoveSessionReq +func (p *MetaServiceRemoveSessionArgs) GetReq() *RemoveSessionReq { + if !p.IsSetReq() { + return MetaServiceRemoveSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveSessionResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveSessionResult() *MetaServiceRemoveSessionResult { + return &MetaServiceRemoveSessionResult{} +} + +var MetaServiceRemoveSessionResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveSessionResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceKillQueryArgs struct { + thrift.IRequest + Req *KillQueryReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceKillQueryArgs() *MetaServiceKillQueryArgs { + return &MetaServiceKillQueryArgs{ + Req: NewKillQueryReq(), + } +} + +var MetaServiceKillQueryArgs_Req_DEFAULT *KillQueryReq +func (p *MetaServiceKillQueryArgs) GetReq() *KillQueryReq { + if !p.IsSetReq() { + return MetaServiceKillQueryArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceKillQueryArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKillQueryReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceKillQueryArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceKillQueryArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceKillQueryResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceKillQueryResult() *MetaServiceKillQueryResult { + return &MetaServiceKillQueryResult{} +} + +var MetaServiceKillQueryResult_Success_DEFAULT *ExecResp +func (p *MetaServiceKillQueryResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceKillQueryResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceKillQueryResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceKillQueryResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceKillQueryResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceReportTaskFinishArgs struct { + thrift.IRequest + Req *ReportTaskReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceReportTaskFinishArgs() *MetaServiceReportTaskFinishArgs { + return &MetaServiceReportTaskFinishArgs{ + Req: NewReportTaskReq(), + } +} + +var MetaServiceReportTaskFinishArgs_Req_DEFAULT *ReportTaskReq +func (p *MetaServiceReportTaskFinishArgs) GetReq() *ReportTaskReq { + if !p.IsSetReq() { + return MetaServiceReportTaskFinishArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceReportTaskFinishArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewReportTaskReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceReportTaskFinishArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceReportTaskFinishResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceReportTaskFinishResult() *MetaServiceReportTaskFinishResult { + return &MetaServiceReportTaskFinishResult{} +} + +var MetaServiceReportTaskFinishResult_Success_DEFAULT *ExecResp +func (p *MetaServiceReportTaskFinishResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceReportTaskFinishResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceReportTaskFinishResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceReportTaskFinishResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListClusterArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListClusterArgs() *MetaServiceListClusterArgs { + return &MetaServiceListClusterArgs{ + Req: NewListClusterInfoReq(), + } +} + +var MetaServiceListClusterArgs_Req_DEFAULT *ListClusterInfoReq +func (p *MetaServiceListClusterArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return MetaServiceListClusterArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListClusterArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListClusterArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListClusterArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListClusterResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListClusterResult() *MetaServiceListClusterResult { + return &MetaServiceListClusterResult{} +} + +var MetaServiceListClusterResult_Success_DEFAULT *ListClusterInfoResp +func (p *MetaServiceListClusterResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return MetaServiceListClusterResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListClusterResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListClusterResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListClusterResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetMetaDirInfoArgs struct { + thrift.IRequest + Req *GetMetaDirInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetMetaDirInfoArgs() *MetaServiceGetMetaDirInfoArgs { + return &MetaServiceGetMetaDirInfoArgs{ + Req: NewGetMetaDirInfoReq(), + } +} + +var MetaServiceGetMetaDirInfoArgs_Req_DEFAULT *GetMetaDirInfoReq +func (p *MetaServiceGetMetaDirInfoArgs) GetReq() *GetMetaDirInfoReq { + if !p.IsSetReq() { + return MetaServiceGetMetaDirInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetMetaDirInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetMetaDirInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetMetaDirInfoResult struct { + thrift.IResponse + Success *GetMetaDirInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetMetaDirInfoResult() *MetaServiceGetMetaDirInfoResult { + return &MetaServiceGetMetaDirInfoResult{} +} + +var MetaServiceGetMetaDirInfoResult_Success_DEFAULT *GetMetaDirInfoResp +func (p *MetaServiceGetMetaDirInfoResult) GetSuccess() *GetMetaDirInfoResp { + if !p.IsSetSuccess() { + return MetaServiceGetMetaDirInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetMetaDirInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetMetaDirInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_0/meta/ttypes.go b/ccore/nebula/internal/thrift/v2_5_0/meta/ttypes.go new file mode 100644 index 0000000..88136a4 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/meta/ttypes.go @@ -0,0 +1,29680 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + "sync" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int + +type AlterSchemaOp int64 + +const ( + AlterSchemaOp_ADD AlterSchemaOp = 1 + AlterSchemaOp_CHANGE AlterSchemaOp = 2 + AlterSchemaOp_DROP AlterSchemaOp = 3 + AlterSchemaOp_UNKNOWN AlterSchemaOp = 4 +) + +var AlterSchemaOpToName = map[AlterSchemaOp]string{ + AlterSchemaOp_ADD: "ADD", + AlterSchemaOp_CHANGE: "CHANGE", + AlterSchemaOp_DROP: "DROP", + AlterSchemaOp_UNKNOWN: "UNKNOWN", +} + +var AlterSchemaOpToValue = map[string]AlterSchemaOp{ + "ADD": AlterSchemaOp_ADD, + "CHANGE": AlterSchemaOp_CHANGE, + "DROP": AlterSchemaOp_DROP, + "UNKNOWN": AlterSchemaOp_UNKNOWN, +} + +var AlterSchemaOpNames = []string{ + "ADD", + "CHANGE", + "DROP", + "UNKNOWN", +} + +var AlterSchemaOpValues = []AlterSchemaOp{ + AlterSchemaOp_ADD, + AlterSchemaOp_CHANGE, + AlterSchemaOp_DROP, + AlterSchemaOp_UNKNOWN, +} + +func (p AlterSchemaOp) String() string { + if v, ok := AlterSchemaOpToName[p]; ok { + return v + } + return "" +} + +func AlterSchemaOpFromString(s string) (AlterSchemaOp, error) { + if v, ok := AlterSchemaOpToValue[s]; ok { + return v, nil + } + return AlterSchemaOp(0), fmt.Errorf("not a valid AlterSchemaOp string") +} + +func AlterSchemaOpPtr(v AlterSchemaOp) *AlterSchemaOp { return &v } + +type RoleType int64 + +const ( + RoleType_GOD RoleType = 1 + RoleType_ADMIN RoleType = 2 + RoleType_DBA RoleType = 3 + RoleType_USER RoleType = 4 + RoleType_GUEST RoleType = 5 +) + +var RoleTypeToName = map[RoleType]string{ + RoleType_GOD: "GOD", + RoleType_ADMIN: "ADMIN", + RoleType_DBA: "DBA", + RoleType_USER: "USER", + RoleType_GUEST: "GUEST", +} + +var RoleTypeToValue = map[string]RoleType{ + "GOD": RoleType_GOD, + "ADMIN": RoleType_ADMIN, + "DBA": RoleType_DBA, + "USER": RoleType_USER, + "GUEST": RoleType_GUEST, +} + +var RoleTypeNames = []string{ + "GOD", + "ADMIN", + "DBA", + "USER", + "GUEST", +} + +var RoleTypeValues = []RoleType{ + RoleType_GOD, + RoleType_ADMIN, + RoleType_DBA, + RoleType_USER, + RoleType_GUEST, +} + +func (p RoleType) String() string { + if v, ok := RoleTypeToName[p]; ok { + return v + } + return "" +} + +func RoleTypeFromString(s string) (RoleType, error) { + if v, ok := RoleTypeToValue[s]; ok { + return v, nil + } + return RoleType(0), fmt.Errorf("not a valid RoleType string") +} + +func RoleTypePtr(v RoleType) *RoleType { return &v } + +type PropertyType int64 + +const ( + PropertyType_UNKNOWN PropertyType = 0 + PropertyType_BOOL PropertyType = 1 + PropertyType_INT64 PropertyType = 2 + PropertyType_VID PropertyType = 3 + PropertyType_FLOAT PropertyType = 4 + PropertyType_DOUBLE PropertyType = 5 + PropertyType_STRING PropertyType = 6 + PropertyType_FIXED_STRING PropertyType = 7 + PropertyType_INT8 PropertyType = 8 + PropertyType_INT16 PropertyType = 9 + PropertyType_INT32 PropertyType = 10 + PropertyType_TIMESTAMP PropertyType = 21 + PropertyType_DATE PropertyType = 24 + PropertyType_DATETIME PropertyType = 25 + PropertyType_TIME PropertyType = 26 +) + +var PropertyTypeToName = map[PropertyType]string{ + PropertyType_UNKNOWN: "UNKNOWN", + PropertyType_BOOL: "BOOL", + PropertyType_INT64: "INT64", + PropertyType_VID: "VID", + PropertyType_FLOAT: "FLOAT", + PropertyType_DOUBLE: "DOUBLE", + PropertyType_STRING: "STRING", + PropertyType_FIXED_STRING: "FIXED_STRING", + PropertyType_INT8: "INT8", + PropertyType_INT16: "INT16", + PropertyType_INT32: "INT32", + PropertyType_TIMESTAMP: "TIMESTAMP", + PropertyType_DATE: "DATE", + PropertyType_DATETIME: "DATETIME", + PropertyType_TIME: "TIME", +} + +var PropertyTypeToValue = map[string]PropertyType{ + "UNKNOWN": PropertyType_UNKNOWN, + "BOOL": PropertyType_BOOL, + "INT64": PropertyType_INT64, + "VID": PropertyType_VID, + "FLOAT": PropertyType_FLOAT, + "DOUBLE": PropertyType_DOUBLE, + "STRING": PropertyType_STRING, + "FIXED_STRING": PropertyType_FIXED_STRING, + "INT8": PropertyType_INT8, + "INT16": PropertyType_INT16, + "INT32": PropertyType_INT32, + "TIMESTAMP": PropertyType_TIMESTAMP, + "DATE": PropertyType_DATE, + "DATETIME": PropertyType_DATETIME, + "TIME": PropertyType_TIME, +} + +var PropertyTypeNames = []string{ + "UNKNOWN", + "BOOL", + "INT64", + "VID", + "FLOAT", + "DOUBLE", + "STRING", + "FIXED_STRING", + "INT8", + "INT16", + "INT32", + "TIMESTAMP", + "DATE", + "DATETIME", + "TIME", +} + +var PropertyTypeValues = []PropertyType{ + PropertyType_UNKNOWN, + PropertyType_BOOL, + PropertyType_INT64, + PropertyType_VID, + PropertyType_FLOAT, + PropertyType_DOUBLE, + PropertyType_STRING, + PropertyType_FIXED_STRING, + PropertyType_INT8, + PropertyType_INT16, + PropertyType_INT32, + PropertyType_TIMESTAMP, + PropertyType_DATE, + PropertyType_DATETIME, + PropertyType_TIME, +} + +func (p PropertyType) String() string { + if v, ok := PropertyTypeToName[p]; ok { + return v + } + return "" +} + +func PropertyTypeFromString(s string) (PropertyType, error) { + if v, ok := PropertyTypeToValue[s]; ok { + return v, nil + } + return PropertyType(0), fmt.Errorf("not a valid PropertyType string") +} + +func PropertyTypePtr(v PropertyType) *PropertyType { return &v } + +type IsolationLevel int64 + +const ( + IsolationLevel_DEFAULT IsolationLevel = 0 + IsolationLevel_TOSS IsolationLevel = 1 +) + +var IsolationLevelToName = map[IsolationLevel]string{ + IsolationLevel_DEFAULT: "DEFAULT", + IsolationLevel_TOSS: "TOSS", +} + +var IsolationLevelToValue = map[string]IsolationLevel{ + "DEFAULT": IsolationLevel_DEFAULT, + "TOSS": IsolationLevel_TOSS, +} + +var IsolationLevelNames = []string{ + "DEFAULT", + "TOSS", +} + +var IsolationLevelValues = []IsolationLevel{ + IsolationLevel_DEFAULT, + IsolationLevel_TOSS, +} + +func (p IsolationLevel) String() string { + if v, ok := IsolationLevelToName[p]; ok { + return v + } + return "" +} + +func IsolationLevelFromString(s string) (IsolationLevel, error) { + if v, ok := IsolationLevelToValue[s]; ok { + return v, nil + } + return IsolationLevel(0), fmt.Errorf("not a valid IsolationLevel string") +} + +func IsolationLevelPtr(v IsolationLevel) *IsolationLevel { return &v } + +type HostStatus int64 + +const ( + HostStatus_ONLINE HostStatus = 0 + HostStatus_OFFLINE HostStatus = 1 + HostStatus_UNKNOWN HostStatus = 2 +) + +var HostStatusToName = map[HostStatus]string{ + HostStatus_ONLINE: "ONLINE", + HostStatus_OFFLINE: "OFFLINE", + HostStatus_UNKNOWN: "UNKNOWN", +} + +var HostStatusToValue = map[string]HostStatus{ + "ONLINE": HostStatus_ONLINE, + "OFFLINE": HostStatus_OFFLINE, + "UNKNOWN": HostStatus_UNKNOWN, +} + +var HostStatusNames = []string{ + "ONLINE", + "OFFLINE", + "UNKNOWN", +} + +var HostStatusValues = []HostStatus{ + HostStatus_ONLINE, + HostStatus_OFFLINE, + HostStatus_UNKNOWN, +} + +func (p HostStatus) String() string { + if v, ok := HostStatusToName[p]; ok { + return v + } + return "" +} + +func HostStatusFromString(s string) (HostStatus, error) { + if v, ok := HostStatusToValue[s]; ok { + return v, nil + } + return HostStatus(0), fmt.Errorf("not a valid HostStatus string") +} + +func HostStatusPtr(v HostStatus) *HostStatus { return &v } + +type SnapshotStatus int64 + +const ( + SnapshotStatus_VALID SnapshotStatus = 0 + SnapshotStatus_INVALID SnapshotStatus = 1 +) + +var SnapshotStatusToName = map[SnapshotStatus]string{ + SnapshotStatus_VALID: "VALID", + SnapshotStatus_INVALID: "INVALID", +} + +var SnapshotStatusToValue = map[string]SnapshotStatus{ + "VALID": SnapshotStatus_VALID, + "INVALID": SnapshotStatus_INVALID, +} + +var SnapshotStatusNames = []string{ + "VALID", + "INVALID", +} + +var SnapshotStatusValues = []SnapshotStatus{ + SnapshotStatus_VALID, + SnapshotStatus_INVALID, +} + +func (p SnapshotStatus) String() string { + if v, ok := SnapshotStatusToName[p]; ok { + return v + } + return "" +} + +func SnapshotStatusFromString(s string) (SnapshotStatus, error) { + if v, ok := SnapshotStatusToValue[s]; ok { + return v, nil + } + return SnapshotStatus(0), fmt.Errorf("not a valid SnapshotStatus string") +} + +func SnapshotStatusPtr(v SnapshotStatus) *SnapshotStatus { return &v } + +type AdminJobOp int64 + +const ( + AdminJobOp_ADD AdminJobOp = 1 + AdminJobOp_SHOW_All AdminJobOp = 2 + AdminJobOp_SHOW AdminJobOp = 3 + AdminJobOp_STOP AdminJobOp = 4 + AdminJobOp_RECOVER AdminJobOp = 5 +) + +var AdminJobOpToName = map[AdminJobOp]string{ + AdminJobOp_ADD: "ADD", + AdminJobOp_SHOW_All: "SHOW_All", + AdminJobOp_SHOW: "SHOW", + AdminJobOp_STOP: "STOP", + AdminJobOp_RECOVER: "RECOVER", +} + +var AdminJobOpToValue = map[string]AdminJobOp{ + "ADD": AdminJobOp_ADD, + "SHOW_All": AdminJobOp_SHOW_All, + "SHOW": AdminJobOp_SHOW, + "STOP": AdminJobOp_STOP, + "RECOVER": AdminJobOp_RECOVER, +} + +var AdminJobOpNames = []string{ + "ADD", + "SHOW_All", + "SHOW", + "STOP", + "RECOVER", +} + +var AdminJobOpValues = []AdminJobOp{ + AdminJobOp_ADD, + AdminJobOp_SHOW_All, + AdminJobOp_SHOW, + AdminJobOp_STOP, + AdminJobOp_RECOVER, +} + +func (p AdminJobOp) String() string { + if v, ok := AdminJobOpToName[p]; ok { + return v + } + return "" +} + +func AdminJobOpFromString(s string) (AdminJobOp, error) { + if v, ok := AdminJobOpToValue[s]; ok { + return v, nil + } + return AdminJobOp(0), fmt.Errorf("not a valid AdminJobOp string") +} + +func AdminJobOpPtr(v AdminJobOp) *AdminJobOp { return &v } + +type AdminCmd int64 + +const ( + AdminCmd_COMPACT AdminCmd = 0 + AdminCmd_FLUSH AdminCmd = 1 + AdminCmd_REBUILD_TAG_INDEX AdminCmd = 2 + AdminCmd_REBUILD_EDGE_INDEX AdminCmd = 3 + AdminCmd_REBUILD_FULLTEXT_INDEX AdminCmd = 4 + AdminCmd_STATS AdminCmd = 5 + AdminCmd_DATA_BALANCE AdminCmd = 6 + AdminCmd_DOWNLOAD AdminCmd = 7 + AdminCmd_INGEST AdminCmd = 8 + AdminCmd_UNKNOWN AdminCmd = 99 +) + +var AdminCmdToName = map[AdminCmd]string{ + AdminCmd_COMPACT: "COMPACT", + AdminCmd_FLUSH: "FLUSH", + AdminCmd_REBUILD_TAG_INDEX: "REBUILD_TAG_INDEX", + AdminCmd_REBUILD_EDGE_INDEX: "REBUILD_EDGE_INDEX", + AdminCmd_REBUILD_FULLTEXT_INDEX: "REBUILD_FULLTEXT_INDEX", + AdminCmd_STATS: "STATS", + AdminCmd_DATA_BALANCE: "DATA_BALANCE", + AdminCmd_DOWNLOAD: "DOWNLOAD", + AdminCmd_INGEST: "INGEST", + AdminCmd_UNKNOWN: "UNKNOWN", +} + +var AdminCmdToValue = map[string]AdminCmd{ + "COMPACT": AdminCmd_COMPACT, + "FLUSH": AdminCmd_FLUSH, + "REBUILD_TAG_INDEX": AdminCmd_REBUILD_TAG_INDEX, + "REBUILD_EDGE_INDEX": AdminCmd_REBUILD_EDGE_INDEX, + "REBUILD_FULLTEXT_INDEX": AdminCmd_REBUILD_FULLTEXT_INDEX, + "STATS": AdminCmd_STATS, + "DATA_BALANCE": AdminCmd_DATA_BALANCE, + "DOWNLOAD": AdminCmd_DOWNLOAD, + "INGEST": AdminCmd_INGEST, + "UNKNOWN": AdminCmd_UNKNOWN, +} + +var AdminCmdNames = []string{ + "COMPACT", + "FLUSH", + "REBUILD_TAG_INDEX", + "REBUILD_EDGE_INDEX", + "REBUILD_FULLTEXT_INDEX", + "STATS", + "DATA_BALANCE", + "DOWNLOAD", + "INGEST", + "UNKNOWN", +} + +var AdminCmdValues = []AdminCmd{ + AdminCmd_COMPACT, + AdminCmd_FLUSH, + AdminCmd_REBUILD_TAG_INDEX, + AdminCmd_REBUILD_EDGE_INDEX, + AdminCmd_REBUILD_FULLTEXT_INDEX, + AdminCmd_STATS, + AdminCmd_DATA_BALANCE, + AdminCmd_DOWNLOAD, + AdminCmd_INGEST, + AdminCmd_UNKNOWN, +} + +func (p AdminCmd) String() string { + if v, ok := AdminCmdToName[p]; ok { + return v + } + return "" +} + +func AdminCmdFromString(s string) (AdminCmd, error) { + if v, ok := AdminCmdToValue[s]; ok { + return v, nil + } + return AdminCmd(0), fmt.Errorf("not a valid AdminCmd string") +} + +func AdminCmdPtr(v AdminCmd) *AdminCmd { return &v } + +type JobStatus int64 + +const ( + JobStatus_QUEUE JobStatus = 1 + JobStatus_RUNNING JobStatus = 2 + JobStatus_FINISHED JobStatus = 3 + JobStatus_FAILED JobStatus = 4 + JobStatus_STOPPED JobStatus = 5 + JobStatus_INVALID JobStatus = 255 +) + +var JobStatusToName = map[JobStatus]string{ + JobStatus_QUEUE: "QUEUE", + JobStatus_RUNNING: "RUNNING", + JobStatus_FINISHED: "FINISHED", + JobStatus_FAILED: "FAILED", + JobStatus_STOPPED: "STOPPED", + JobStatus_INVALID: "INVALID", +} + +var JobStatusToValue = map[string]JobStatus{ + "QUEUE": JobStatus_QUEUE, + "RUNNING": JobStatus_RUNNING, + "FINISHED": JobStatus_FINISHED, + "FAILED": JobStatus_FAILED, + "STOPPED": JobStatus_STOPPED, + "INVALID": JobStatus_INVALID, +} + +var JobStatusNames = []string{ + "QUEUE", + "RUNNING", + "FINISHED", + "FAILED", + "STOPPED", + "INVALID", +} + +var JobStatusValues = []JobStatus{ + JobStatus_QUEUE, + JobStatus_RUNNING, + JobStatus_FINISHED, + JobStatus_FAILED, + JobStatus_STOPPED, + JobStatus_INVALID, +} + +func (p JobStatus) String() string { + if v, ok := JobStatusToName[p]; ok { + return v + } + return "" +} + +func JobStatusFromString(s string) (JobStatus, error) { + if v, ok := JobStatusToValue[s]; ok { + return v, nil + } + return JobStatus(0), fmt.Errorf("not a valid JobStatus string") +} + +func JobStatusPtr(v JobStatus) *JobStatus { return &v } + +type ListHostType int64 + +const ( + ListHostType_ALLOC ListHostType = 0 + ListHostType_GRAPH ListHostType = 1 + ListHostType_META ListHostType = 2 + ListHostType_STORAGE ListHostType = 3 +) + +var ListHostTypeToName = map[ListHostType]string{ + ListHostType_ALLOC: "ALLOC", + ListHostType_GRAPH: "GRAPH", + ListHostType_META: "META", + ListHostType_STORAGE: "STORAGE", +} + +var ListHostTypeToValue = map[string]ListHostType{ + "ALLOC": ListHostType_ALLOC, + "GRAPH": ListHostType_GRAPH, + "META": ListHostType_META, + "STORAGE": ListHostType_STORAGE, +} + +var ListHostTypeNames = []string{ + "ALLOC", + "GRAPH", + "META", + "STORAGE", +} + +var ListHostTypeValues = []ListHostType{ + ListHostType_ALLOC, + ListHostType_GRAPH, + ListHostType_META, + ListHostType_STORAGE, +} + +func (p ListHostType) String() string { + if v, ok := ListHostTypeToName[p]; ok { + return v + } + return "" +} + +func ListHostTypeFromString(s string) (ListHostType, error) { + if v, ok := ListHostTypeToValue[s]; ok { + return v, nil + } + return ListHostType(0), fmt.Errorf("not a valid ListHostType string") +} + +func ListHostTypePtr(v ListHostType) *ListHostType { return &v } + +type HostRole int64 + +const ( + HostRole_GRAPH HostRole = 0 + HostRole_META HostRole = 1 + HostRole_STORAGE HostRole = 2 + HostRole_LISTENER HostRole = 3 + HostRole_UNKNOWN HostRole = 4 +) + +var HostRoleToName = map[HostRole]string{ + HostRole_GRAPH: "GRAPH", + HostRole_META: "META", + HostRole_STORAGE: "STORAGE", + HostRole_LISTENER: "LISTENER", + HostRole_UNKNOWN: "UNKNOWN", +} + +var HostRoleToValue = map[string]HostRole{ + "GRAPH": HostRole_GRAPH, + "META": HostRole_META, + "STORAGE": HostRole_STORAGE, + "LISTENER": HostRole_LISTENER, + "UNKNOWN": HostRole_UNKNOWN, +} + +var HostRoleNames = []string{ + "GRAPH", + "META", + "STORAGE", + "LISTENER", + "UNKNOWN", +} + +var HostRoleValues = []HostRole{ + HostRole_GRAPH, + HostRole_META, + HostRole_STORAGE, + HostRole_LISTENER, + HostRole_UNKNOWN, +} + +func (p HostRole) String() string { + if v, ok := HostRoleToName[p]; ok { + return v + } + return "" +} + +func HostRoleFromString(s string) (HostRole, error) { + if v, ok := HostRoleToValue[s]; ok { + return v, nil + } + return HostRole(0), fmt.Errorf("not a valid HostRole string") +} + +func HostRolePtr(v HostRole) *HostRole { return &v } + +type TaskResult_ int64 + +const ( + TaskResult__SUCCEEDED TaskResult_ = 0 + TaskResult__FAILED TaskResult_ = 1 + TaskResult__IN_PROGRESS TaskResult_ = 2 + TaskResult__INVALID TaskResult_ = 3 +) + +var TaskResult_ToName = map[TaskResult_]string{ + TaskResult__SUCCEEDED: "SUCCEEDED", + TaskResult__FAILED: "FAILED", + TaskResult__IN_PROGRESS: "IN_PROGRESS", + TaskResult__INVALID: "INVALID", +} + +var TaskResult_ToValue = map[string]TaskResult_{ + "SUCCEEDED": TaskResult__SUCCEEDED, + "FAILED": TaskResult__FAILED, + "IN_PROGRESS": TaskResult__IN_PROGRESS, + "INVALID": TaskResult__INVALID, +} + +var TaskResult_Names = []string{ + "SUCCEEDED", + "FAILED", + "IN_PROGRESS", + "INVALID", +} + +var TaskResult_Values = []TaskResult_{ + TaskResult__SUCCEEDED, + TaskResult__FAILED, + TaskResult__IN_PROGRESS, + TaskResult__INVALID, +} + +func (p TaskResult_) String() string { + if v, ok := TaskResult_ToName[p]; ok { + return v + } + return "" +} + +func TaskResult_FromString(s string) (TaskResult_, error) { + if v, ok := TaskResult_ToValue[s]; ok { + return v, nil + } + return TaskResult_(0), fmt.Errorf("not a valid TaskResult_ string") +} + +func TaskResult_Ptr(v TaskResult_) *TaskResult_ { return &v } + +type ConfigModule int64 + +const ( + ConfigModule_UNKNOWN ConfigModule = 0 + ConfigModule_ALL ConfigModule = 1 + ConfigModule_GRAPH ConfigModule = 2 + ConfigModule_META ConfigModule = 3 + ConfigModule_STORAGE ConfigModule = 4 +) + +var ConfigModuleToName = map[ConfigModule]string{ + ConfigModule_UNKNOWN: "UNKNOWN", + ConfigModule_ALL: "ALL", + ConfigModule_GRAPH: "GRAPH", + ConfigModule_META: "META", + ConfigModule_STORAGE: "STORAGE", +} + +var ConfigModuleToValue = map[string]ConfigModule{ + "UNKNOWN": ConfigModule_UNKNOWN, + "ALL": ConfigModule_ALL, + "GRAPH": ConfigModule_GRAPH, + "META": ConfigModule_META, + "STORAGE": ConfigModule_STORAGE, +} + +var ConfigModuleNames = []string{ + "UNKNOWN", + "ALL", + "GRAPH", + "META", + "STORAGE", +} + +var ConfigModuleValues = []ConfigModule{ + ConfigModule_UNKNOWN, + ConfigModule_ALL, + ConfigModule_GRAPH, + ConfigModule_META, + ConfigModule_STORAGE, +} + +func (p ConfigModule) String() string { + if v, ok := ConfigModuleToName[p]; ok { + return v + } + return "" +} + +func ConfigModuleFromString(s string) (ConfigModule, error) { + if v, ok := ConfigModuleToValue[s]; ok { + return v, nil + } + return ConfigModule(0), fmt.Errorf("not a valid ConfigModule string") +} + +func ConfigModulePtr(v ConfigModule) *ConfigModule { return &v } + +type ConfigMode int64 + +const ( + ConfigMode_IMMUTABLE ConfigMode = 0 + ConfigMode_REBOOT ConfigMode = 1 + ConfigMode_MUTABLE ConfigMode = 2 + ConfigMode_IGNORED ConfigMode = 3 +) + +var ConfigModeToName = map[ConfigMode]string{ + ConfigMode_IMMUTABLE: "IMMUTABLE", + ConfigMode_REBOOT: "REBOOT", + ConfigMode_MUTABLE: "MUTABLE", + ConfigMode_IGNORED: "IGNORED", +} + +var ConfigModeToValue = map[string]ConfigMode{ + "IMMUTABLE": ConfigMode_IMMUTABLE, + "REBOOT": ConfigMode_REBOOT, + "MUTABLE": ConfigMode_MUTABLE, + "IGNORED": ConfigMode_IGNORED, +} + +var ConfigModeNames = []string{ + "IMMUTABLE", + "REBOOT", + "MUTABLE", + "IGNORED", +} + +var ConfigModeValues = []ConfigMode{ + ConfigMode_IMMUTABLE, + ConfigMode_REBOOT, + ConfigMode_MUTABLE, + ConfigMode_IGNORED, +} + +func (p ConfigMode) String() string { + if v, ok := ConfigModeToName[p]; ok { + return v + } + return "" +} + +func ConfigModeFromString(s string) (ConfigMode, error) { + if v, ok := ConfigModeToValue[s]; ok { + return v, nil + } + return ConfigMode(0), fmt.Errorf("not a valid ConfigMode string") +} + +func ConfigModePtr(v ConfigMode) *ConfigMode { return &v } + +type ListenerType int64 + +const ( + ListenerType_UNKNOWN ListenerType = 0 + ListenerType_ELASTICSEARCH ListenerType = 1 +) + +var ListenerTypeToName = map[ListenerType]string{ + ListenerType_UNKNOWN: "UNKNOWN", + ListenerType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var ListenerTypeToValue = map[string]ListenerType{ + "UNKNOWN": ListenerType_UNKNOWN, + "ELASTICSEARCH": ListenerType_ELASTICSEARCH, +} + +var ListenerTypeNames = []string{ + "UNKNOWN", + "ELASTICSEARCH", +} + +var ListenerTypeValues = []ListenerType{ + ListenerType_UNKNOWN, + ListenerType_ELASTICSEARCH, +} + +func (p ListenerType) String() string { + if v, ok := ListenerTypeToName[p]; ok { + return v + } + return "" +} + +func ListenerTypeFromString(s string) (ListenerType, error) { + if v, ok := ListenerTypeToValue[s]; ok { + return v, nil + } + return ListenerType(0), fmt.Errorf("not a valid ListenerType string") +} + +func ListenerTypePtr(v ListenerType) *ListenerType { return &v } + +type FTServiceType int64 + +const ( + FTServiceType_ELASTICSEARCH FTServiceType = 1 +) + +var FTServiceTypeToName = map[FTServiceType]string{ + FTServiceType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var FTServiceTypeToValue = map[string]FTServiceType{ + "ELASTICSEARCH": FTServiceType_ELASTICSEARCH, +} + +var FTServiceTypeNames = []string{ + "ELASTICSEARCH", +} + +var FTServiceTypeValues = []FTServiceType{ + FTServiceType_ELASTICSEARCH, +} + +func (p FTServiceType) String() string { + if v, ok := FTServiceTypeToName[p]; ok { + return v + } + return "" +} + +func FTServiceTypeFromString(s string) (FTServiceType, error) { + if v, ok := FTServiceTypeToValue[s]; ok { + return v, nil + } + return FTServiceType(0), fmt.Errorf("not a valid FTServiceType string") +} + +func FTServiceTypePtr(v FTServiceType) *FTServiceType { return &v } + +type QueryStatus int64 + +const ( + QueryStatus_RUNNING QueryStatus = 1 + QueryStatus_KILLING QueryStatus = 2 +) + +var QueryStatusToName = map[QueryStatus]string{ + QueryStatus_RUNNING: "RUNNING", + QueryStatus_KILLING: "KILLING", +} + +var QueryStatusToValue = map[string]QueryStatus{ + "RUNNING": QueryStatus_RUNNING, + "KILLING": QueryStatus_KILLING, +} + +var QueryStatusNames = []string{ + "RUNNING", + "KILLING", +} + +var QueryStatusValues = []QueryStatus{ + QueryStatus_RUNNING, + QueryStatus_KILLING, +} + +func (p QueryStatus) String() string { + if v, ok := QueryStatusToName[p]; ok { + return v + } + return "" +} + +func QueryStatusFromString(s string) (QueryStatus, error) { + if v, ok := QueryStatusToValue[s]; ok { + return v, nil + } + return QueryStatus(0), fmt.Errorf("not a valid QueryStatus string") +} + +func QueryStatusPtr(v QueryStatus) *QueryStatus { return &v } + +type SchemaVer = int64 + +func SchemaVerPtr(v SchemaVer) *SchemaVer { return &v } + +type ClusterID = int64 + +func ClusterIDPtr(v ClusterID) *ClusterID { return &v } + +// Attributes: +// - SpaceID +// - TagID +// - EdgeType +// - IndexID +// - ClusterID +type ID struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + TagID *nebula0.TagID `thrift:"tag_id,2" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,3" db:"edge_type" json:"edge_type,omitempty"` + IndexID *nebula0.IndexID `thrift:"index_id,4" db:"index_id" json:"index_id,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,5" db:"cluster_id" json:"cluster_id,omitempty"` +} + +func NewID() *ID { + return &ID{} +} + +var ID_SpaceID_DEFAULT nebula0.GraphSpaceID + +func (p *ID) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return ID_SpaceID_DEFAULT + } + return *p.SpaceID +} + +var ID_TagID_DEFAULT nebula0.TagID + +func (p *ID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return ID_TagID_DEFAULT + } + return *p.TagID +} + +var ID_EdgeType_DEFAULT nebula0.EdgeType + +func (p *ID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return ID_EdgeType_DEFAULT + } + return *p.EdgeType +} + +var ID_IndexID_DEFAULT nebula0.IndexID + +func (p *ID) GetIndexID() nebula0.IndexID { + if !p.IsSetIndexID() { + return ID_IndexID_DEFAULT + } + return *p.IndexID +} + +var ID_ClusterID_DEFAULT ClusterID + +func (p *ID) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return ID_ClusterID_DEFAULT + } + return *p.ClusterID +} +func (p *ID) CountSetFieldsID() int { + count := 0 + if p.IsSetSpaceID() { + count++ + } + if p.IsSetTagID() { + count++ + } + if p.IsSetEdgeType() { + count++ + } + if p.IsSetIndexID() { + count++ + } + if p.IsSetClusterID() { + count++ + } + return count + +} + +func (p *ID) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *ID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *ID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *ID) IsSetIndexID() bool { + return p != nil && p.IndexID != nil +} + +func (p *ID) IsSetClusterID() bool { + return p != nil && p.ClusterID != nil +} + +func (p *ID) 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 + } + 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 *ID) 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 *ID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = &temp + } + return nil +} + +func (p *ID) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp + } + return nil +} + +func (p *ID) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := nebula0.IndexID(v) + p.IndexID = &temp + } + return nil +} + +func (p *ID) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := ClusterID(v) + p.ClusterID = &temp + } + return nil +} + +func (p *ID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("ID"); 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 *ID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *ID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_id: ", p), err) + } + } + return err +} + +func (p *ID) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_type: ", p), err) + } + } + return err +} + +func (p *ID) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetIndexID() { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:index_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:index_id: ", p), err) + } + } + return err +} + +func (p *ID) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_id: ", p), err) + } + } + return err +} + +func (p *ID) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + var indexIDVal string + if p.IndexID == nil { + indexIDVal = "" + } else { + indexIDVal = fmt.Sprintf("%v", *p.IndexID) + } + var clusterIDVal string + if p.ClusterID == nil { + clusterIDVal = "" + } else { + clusterIDVal = fmt.Sprintf("%v", *p.ClusterID) + } + return fmt.Sprintf("ID({SpaceID:%s TagID:%s EdgeType:%s IndexID:%s ClusterID:%s})", spaceIDVal, tagIDVal, edgeTypeVal, indexIDVal, clusterIDVal) +} + +// Attributes: +// - Type +// - TypeLength +type ColumnTypeDef struct { + Type PropertyType `thrift:"type,1,required" db:"type" json:"type"` + TypeLength int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewColumnTypeDef() *ColumnTypeDef { + return &ColumnTypeDef{} +} + +func (p *ColumnTypeDef) GetType() PropertyType { + return p.Type +} + +var ColumnTypeDef_TypeLength_DEFAULT int16 = 0 + +func (p *ColumnTypeDef) GetTypeLength() int16 { + return p.TypeLength +} +func (p *ColumnTypeDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != ColumnTypeDef_TypeLength_DEFAULT +} + +func (p *ColumnTypeDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType 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 + } + issetType = 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 !issetType { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) + } + return nil +} + +func (p *ColumnTypeDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := PropertyType(v) + p.Type = temp + } + return nil +} + +func (p *ColumnTypeDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TypeLength = v + } + return nil +} + +func (p *ColumnTypeDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnTypeDef"); 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 *ColumnTypeDef) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ColumnTypeDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) + } + if err := oprot.WriteI16(int16(p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) + } + } + return err +} + +func (p *ColumnTypeDef) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + typeLengthVal := fmt.Sprintf("%v", p.TypeLength) + return fmt.Sprintf("ColumnTypeDef({Type:%s TypeLength:%s})", typeVal, typeLengthVal) +} + +// Attributes: +// - Name +// - Type +// - DefaultValue +// - Nullable +// - Comment +type ColumnDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Type *ColumnTypeDef `thrift:"type,2,required" db:"type" json:"type"` + DefaultValue []byte `thrift:"default_value,3" db:"default_value" json:"default_value,omitempty"` + Nullable bool `thrift:"nullable,4" db:"nullable" json:"nullable,omitempty"` + Comment []byte `thrift:"comment,5" db:"comment" json:"comment,omitempty"` +} + +func NewColumnDef() *ColumnDef { + return &ColumnDef{ + Type: NewColumnTypeDef(), + } +} + +func (p *ColumnDef) GetName() []byte { + return p.Name +} + +var ColumnDef_Type_DEFAULT *ColumnTypeDef + +func (p *ColumnDef) GetType() *ColumnTypeDef { + if !p.IsSetType() { + return ColumnDef_Type_DEFAULT + } + return p.Type +} + +var ColumnDef_DefaultValue_DEFAULT []byte + +func (p *ColumnDef) GetDefaultValue() []byte { + return p.DefaultValue +} + +var ColumnDef_Nullable_DEFAULT bool = false + +func (p *ColumnDef) GetNullable() bool { + return p.Nullable +} + +var ColumnDef_Comment_DEFAULT []byte + +func (p *ColumnDef) GetComment() []byte { + return p.Comment +} +func (p *ColumnDef) IsSetType() bool { + return p != nil && p.Type != nil +} + +func (p *ColumnDef) IsSetDefaultValue() bool { + return p != nil && p.DefaultValue != nil +} + +func (p *ColumnDef) IsSetNullable() bool { + return p != nil && p.Nullable != ColumnDef_Nullable_DEFAULT +} + +func (p *ColumnDef) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ColumnDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false + var issetType 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetType = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(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) + } + if !issetName { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")) + } + if !issetType { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) + } + return nil +} + +func (p *ColumnDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *ColumnDef) ReadField2(iprot thrift.Protocol) error { + p.Type = NewColumnTypeDef() + if err := p.Type.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err) + } + return nil +} + +func (p *ColumnDef) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.DefaultValue = v + } + return nil +} + +func (p *ColumnDef) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Nullable = v + } + return nil +} + +func (p *ColumnDef) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *ColumnDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnDef"); 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 *ColumnDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *ColumnDef) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := p.Type.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *ColumnDef) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetDefaultValue() { + if err := oprot.WriteFieldBegin("default_value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:default_value: ", p), err) + } + if err := oprot.WriteBinary(p.DefaultValue); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.default_value (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:default_value: ", p), err) + } + } + return err +} + +func (p *ColumnDef) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNullable() { + if err := oprot.WriteFieldBegin("nullable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:nullable: ", p), err) + } + if err := oprot.WriteBool(bool(p.Nullable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullable (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:nullable: ", p), err) + } + } + return err +} + +func (p *ColumnDef) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:comment: ", p), err) + } + } + return err +} + +func (p *ColumnDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeVal string + if p.Type == nil { + typeVal = "" + } else { + typeVal = fmt.Sprintf("%v", p.Type) + } + defaultValueVal := fmt.Sprintf("%v", p.DefaultValue) + nullableVal := fmt.Sprintf("%v", p.Nullable) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ColumnDef({Name:%s Type:%s DefaultValue:%s Nullable:%s Comment:%s})", nameVal, typeVal, defaultValueVal, nullableVal, commentVal) +} + +// Attributes: +// - TtlDuration +// - TtlCol +// - Comment +type SchemaProp struct { + TtlDuration *int64 `thrift:"ttl_duration,1" db:"ttl_duration" json:"ttl_duration,omitempty"` + TtlCol []byte `thrift:"ttl_col,2" db:"ttl_col" json:"ttl_col,omitempty"` + Comment []byte `thrift:"comment,3" db:"comment" json:"comment,omitempty"` +} + +func NewSchemaProp() *SchemaProp { + return &SchemaProp{} +} + +var SchemaProp_TtlDuration_DEFAULT int64 + +func (p *SchemaProp) GetTtlDuration() int64 { + if !p.IsSetTtlDuration() { + return SchemaProp_TtlDuration_DEFAULT + } + return *p.TtlDuration +} + +var SchemaProp_TtlCol_DEFAULT []byte + +func (p *SchemaProp) GetTtlCol() []byte { + return p.TtlCol +} + +var SchemaProp_Comment_DEFAULT []byte + +func (p *SchemaProp) GetComment() []byte { + return p.Comment +} +func (p *SchemaProp) IsSetTtlDuration() bool { + return p != nil && p.TtlDuration != nil +} + +func (p *SchemaProp) IsSetTtlCol() bool { + return p != nil && p.TtlCol != nil +} + +func (p *SchemaProp) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SchemaProp) 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 *SchemaProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TtlDuration = &v + } + return nil +} + +func (p *SchemaProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TtlCol = v + } + return nil +} + +func (p *SchemaProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *SchemaProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SchemaProp"); 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 *SchemaProp) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTtlDuration() { + if err := oprot.WriteFieldBegin("ttl_duration", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ttl_duration: ", p), err) + } + if err := oprot.WriteI64(int64(*p.TtlDuration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_duration (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ttl_duration: ", p), err) + } + } + return err +} + +func (p *SchemaProp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTtlCol() { + if err := oprot.WriteFieldBegin("ttl_col", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_col: ", p), err) + } + if err := oprot.WriteBinary(p.TtlCol); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_col (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_col: ", p), err) + } + } + return err +} + +func (p *SchemaProp) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:comment: ", p), err) + } + } + return err +} + +func (p *SchemaProp) String() string { + if p == nil { + return "" + } + + var ttlDurationVal string + if p.TtlDuration == nil { + ttlDurationVal = "" + } else { + ttlDurationVal = fmt.Sprintf("%v", *p.TtlDuration) + } + ttlColVal := fmt.Sprintf("%v", p.TtlCol) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SchemaProp({TtlDuration:%s TtlCol:%s Comment:%s})", ttlDurationVal, ttlColVal, commentVal) +} + +// Attributes: +// - Columns +// - SchemaProp +type Schema struct { + Columns []*ColumnDef `thrift:"columns,1" db:"columns" json:"columns"` + SchemaProp *SchemaProp `thrift:"schema_prop,2" db:"schema_prop" json:"schema_prop"` +} + +func NewSchema() *Schema { + return &Schema{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *Schema) GetColumns() []*ColumnDef { + return p.Columns +} + +var Schema_SchemaProp_DEFAULT *SchemaProp + +func (p *Schema) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return Schema_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *Schema) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *Schema) 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 *Schema) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Columns = tSlice + for i := 0; i < size; i++ { + _elem1 := NewColumnDef() + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Columns = append(p.Columns, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Schema) ReadField2(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *Schema) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Schema"); 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 *Schema) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) + } + return err +} + +func (p *Schema) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_prop: ", p), err) + } + return err +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + + columnsVal := fmt.Sprintf("%v", p.Columns) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("Schema({Columns:%s SchemaProp:%s})", columnsVal, schemaPropVal) +} + +// Attributes: +// - Id +// - Name +type IdName struct { + Id *ID `thrift:"id,1" db:"id" json:"id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewIdName() *IdName { + return &IdName{} +} + +var IdName_Id_DEFAULT *ID + +func (p *IdName) GetId() *ID { + if !p.IsSetId() { + return IdName_Id_DEFAULT + } + return p.Id +} + +func (p *IdName) GetName() []byte { + return p.Name +} +func (p *IdName) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *IdName) 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 *IdName) ReadField1(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *IdName) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IdName) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IdName"); 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 *IdName) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *IdName) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) + } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) + } + return err +} + +func (p *IdName) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("IdName({Id:%s Name:%s})", idVal, nameVal) +} + +// Attributes: +// - SpaceName +// - PartitionNum +// - ReplicaFactor +// - CharsetName +// - CollateName +// - VidType +// - GroupName +// - IsolationLevel +// - Comment +type SpaceDesc struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + PartitionNum int32 `thrift:"partition_num,2" db:"partition_num" json:"partition_num"` + ReplicaFactor int32 `thrift:"replica_factor,3" db:"replica_factor" json:"replica_factor"` + CharsetName []byte `thrift:"charset_name,4" db:"charset_name" json:"charset_name"` + CollateName []byte `thrift:"collate_name,5" db:"collate_name" json:"collate_name"` + VidType *ColumnTypeDef `thrift:"vid_type,6" db:"vid_type" json:"vid_type"` + GroupName []byte `thrift:"group_name,7" db:"group_name" json:"group_name,omitempty"` + IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` + Comment []byte `thrift:"comment,9" db:"comment" json:"comment,omitempty"` +} + +func NewSpaceDesc() *SpaceDesc { + return &SpaceDesc{ + VidType: NewColumnTypeDef(), + } +} + +func (p *SpaceDesc) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *SpaceDesc) GetPartitionNum() int32 { + return p.PartitionNum +} + +func (p *SpaceDesc) GetReplicaFactor() int32 { + return p.ReplicaFactor +} + +func (p *SpaceDesc) GetCharsetName() []byte { + return p.CharsetName +} + +func (p *SpaceDesc) GetCollateName() []byte { + return p.CollateName +} + +var SpaceDesc_VidType_DEFAULT *ColumnTypeDef = &ColumnTypeDef{ + Type: 7, + TypeLength: const_lit_vid_type_type_length, +} + +func (p *SpaceDesc) GetVidType() *ColumnTypeDef { + if !p.IsSetVidType() { + return SpaceDesc_VidType_DEFAULT + } + return p.VidType +} + +var SpaceDesc_GroupName_DEFAULT []byte + +func (p *SpaceDesc) GetGroupName() []byte { + return p.GroupName +} + +var SpaceDesc_IsolationLevel_DEFAULT IsolationLevel + +func (p *SpaceDesc) GetIsolationLevel() IsolationLevel { + if !p.IsSetIsolationLevel() { + return SpaceDesc_IsolationLevel_DEFAULT + } + return *p.IsolationLevel +} + +var SpaceDesc_Comment_DEFAULT []byte + +func (p *SpaceDesc) GetComment() []byte { + return p.Comment +} +func (p *SpaceDesc) IsSetVidType() bool { + return p != nil && p.VidType != nil +} + +func (p *SpaceDesc) IsSetGroupName() bool { + return p != nil && p.GroupName != nil +} + +func (p *SpaceDesc) IsSetIsolationLevel() bool { + return p != nil && p.IsolationLevel != nil +} + +func (p *SpaceDesc) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SpaceDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *SpaceDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PartitionNum = v + } + return nil +} + +func (p *SpaceDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ReplicaFactor = v + } + return nil +} + +func (p *SpaceDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CharsetName = v + } + return nil +} + +func (p *SpaceDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.CollateName = v + } + return nil +} + +func (p *SpaceDesc) ReadField6(iprot thrift.Protocol) error { + p.VidType = NewColumnTypeDef() + if err := p.VidType.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VidType), err) + } + return nil +} + +func (p *SpaceDesc) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *SpaceDesc) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + temp := IsolationLevel(v) + p.IsolationLevel = &temp + } + return nil +} + +func (p *SpaceDesc) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *SpaceDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *SpaceDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_num", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_num: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_num (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_num: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("replica_factor", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:replica_factor: ", p), err) + } + if err := oprot.WriteI32(int32(p.ReplicaFactor)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_factor (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:replica_factor: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("charset_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:charset_name: ", p), err) + } + if err := oprot.WriteBinary(p.CharsetName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.charset_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:charset_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("collate_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:collate_name: ", p), err) + } + if err := oprot.WriteBinary(p.CollateName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.collate_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:collate_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid_type", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vid_type: ", p), err) + } + if err := p.VidType.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VidType), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vid_type: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetGroupName() { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:group_name: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetIsolationLevel() { + if err := oprot.WriteFieldBegin("isolation_level", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:isolation_level: ", p), err) + } + if err := oprot.WriteI32(int32(*p.IsolationLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isolation_level (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:isolation_level: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:comment: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + partitionNumVal := fmt.Sprintf("%v", p.PartitionNum) + replicaFactorVal := fmt.Sprintf("%v", p.ReplicaFactor) + charsetNameVal := fmt.Sprintf("%v", p.CharsetName) + collateNameVal := fmt.Sprintf("%v", p.CollateName) + var vidTypeVal string + if p.VidType == nil { + vidTypeVal = "" + } else { + vidTypeVal = fmt.Sprintf("%v", p.VidType) + } + groupNameVal := fmt.Sprintf("%v", p.GroupName) + var isolationLevelVal string + if p.IsolationLevel == nil { + isolationLevelVal = "" + } else { + isolationLevelVal = fmt.Sprintf("%v", *p.IsolationLevel) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SpaceDesc({SpaceName:%s PartitionNum:%s ReplicaFactor:%s CharsetName:%s CollateName:%s VidType:%s GroupName:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, groupNameVal, isolationLevelVal, commentVal) +} + +// Attributes: +// - SpaceID +// - Properties +type SpaceItem struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Properties *SpaceDesc `thrift:"properties,2" db:"properties" json:"properties"` +} + +func NewSpaceItem() *SpaceItem { + return &SpaceItem{ + Properties: NewSpaceDesc(), + } +} + +func (p *SpaceItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +var SpaceItem_Properties_DEFAULT *SpaceDesc + +func (p *SpaceItem) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return SpaceItem_Properties_DEFAULT + } + return p.Properties +} +func (p *SpaceItem) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *SpaceItem) 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 *SpaceItem) 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 *SpaceItem) ReadField2(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *SpaceItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceItem"); 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 *SpaceItem) 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 *SpaceItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:properties: ", p), err) + } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) + } + return err +} + +func (p *SpaceItem) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + return fmt.Sprintf("SpaceItem({SpaceID:%s Properties:%s})", spaceIDVal, propertiesVal) +} + +// Attributes: +// - TagID +// - TagName +// - Version +// - Schema +type TagItem struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewTagItem() *TagItem { + return &TagItem{ + Schema: NewSchema(), + } +} + +func (p *TagItem) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *TagItem) GetTagName() []byte { + return p.TagName +} + +func (p *TagItem) GetVersion() SchemaVer { + return p.Version +} + +var TagItem_Schema_DEFAULT *Schema + +func (p *TagItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return TagItem_Schema_DEFAULT + } + return p.Schema +} +func (p *TagItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *TagItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TagItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = temp + } + return nil +} + +func (p *TagItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *TagItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *TagItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TagItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TagItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *TagItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) + } + return err +} + +func (p *TagItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *TagItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *TagItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) + } + return err +} + +func (p *TagItem) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("TagItem({TagID:%s TagName:%s Version:%s Schema:%s})", tagIDVal, tagNameVal, versionVal, schemaVal) +} + +// Attributes: +// - Op +// - Schema +type AlterSchemaItem struct { + Op AlterSchemaOp `thrift:"op,1" db:"op" json:"op"` + Schema *Schema `thrift:"schema,2" db:"schema" json:"schema"` +} + +func NewAlterSchemaItem() *AlterSchemaItem { + return &AlterSchemaItem{ + Schema: NewSchema(), + } +} + +func (p *AlterSchemaItem) GetOp() AlterSchemaOp { + return p.Op +} + +var AlterSchemaItem_Schema_DEFAULT *Schema + +func (p *AlterSchemaItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return AlterSchemaItem_Schema_DEFAULT + } + return p.Schema +} +func (p *AlterSchemaItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *AlterSchemaItem) 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 *AlterSchemaItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := AlterSchemaOp(v) + p.Op = temp + } + return nil +} + +func (p *AlterSchemaItem) ReadField2(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *AlterSchemaItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterSchemaItem"); 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 *AlterSchemaItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) + } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) + } + return err +} + +func (p *AlterSchemaItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) + } + return err +} + +func (p *AlterSchemaItem) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("AlterSchemaItem({Op:%s Schema:%s})", opVal, schemaVal) +} + +// Attributes: +// - EdgeType +// - EdgeName +// - Version +// - Schema +type EdgeItem struct { + EdgeType nebula0.EdgeType `thrift:"edge_type,1" db:"edge_type" json:"edge_type"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewEdgeItem() *EdgeItem { + return &EdgeItem{ + Schema: NewSchema(), + } +} + +func (p *EdgeItem) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeItem) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *EdgeItem) GetVersion() SchemaVer { + return p.Version +} + +var EdgeItem_Schema_DEFAULT *Schema + +func (p *EdgeItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return EdgeItem_Schema_DEFAULT + } + return p.Schema +} +func (p *EdgeItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *EdgeItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp + } + return nil +} + +func (p *EdgeItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *EdgeItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *EdgeItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *EdgeItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *EdgeItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_type: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) + } + return err +} + +func (p *EdgeItem) String() string { + if p == nil { + return "" + } + + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("EdgeItem({EdgeType:%s EdgeName:%s Version:%s Schema:%s})", edgeTypeVal, edgeNameVal, versionVal, schemaVal) +} + +// Attributes: +// - TagID +// - EdgeType +type SchemaID struct { + TagID *nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type,omitempty"` +} + +func NewSchemaID() *SchemaID { + return &SchemaID{} +} + +var SchemaID_TagID_DEFAULT nebula0.TagID + +func (p *SchemaID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return SchemaID_TagID_DEFAULT + } + return *p.TagID +} + +var SchemaID_EdgeType_DEFAULT nebula0.EdgeType + +func (p *SchemaID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return SchemaID_EdgeType_DEFAULT + } + return *p.EdgeType +} +func (p *SchemaID) CountSetFieldsSchemaID() int { + count := 0 + if p.IsSetTagID() { + count++ + } + if p.IsSetEdgeType() { + count++ + } + return count + +} + +func (p *SchemaID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *SchemaID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *SchemaID) 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 *SchemaID) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = &temp + } + return nil +} + +func (p *SchemaID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp + } + return nil +} + +func (p *SchemaID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsSchemaID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SchemaID"); 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 *SchemaID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) + } + } + return err +} + +func (p *SchemaID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) + } + } + return err +} + +func (p *SchemaID) String() string { + if p == nil { + return "" + } + + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + return fmt.Sprintf("SchemaID({TagID:%s EdgeType:%s})", tagIDVal, edgeTypeVal) +} + +// Attributes: +// - IndexID +// - IndexName +// - SchemaID +// - SchemaName +// - Fields +// - Comment +type IndexItem struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + SchemaID *SchemaID `thrift:"schema_id,3" db:"schema_id" json:"schema_id"` + SchemaName []byte `thrift:"schema_name,4" db:"schema_name" json:"schema_name"` + Fields []*ColumnDef `thrift:"fields,5" db:"fields" json:"fields"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewIndexItem() *IndexItem { + return &IndexItem{} +} + +func (p *IndexItem) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexItem) GetIndexName() []byte { + return p.IndexName +} + +var IndexItem_SchemaID_DEFAULT *SchemaID + +func (p *IndexItem) GetSchemaID() *SchemaID { + if !p.IsSetSchemaID() { + return IndexItem_SchemaID_DEFAULT + } + return p.SchemaID +} + +func (p *IndexItem) GetSchemaName() []byte { + return p.SchemaName +} + +func (p *IndexItem) GetFields() []*ColumnDef { + return p.Fields +} + +var IndexItem_Comment_DEFAULT []byte + +func (p *IndexItem) GetComment() []byte { + return p.Comment +} +func (p *IndexItem) IsSetSchemaID() bool { + return p != nil && p.SchemaID != nil +} + +func (p *IndexItem) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *IndexItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.IndexID(v) + p.IndexID = temp + } + return nil +} + +func (p *IndexItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *IndexItem) ReadField3(iprot thrift.Protocol) error { + p.SchemaID = NewSchemaID() + if err := p.SchemaID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SchemaName = v + } + return nil +} + +func (p *IndexItem) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem2 := NewColumnDef() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.Fields = append(p.Fields, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *IndexItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *IndexItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) + } + return err +} + +func (p *IndexItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *IndexItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema_id: ", p), err) + } + if err := p.SchemaID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema_id: ", p), err) + } + return err +} + +func (p *IndexItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_name: ", p), err) + } + if err := oprot.WriteBinary(p.SchemaName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schema_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_name: ", p), err) + } + return err +} + +func (p *IndexItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err) + } + return err +} + +func (p *IndexItem) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *IndexItem) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + var schemaIDVal string + if p.SchemaID == nil { + schemaIDVal = "" + } else { + schemaIDVal = fmt.Sprintf("%v", p.SchemaID) + } + schemaNameVal := fmt.Sprintf("%v", p.SchemaName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal) +} + +// Attributes: +// - HostAddr +// - Status +// - LeaderParts +// - AllParts +// - Role +// - GitInfoSha +// - ZoneName +// - Version +type HostItem struct { + HostAddr *nebula0.HostAddr `thrift:"hostAddr,1" db:"hostAddr" json:"hostAddr"` + Status HostStatus `thrift:"status,2" db:"status" json:"status"` + LeaderParts map[string][]nebula0.PartitionID `thrift:"leader_parts,3" db:"leader_parts" json:"leader_parts"` + AllParts map[string][]nebula0.PartitionID `thrift:"all_parts,4" db:"all_parts" json:"all_parts"` + Role HostRole `thrift:"role,5" db:"role" json:"role"` + GitInfoSha []byte `thrift:"git_info_sha,6" db:"git_info_sha" json:"git_info_sha"` + ZoneName []byte `thrift:"zone_name,7" db:"zone_name" json:"zone_name,omitempty"` + Version []byte `thrift:"version,8" db:"version" json:"version,omitempty"` +} + +func NewHostItem() *HostItem { + return &HostItem{ + HostAddr: nebula0.NewHostAddr(), + } +} + +var HostItem_HostAddr_DEFAULT *nebula0.HostAddr + +func (p *HostItem) GetHostAddr() *nebula0.HostAddr { + if !p.IsSetHostAddr() { + return HostItem_HostAddr_DEFAULT + } + return p.HostAddr +} + +func (p *HostItem) GetStatus() HostStatus { + return p.Status +} + +func (p *HostItem) GetLeaderParts() map[string][]nebula0.PartitionID { + return p.LeaderParts +} + +func (p *HostItem) GetAllParts() map[string][]nebula0.PartitionID { + return p.AllParts +} + +func (p *HostItem) GetRole() HostRole { + return p.Role +} + +func (p *HostItem) GetGitInfoSha() []byte { + return p.GitInfoSha +} + +var HostItem_ZoneName_DEFAULT []byte + +func (p *HostItem) GetZoneName() []byte { + return p.ZoneName +} + +var HostItem_Version_DEFAULT []byte + +func (p *HostItem) GetVersion() []byte { + return p.Version +} +func (p *HostItem) IsSetHostAddr() bool { + return p != nil && p.HostAddr != nil +} + +func (p *HostItem) IsSetZoneName() bool { + return p != nil && p.ZoneName != nil +} + +func (p *HostItem) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HostItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostItem) ReadField1(iprot thrift.Protocol) error { + p.HostAddr = nebula0.NewHostAddr() + if err := p.HostAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostAddr), err) + } + return nil +} + +func (p *HostItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := HostStatus(v) + p.Status = temp + } + return nil +} + +func (p *HostItem) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i++ { + var _key3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key3 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val4 := tSlice + for i := 0; i < size; i++ { + var _elem5 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem5 = temp + } + _val4 = append(_val4, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.AllParts = tMap + for i := 0; i < size; i++ { + var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key6 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val7 := tSlice + for i := 0; i < size; i++ { + var _elem8 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem8 = temp + } + _val7 = append(_val7, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.AllParts[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := HostRole(v) + p.Role = temp + } + return nil +} + +func (p *HostItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.GitInfoSha = v + } + return nil +} + +func (p *HostItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *HostItem) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.Version = v + } + return nil +} + +func (p *HostItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HostItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hostAddr", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hostAddr: ", p), err) + } + if err := p.HostAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostAddr: ", p), err) + } + return err +} + +func (p *HostItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *HostItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:leader_parts: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:leader_parts: ", p), err) + } + return err +} + +func (p *HostItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("all_parts", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:all_parts: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.AllParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.AllParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 4:all_parts: ", p), err) + } + return err +} + +func (p *HostItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:role: ", p), err) + } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:role: ", p), err) + } + return err +} + +func (p *HostItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:git_info_sha: ", p), err) + } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:git_info_sha: ", p), err) + } + return err +} + +func (p *HostItem) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetZoneName() { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_name: ", p), err) + } + } + return err +} + +func (p *HostItem) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:version: ", p), err) + } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:version: ", p), err) + } + } + return err +} + +func (p *HostItem) String() string { + if p == nil { + return "" + } + + var hostAddrVal string + if p.HostAddr == nil { + hostAddrVal = "" + } else { + hostAddrVal = fmt.Sprintf("%v", p.HostAddr) + } + statusVal := fmt.Sprintf("%v", p.Status) + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + allPartsVal := fmt.Sprintf("%v", p.AllParts) + roleVal := fmt.Sprintf("%v", p.Role) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HostItem({HostAddr:%s Status:%s LeaderParts:%s AllParts:%s Role:%s GitInfoSha:%s ZoneName:%s Version:%s})", hostAddrVal, statusVal, leaderPartsVal, allPartsVal, roleVal, gitInfoShaVal, zoneNameVal, versionVal) +} + +// Attributes: +// - Account +// - IsLock +// - MaxQueriesPerHour +// - MaxUpdatesPerHour +// - MaxConnectionsPerHour +// - MaxUserConnections +type UserItem struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IsLock bool `thrift:"is_lock,2" db:"is_lock" json:"is_lock"` + MaxQueriesPerHour int32 `thrift:"max_queries_per_hour,3" db:"max_queries_per_hour" json:"max_queries_per_hour"` + MaxUpdatesPerHour int32 `thrift:"max_updates_per_hour,4" db:"max_updates_per_hour" json:"max_updates_per_hour"` + MaxConnectionsPerHour int32 `thrift:"max_connections_per_hour,5" db:"max_connections_per_hour" json:"max_connections_per_hour"` + MaxUserConnections int32 `thrift:"max_user_connections,6" db:"max_user_connections" json:"max_user_connections"` +} + +func NewUserItem() *UserItem { + return &UserItem{} +} + +func (p *UserItem) GetAccount() []byte { + return p.Account +} + +func (p *UserItem) GetIsLock() bool { + return p.IsLock +} + +func (p *UserItem) GetMaxQueriesPerHour() int32 { + return p.MaxQueriesPerHour +} + +func (p *UserItem) GetMaxUpdatesPerHour() int32 { + return p.MaxUpdatesPerHour +} + +func (p *UserItem) GetMaxConnectionsPerHour() int32 { + return p.MaxConnectionsPerHour +} + +func (p *UserItem) GetMaxUserConnections() int32 { + return p.MaxUserConnections +} +func (p *UserItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UserItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *UserItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IsLock = v + } + return nil +} + +func (p *UserItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxQueriesPerHour = v + } + return nil +} + +func (p *UserItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.MaxUpdatesPerHour = v + } + return nil +} + +func (p *UserItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.MaxConnectionsPerHour = v + } + return nil +} + +func (p *UserItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.MaxUserConnections = v + } + return nil +} + +func (p *UserItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UserItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *UserItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *UserItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_lock", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_lock: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsLock)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_lock (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_lock: ", p), err) + } + return err +} + +func (p *UserItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_queries_per_hour", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_queries_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxQueriesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_queries_per_hour (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_queries_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_updates_per_hour", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_updates_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxUpdatesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_updates_per_hour (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_updates_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_connections_per_hour", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_connections_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxConnectionsPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_connections_per_hour (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_connections_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_user_connections", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:max_user_connections: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxUserConnections)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_user_connections (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_user_connections: ", p), err) + } + return err +} + +func (p *UserItem) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + isLockVal := fmt.Sprintf("%v", p.IsLock) + maxQueriesPerHourVal := fmt.Sprintf("%v", p.MaxQueriesPerHour) + maxUpdatesPerHourVal := fmt.Sprintf("%v", p.MaxUpdatesPerHour) + maxConnectionsPerHourVal := fmt.Sprintf("%v", p.MaxConnectionsPerHour) + maxUserConnectionsVal := fmt.Sprintf("%v", p.MaxUserConnections) + return fmt.Sprintf("UserItem({Account:%s IsLock:%s MaxQueriesPerHour:%s MaxUpdatesPerHour:%s MaxConnectionsPerHour:%s MaxUserConnections:%s})", accountVal, isLockVal, maxQueriesPerHourVal, maxUpdatesPerHourVal, maxConnectionsPerHourVal, maxUserConnectionsVal) +} + +// Attributes: +// - UserID +// - SpaceID +// - RoleType +type RoleItem struct { + UserID []byte `thrift:"user_id,1" db:"user_id" json:"user_id"` + SpaceID nebula0.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` + RoleType RoleType `thrift:"role_type,3" db:"role_type" json:"role_type"` +} + +func NewRoleItem() *RoleItem { + return &RoleItem{} +} + +func (p *RoleItem) GetUserID() []byte { + return p.UserID +} + +func (p *RoleItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RoleItem) GetRoleType() RoleType { + return p.RoleType +} +func (p *RoleItem) 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 *RoleItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.UserID = v + } + return nil +} + +func (p *RoleItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp + } + return nil +} + +func (p *RoleItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := RoleType(v) + p.RoleType = temp + } + return nil +} + +func (p *RoleItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RoleItem"); 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 *RoleItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user_id: ", p), err) + } + if err := oprot.WriteBinary(p.UserID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user_id: ", p), err) + } + return err +} + +func (p *RoleItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) + } + return err +} + +func (p *RoleItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.RoleType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role_type: ", p), err) + } + return err +} + +func (p *RoleItem) String() string { + if p == nil { + return "" + } + + userIDVal := fmt.Sprintf("%v", p.UserID) + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + roleTypeVal := fmt.Sprintf("%v", p.RoleType) + return fmt.Sprintf("RoleItem({UserID:%s SpaceID:%s RoleType:%s})", userIDVal, spaceIDVal, roleTypeVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +type ExecResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id *ID `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` +} + +func NewExecResp() *ExecResp { + return &ExecResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ExecResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ExecResp_Id_DEFAULT *ID + +func (p *ExecResp) GetId() *ID { + if !p.IsSetId() { + return ExecResp_Id_DEFAULT + } + return p.Id +} + +var ExecResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ExecResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ExecResp_Leader_DEFAULT + } + return p.Leader +} +func (p *ExecResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *ExecResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ExecResp) 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 *ExecResp) 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 *ExecResp) ReadField2(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *ExecResp) ReadField3(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 *ExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResp"); 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 *ExecResp) 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 *ExecResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + return err +} + +func (p *ExecResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) + } + return err +} + +func (p *ExecResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("ExecResp({Code:%s Id:%s Leader:%s})", codeVal, idVal, leaderVal) +} + +// Attributes: +// - Op +// - Cmd +// - Paras +type AdminJobReq struct { + Op AdminJobOp `thrift:"op,1" db:"op" json:"op"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` +} + +func NewAdminJobReq() *AdminJobReq { + return &AdminJobReq{} +} + +func (p *AdminJobReq) GetOp() AdminJobOp { + return p.Op +} + +func (p *AdminJobReq) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *AdminJobReq) GetParas() [][]byte { + return p.Paras +} +func (p *AdminJobReq) 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 *AdminJobReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := AdminJobOp(v) + p.Op = temp + } + return nil +} + +func (p *AdminJobReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := AdminCmd(v) + p.Cmd = temp + } + return nil +} + +func (p *AdminJobReq) ReadField3(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.Paras = tSlice + for i := 0; i < size; i++ { + var _elem9 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem9 = v + } + p.Paras = append(p.Paras, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobReq"); 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 *AdminJobReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) + } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) + } + return err +} + +func (p *AdminJobReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) + } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) + } + return err +} + +func (p *AdminJobReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) + } + return err +} + +func (p *AdminJobReq) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + return fmt.Sprintf("AdminJobReq({Op:%s Cmd:%s Paras:%s})", opVal, cmdVal, parasVal) +} + +// Attributes: +// - Id +// - Cmd +// - Paras +// - Status +// - StartTime +// - StopTime +type JobDesc struct { + Id int32 `thrift:"id,1" db:"id" json:"id"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras []string `thrift:"paras,3" db:"paras" json:"paras"` + Status JobStatus `thrift:"status,4" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,5" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,6" db:"stop_time" json:"stop_time"` +} + +func NewJobDesc() *JobDesc { + return &JobDesc{} +} + +func (p *JobDesc) GetId() int32 { + return p.Id +} + +func (p *JobDesc) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *JobDesc) GetParas() []string { + return p.Paras +} + +func (p *JobDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *JobDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *JobDesc) GetStopTime() int64 { + return p.StopTime +} +func (p *JobDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JobDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *JobDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := AdminCmd(v) + p.Cmd = temp + } + return nil +} + +func (p *JobDesc) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Paras = tSlice + for i := 0; i < size; i++ { + var _elem10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem10 = v + } + p.Paras = append(p.Paras, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *JobDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *JobDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *JobDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StopTime = v + } + return nil +} + +func (p *JobDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("JobDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *JobDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := oprot.WriteI32(int32(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *JobDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) + } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) + } + return err +} + +func (p *JobDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) + } + return err +} + +func (p *JobDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *JobDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) + } + return err +} + +func (p *JobDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:stop_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:stop_time: ", p), err) + } + return err +} + +func (p *JobDesc) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + return fmt.Sprintf("JobDesc({Id:%s Cmd:%s Paras:%s Status:%s StartTime:%s StopTime:%s})", idVal, cmdVal, parasVal, statusVal, startTimeVal, stopTimeVal) +} + +// Attributes: +// - TaskID +// - Host +// - Status +// - StartTime +// - StopTime +// - JobID +type TaskDesc struct { + TaskID int32 `thrift:"task_id,1" db:"task_id" json:"task_id"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + Status JobStatus `thrift:"status,3" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` + JobID int32 `thrift:"job_id,6" db:"job_id" json:"job_id"` +} + +func NewTaskDesc() *TaskDesc { + return &TaskDesc{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *TaskDesc) GetTaskID() int32 { + return p.TaskID +} + +var TaskDesc_Host_DEFAULT *nebula0.HostAddr + +func (p *TaskDesc) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return TaskDesc_Host_DEFAULT + } + return p.Host +} + +func (p *TaskDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *TaskDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *TaskDesc) GetStopTime() int64 { + return p.StopTime +} + +func (p *TaskDesc) GetJobID() int32 { + return p.JobID +} +func (p *TaskDesc) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *TaskDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TaskID = v + } + return nil +} + +func (p *TaskDesc) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *TaskDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *TaskDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *TaskDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.StopTime = v + } + return nil +} + +func (p *TaskDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.JobID = v + } + return nil +} + +func (p *TaskDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *TaskDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:task_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:task_id: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:start_time: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:stop_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stop_time: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:job_id: ", p), err) + } + return err +} + +func (p *TaskDesc) String() string { + if p == nil { + return "" + } + + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + jobIDVal := fmt.Sprintf("%v", p.JobID) + return fmt.Sprintf("TaskDesc({TaskID:%s Host:%s Status:%s StartTime:%s StopTime:%s JobID:%s})", taskIDVal, hostVal, statusVal, startTimeVal, stopTimeVal, jobIDVal) +} + +// Attributes: +// - JobID +// - JobDesc +// - TaskDesc +// - RecoveredJobNum +type AdminJobResult_ struct { + JobID *int32 `thrift:"job_id,1" db:"job_id" json:"job_id,omitempty"` + JobDesc []*JobDesc `thrift:"job_desc,2" db:"job_desc" json:"job_desc,omitempty"` + TaskDesc []*TaskDesc `thrift:"task_desc,3" db:"task_desc" json:"task_desc,omitempty"` + RecoveredJobNum *int32 `thrift:"recovered_job_num,4" db:"recovered_job_num" json:"recovered_job_num,omitempty"` +} + +func NewAdminJobResult_() *AdminJobResult_ { + return &AdminJobResult_{} +} + +var AdminJobResult__JobID_DEFAULT int32 + +func (p *AdminJobResult_) GetJobID() int32 { + if !p.IsSetJobID() { + return AdminJobResult__JobID_DEFAULT + } + return *p.JobID +} + +var AdminJobResult__JobDesc_DEFAULT []*JobDesc + +func (p *AdminJobResult_) GetJobDesc() []*JobDesc { + return p.JobDesc +} + +var AdminJobResult__TaskDesc_DEFAULT []*TaskDesc + +func (p *AdminJobResult_) GetTaskDesc() []*TaskDesc { + return p.TaskDesc +} + +var AdminJobResult__RecoveredJobNum_DEFAULT int32 + +func (p *AdminJobResult_) GetRecoveredJobNum() int32 { + if !p.IsSetRecoveredJobNum() { + return AdminJobResult__RecoveredJobNum_DEFAULT + } + return *p.RecoveredJobNum +} +func (p *AdminJobResult_) IsSetJobID() bool { + return p != nil && p.JobID != nil +} + +func (p *AdminJobResult_) IsSetJobDesc() bool { + return p != nil && p.JobDesc != nil +} + +func (p *AdminJobResult_) IsSetTaskDesc() bool { + return p != nil && p.TaskDesc != nil +} + +func (p *AdminJobResult_) IsSetRecoveredJobNum() bool { + return p != nil && p.RecoveredJobNum != nil +} + +func (p *AdminJobResult_) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResult_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.JobID = &v + } + return nil +} + +func (p *AdminJobResult_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*JobDesc, 0, size) + p.JobDesc = tSlice + for i := 0; i < size; i++ { + _elem11 := NewJobDesc() + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.JobDesc = append(p.JobDesc, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TaskDesc, 0, size) + p.TaskDesc = tSlice + for i := 0; i < size; i++ { + _elem12 := NewTaskDesc() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.TaskDesc = append(p.TaskDesc, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RecoveredJobNum = &v + } + return nil +} + +func (p *AdminJobResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResult"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminJobResult_) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetJobID() { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetJobDesc() { + if err := oprot.WriteFieldBegin("job_desc", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_desc: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.JobDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.JobDesc { + 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:job_desc: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskDesc() { + if err := oprot.WriteFieldBegin("task_desc", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_desc: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TaskDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskDesc { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_desc: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetRecoveredJobNum() { + if err := oprot.WriteFieldBegin("recovered_job_num", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:recovered_job_num: ", p), err) + } + if err := oprot.WriteI32(int32(*p.RecoveredJobNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.recovered_job_num (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:recovered_job_num: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) String() string { + if p == nil { + return "" + } + + var jobIDVal string + if p.JobID == nil { + jobIDVal = "" + } else { + jobIDVal = fmt.Sprintf("%v", *p.JobID) + } + jobDescVal := fmt.Sprintf("%v", p.JobDesc) + taskDescVal := fmt.Sprintf("%v", p.TaskDesc) + var recoveredJobNumVal string + if p.RecoveredJobNum == nil { + recoveredJobNumVal = "" + } else { + recoveredJobNumVal = fmt.Sprintf("%v", *p.RecoveredJobNum) + } + return fmt.Sprintf("AdminJobResult_({JobID:%s JobDesc:%s TaskDesc:%s RecoveredJobNum:%s})", jobIDVal, jobDescVal, taskDescVal, recoveredJobNumVal) +} + +// Attributes: +// - Code +// - Leader +// - Result_ +type AdminJobResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Result_ *AdminJobResult_ `thrift:"result,3" db:"result" json:"result"` +} + +func NewAdminJobResp() *AdminJobResp { + return &AdminJobResp{ + Leader: nebula0.NewHostAddr(), + Result_: NewAdminJobResult_(), + } +} + +func (p *AdminJobResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var AdminJobResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *AdminJobResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return AdminJobResp_Leader_DEFAULT + } + return p.Leader +} + +var AdminJobResp_Result__DEFAULT *AdminJobResult_ + +func (p *AdminJobResp) GetResult_() *AdminJobResult_ { + if !p.IsSetResult_() { + return AdminJobResp_Result__DEFAULT + } + return p.Result_ +} +func (p *AdminJobResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *AdminJobResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) ReadField3(iprot thrift.Protocol) error { + p.Result_ = NewAdminJobResult_() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminJobResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResp"); 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:result: ", p), err) + } + return err +} + +func (p *AdminJobResp) 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) + } + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("AdminJobResp({Code:%s Leader:%s Result_:%s})", codeVal, leaderVal, resultVal) +} + +// Attributes: +// - PartID +// - Proportion +type Correlativity struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Proportion float64 `thrift:"proportion,2" db:"proportion" json:"proportion"` +} + +func NewCorrelativity() *Correlativity { + return &Correlativity{} +} + +func (p *Correlativity) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *Correlativity) GetProportion() float64 { + return p.Proportion +} +func (p *Correlativity) 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 *Correlativity) 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 *Correlativity) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Proportion = v + } + return nil +} + +func (p *Correlativity) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Correlativity"); 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 *Correlativity) 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 *Correlativity) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("proportion", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:proportion: ", p), err) + } + if err := oprot.WriteDouble(float64(p.Proportion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.proportion (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:proportion: ", p), err) + } + return err +} + +func (p *Correlativity) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + proportionVal := fmt.Sprintf("%v", p.Proportion) + return fmt.Sprintf("Correlativity({PartID:%s Proportion:%s})", partIDVal, proportionVal) +} + +// Attributes: +// - TagVertices +// - Edges +// - SpaceVertices +// - SpaceEdges +// - PositivePartCorrelativity +// - NegativePartCorrelativity +// - Status +type StatisItem struct { + TagVertices map[string]int64 `thrift:"tag_vertices,1" db:"tag_vertices" json:"tag_vertices"` + Edges map[string]int64 `thrift:"edges,2" db:"edges" json:"edges"` + SpaceVertices int64 `thrift:"space_vertices,3" db:"space_vertices" json:"space_vertices"` + SpaceEdges int64 `thrift:"space_edges,4" db:"space_edges" json:"space_edges"` + PositivePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"positive_part_correlativity,5" db:"positive_part_correlativity" json:"positive_part_correlativity"` + NegativePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"negative_part_correlativity,6" db:"negative_part_correlativity" json:"negative_part_correlativity"` + Status JobStatus `thrift:"status,7" db:"status" json:"status"` +} + +func NewStatisItem() *StatisItem { + return &StatisItem{} +} + +func (p *StatisItem) GetTagVertices() map[string]int64 { + return p.TagVertices +} + +func (p *StatisItem) GetEdges() map[string]int64 { + return p.Edges +} + +func (p *StatisItem) GetSpaceVertices() int64 { + return p.SpaceVertices +} + +func (p *StatisItem) GetSpaceEdges() int64 { + return p.SpaceEdges +} + +func (p *StatisItem) GetPositivePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.PositivePartCorrelativity +} + +func (p *StatisItem) GetNegativePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.NegativePartCorrelativity +} + +func (p *StatisItem) GetStatus() JobStatus { + return p.Status +} +func (p *StatisItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatisItem) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.TagVertices = tMap + for i := 0; i < size; i++ { + var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key13 = v + } + var _val14 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val14 = v + } + p.TagVertices[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.Edges = tMap + for i := 0; i < size; i++ { + var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key15 = v + } + var _val16 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val16 = v + } + p.Edges[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SpaceVertices = v + } + return nil +} + +func (p *StatisItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SpaceEdges = v + } + return nil +} + +func (p *StatisItem) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.PositivePartCorrelativity = tMap + for i := 0; i < size; i++ { + var _key17 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key17 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val18 := tSlice + for i := 0; i < size; i++ { + _elem19 := NewCorrelativity() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + _val18 = append(_val18, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PositivePartCorrelativity[_key17] = _val18 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.NegativePartCorrelativity = tMap + for i := 0; i < size; i++ { + var _key20 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key20 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val21 := tSlice + for i := 0; i < size; i++ { + _elem22 := NewCorrelativity() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + _val21 = append(_val21, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.NegativePartCorrelativity[_key20] = _val21 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *StatisItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatisItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *StatisItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_vertices", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_vertices: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.TagVertices)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.TagVertices { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_vertices: ", p), err) + } + return err +} + +func (p *StatisItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edges: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.Edges)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Edges { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edges: ", p), err) + } + return err +} + +func (p *StatisItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_vertices", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:space_vertices: ", p), err) + } + if err := oprot.WriteI64(int64(p.SpaceVertices)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_vertices (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:space_vertices: ", p), err) + } + return err +} + +func (p *StatisItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_edges", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_edges: ", p), err) + } + if err := oprot.WriteI64(int64(p.SpaceEdges)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_edges (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_edges: ", p), err) + } + return err +} + +func (p *StatisItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("positive_part_correlativity", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:positive_part_correlativity: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PositivePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PositivePartCorrelativity { + 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 5:positive_part_correlativity: ", p), err) + } + return err +} + +func (p *StatisItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("negative_part_correlativity", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:negative_part_correlativity: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.NegativePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NegativePartCorrelativity { + 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 6:negative_part_correlativity: ", p), err) + } + return err +} + +func (p *StatisItem) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:status: ", p), err) + } + return err +} + +func (p *StatisItem) String() string { + if p == nil { + return "" + } + + tagVerticesVal := fmt.Sprintf("%v", p.TagVertices) + edgesVal := fmt.Sprintf("%v", p.Edges) + spaceVerticesVal := fmt.Sprintf("%v", p.SpaceVertices) + spaceEdgesVal := fmt.Sprintf("%v", p.SpaceEdges) + positivePartCorrelativityVal := fmt.Sprintf("%v", p.PositivePartCorrelativity) + negativePartCorrelativityVal := fmt.Sprintf("%v", p.NegativePartCorrelativity) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("StatisItem({TagVertices:%s Edges:%s SpaceVertices:%s SpaceEdges:%s PositivePartCorrelativity:%s NegativePartCorrelativity:%s Status:%s})", tagVerticesVal, edgesVal, spaceVerticesVal, spaceEdgesVal, positivePartCorrelativityVal, negativePartCorrelativityVal, statusVal) +} + +// Attributes: +// - Properties +// - IfNotExists +type CreateSpaceReq struct { + Properties *SpaceDesc `thrift:"properties,1" db:"properties" json:"properties"` + IfNotExists bool `thrift:"if_not_exists,2" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateSpaceReq() *CreateSpaceReq { + return &CreateSpaceReq{ + Properties: NewSpaceDesc(), + } +} + +var CreateSpaceReq_Properties_DEFAULT *SpaceDesc + +func (p *CreateSpaceReq) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return CreateSpaceReq_Properties_DEFAULT + } + return p.Properties +} + +func (p *CreateSpaceReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateSpaceReq) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *CreateSpaceReq) 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 *CreateSpaceReq) ReadField1(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSpaceReq"); 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 *CreateSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:properties: ", p), err) + } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:properties: ", p), err) + } + return err +} + +func (p *CreateSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateSpaceReq) String() string { + if p == nil { + return "" + } + + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateSpaceReq({Properties:%s IfNotExists:%s})", propertiesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceName +// - IfExists +type DropSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropSpaceReq() *DropSpaceReq { + return &DropSpaceReq{} +} + +func (p *DropSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *DropSpaceReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropSpaceReq) 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 *DropSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *DropSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSpaceReq"); 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 *DropSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *DropSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) + } + return err +} + +func (p *DropSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropSpaceReq({SpaceName:%s IfExists:%s})", spaceNameVal, ifExistsVal) +} + +type ListSpacesReq struct { +} + +func NewListSpacesReq() *ListSpacesReq { + return &ListSpacesReq{} +} + +func (p *ListSpacesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSpacesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSpacesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Spaces +type ListSpacesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Spaces []*IdName `thrift:"spaces,3" db:"spaces" json:"spaces"` +} + +func NewListSpacesResp() *ListSpacesResp { + return &ListSpacesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSpacesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSpacesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSpacesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSpacesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSpacesResp) GetSpaces() []*IdName { + return p.Spaces +} +func (p *ListSpacesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IdName, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i++ { + _elem23 := NewIdName() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Spaces = append(p.Spaces, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSpacesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesResp"); 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spaces: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spaces: ", p), err) + } + return err +} + +func (p *ListSpacesResp) 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) + } + spacesVal := fmt.Sprintf("%v", p.Spaces) + return fmt.Sprintf("ListSpacesResp({Code:%s Leader:%s Spaces:%s})", codeVal, leaderVal, spacesVal) +} + +// Attributes: +// - SpaceName +type GetSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` +} + +func NewGetSpaceReq() *GetSpaceReq { + return &GetSpaceReq{} +} + +func (p *GetSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} +func (p *GetSpaceReq) 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 *GetSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *GetSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceReq"); 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 *GetSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *GetSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + return fmt.Sprintf("GetSpaceReq({SpaceName:%s})", spaceNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetSpaceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *SpaceItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetSpaceResp() *GetSpaceResp { + return &GetSpaceResp{ + Leader: nebula0.NewHostAddr(), + Item: NewSpaceItem(), + } +} + +func (p *GetSpaceResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetSpaceResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetSpaceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSpaceResp_Leader_DEFAULT + } + return p.Leader +} + +var GetSpaceResp_Item_DEFAULT *SpaceItem + +func (p *GetSpaceResp) GetItem() *SpaceItem { + if !p.IsSetItem() { + return GetSpaceResp_Item_DEFAULT + } + return p.Item +} +func (p *GetSpaceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSpaceResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewSpaceItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetSpaceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceResp"); 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetSpaceResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetSpaceResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Schema +// - IfNotExists +type CreateTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateTagReq() *CreateTagReq { + return &CreateTagReq{ + Schema: NewSchema(), + } +} + +func (p *CreateTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagReq) GetTagName() []byte { + return p.TagName +} + +var CreateTagReq_Schema_DEFAULT *Schema + +func (p *CreateTagReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateTagReq_Schema_DEFAULT + } + return p.Schema +} + +func (p *CreateTagReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateTagReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *CreateTagReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateTagReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *CreateTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *CreateTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateTagReq({SpaceID:%s TagName:%s Schema:%s IfNotExists:%s})", spaceIDVal, tagNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - TagItems +// - SchemaProp +type AlterTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + TagItems []*AlterSchemaItem `thrift:"tag_items,3" db:"tag_items" json:"tag_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterTagReq() *AlterTagReq { + return &AlterTagReq{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *AlterTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *AlterTagReq) GetTagItems() []*AlterSchemaItem { + return p.TagItems +} + +var AlterTagReq_SchemaProp_DEFAULT *SchemaProp + +func (p *AlterTagReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterTagReq_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *AlterTagReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *AlterTagReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.TagItems = tSlice + for i := 0; i < size; i++ { + _elem24 := NewAlterSchemaItem() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + } + p.TagItems = append(p.TagItems, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterTagReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *AlterTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TagItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TagItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_items: ", p), err) + } + return err +} + +func (p *AlterTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) + } + return err +} + +func (p *AlterTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + tagItemsVal := fmt.Sprintf("%v", p.TagItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterTagReq({SpaceID:%s TagName:%s TagItems:%s SchemaProp:%s})", spaceIDVal, tagNameVal, tagItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - IfExists +type DropTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagReq() *DropTagReq { + return &DropTagReq{} +} + +func (p *DropTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *DropTagReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagReq) 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 *DropTagReq) 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 *DropTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *DropTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagReq"); 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 *DropTagReq) 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 *DropTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *DropTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagReq({SpaceID:%s TagName:%s IfExists:%s})", spaceIDVal, tagNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListTagsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagsReq() *ListTagsReq { + return &ListTagsReq{} +} + +func (p *ListTagsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagsReq) 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 *ListTagsReq) 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 *ListTagsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsReq"); 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 *ListTagsReq) 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 *ListTagsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagsReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Tags +type ListTagsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Tags []*TagItem `thrift:"tags,3" db:"tags" json:"tags"` +} + +func NewListTagsResp() *ListTagsResp { + return &ListTagsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListTagsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListTagsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListTagsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListTagsResp) GetTags() []*TagItem { + return p.Tags +} +func (p *ListTagsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TagItem, 0, size) + p.Tags = tSlice + for i := 0; i < size; i++ { + _elem25 := NewTagItem() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + } + p.Tags = append(p.Tags, _elem25) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsResp"); 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tags: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tags: ", p), err) + } + return err +} + +func (p *ListTagsResp) 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) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("ListTagsResp({Code:%s Leader:%s Tags:%s})", codeVal, leaderVal, tagsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Version +type GetTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetTagReq() *GetTagReq { + return &GetTagReq{} +} + +func (p *GetTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *GetTagReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetTagReq) 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 *GetTagReq) 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 *GetTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *GetTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *GetTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagReq"); 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 *GetTagReq) 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 *GetTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *GetTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *GetTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetTagReq({SpaceID:%s TagName:%s Version:%s})", spaceIDVal, tagNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetTagResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetTagResp() *GetTagResp { + return &GetTagResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + +func (p *GetTagResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetTagResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetTagResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagResp_Leader_DEFAULT + } + return p.Leader +} + +var GetTagResp_Schema_DEFAULT *Schema + +func (p *GetTagResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetTagResp_Schema_DEFAULT + } + return p.Schema +} +func (p *GetTagResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetTagResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagResp"); 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *GetTagResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetTagResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Schema +// - IfNotExists +type CreateEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateEdgeReq() *CreateEdgeReq { + return &CreateEdgeReq{ + Schema: NewSchema(), + } +} + +func (p *CreateEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +var CreateEdgeReq_Schema_DEFAULT *Schema + +func (p *CreateEdgeReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateEdgeReq_Schema_DEFAULT + } + return p.Schema +} + +func (p *CreateEdgeReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateEdgeReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *CreateEdgeReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateEdgeReq({SpaceID:%s EdgeName:%s Schema:%s IfNotExists:%s})", spaceIDVal, edgeNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - EdgeItems +// - SchemaProp +type AlterEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + EdgeItems []*AlterSchemaItem `thrift:"edge_items,3" db:"edge_items" json:"edge_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterEdgeReq() *AlterEdgeReq { + return &AlterEdgeReq{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *AlterEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *AlterEdgeReq) GetEdgeItems() []*AlterSchemaItem { + return p.EdgeItems +} + +var AlterEdgeReq_SchemaProp_DEFAULT *SchemaProp + +func (p *AlterEdgeReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterEdgeReq_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *AlterEdgeReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *AlterEdgeReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.EdgeItems = tSlice + for i := 0; i < size; i++ { + _elem26 := NewAlterSchemaItem() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + } + p.EdgeItems = append(p.EdgeItems, _elem26) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_items: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + edgeItemsVal := fmt.Sprintf("%v", p.EdgeItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterEdgeReq({SpaceID:%s EdgeName:%s EdgeItems:%s SchemaProp:%s})", spaceIDVal, edgeNameVal, edgeItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Version +type GetEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetEdgeReq() *GetEdgeReq { + return &GetEdgeReq{} +} + +func (p *GetEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *GetEdgeReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetEdgeReq) 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 *GetEdgeReq) 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 *GetEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *GetEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *GetEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeReq"); 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 *GetEdgeReq) 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 *GetEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *GetEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *GetEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetEdgeReq({SpaceID:%s EdgeName:%s Version:%s})", spaceIDVal, edgeNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetEdgeResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetEdgeResp() *GetEdgeResp { + return &GetEdgeResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + +func (p *GetEdgeResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetEdgeResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetEdgeResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeResp_Leader_DEFAULT + } + return p.Leader +} + +var GetEdgeResp_Schema_DEFAULT *Schema + +func (p *GetEdgeResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetEdgeResp_Schema_DEFAULT + } + return p.Schema +} +func (p *GetEdgeResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetEdgeResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeResp"); 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *GetEdgeResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetEdgeResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - IfExists +type DropEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeReq() *DropEdgeReq { + return &DropEdgeReq{} +} + +func (p *DropEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *DropEdgeReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeReq) 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 *DropEdgeReq) 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 *DropEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *DropEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeReq"); 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 *DropEdgeReq) 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 *DropEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *DropEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeReq({SpaceID:%s EdgeName:%s IfExists:%s})", spaceIDVal, edgeNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListEdgesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgesReq() *ListEdgesReq { + return &ListEdgesReq{} +} + +func (p *ListEdgesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgesReq) 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 *ListEdgesReq) 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 *ListEdgesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesReq"); 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 *ListEdgesReq) 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 *ListEdgesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Edges +type ListEdgesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Edges []*EdgeItem `thrift:"edges,3" db:"edges" json:"edges"` +} + +func NewListEdgesResp() *ListEdgesResp { + return &ListEdgesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListEdgesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListEdgesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListEdgesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListEdgesResp) GetEdges() []*EdgeItem { + return p.Edges +} +func (p *ListEdgesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeItem, 0, size) + p.Edges = tSlice + for i := 0; i < size; i++ { + _elem27 := NewEdgeItem() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + p.Edges = append(p.Edges, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesResp"); 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 *ListEdgesResp) 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 *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) + } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) + } + return err +} + +func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edges: ", p), err) + } + return err +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + edgesVal := fmt.Sprintf("%v", p.Edges) + return fmt.Sprintf("ListEdgesResp({Code:%s Leader:%s Edges:%s})", codeVal, leaderVal, edgesVal) +} + +// Attributes: +// - Type +type ListHostsReq struct { + Type ListHostType `thrift:"type,1" db:"type" json:"type"` +} + +func NewListHostsReq() *ListHostsReq { + return &ListHostsReq{} +} + +func (p *ListHostsReq) GetType() ListHostType { + return p.Type +} +func (p *ListHostsReq) 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 *ListHostsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ListHostType(v) + p.Type = temp + } + return nil +} + +func (p *ListHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsReq"); 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 *ListHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ListHostsReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("ListHostsReq({Type:%s})", typeVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type ListHostsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*HostItem `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewListHostsResp() *ListHostsResp { + return &ListHostsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListHostsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListHostsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListHostsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListHostsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListHostsResp) GetHosts() []*HostItem { + return p.Hosts +} +func (p *ListHostsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostItem, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i++ { + _elem28 := NewHostItem() + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + } + p.Hosts = append(p.Hosts, _elem28) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListHostsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsResp"); 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *ListHostsResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("ListHostsResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +// Attributes: +// - PartID +// - Leader +// - Peers +// - Losts +type PartItem struct { + PartID nebula0.PartitionID `thrift:"part_id,1,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader,omitempty"` + Peers []*nebula0.HostAddr `thrift:"peers,3,required" db:"peers" json:"peers"` + Losts []*nebula0.HostAddr `thrift:"losts,4,required" db:"losts" json:"losts"` +} + +func NewPartItem() *PartItem { + return &PartItem{} +} + +func (p *PartItem) GetPartID() nebula0.PartitionID { + return p.PartID +} + +var PartItem_Leader_DEFAULT *nebula0.HostAddr + +func (p *PartItem) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartItem_Leader_DEFAULT + } + return p.Leader +} + +func (p *PartItem) GetPeers() []*nebula0.HostAddr { + return p.Peers +} + +func (p *PartItem) GetLosts() []*nebula0.HostAddr { + return p.Losts +} +func (p *PartItem) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPartID bool = false + var issetPeers bool = false + var issetLosts 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 + } + issetPartID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetPeers = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetLosts = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPartID { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")) + } + if !issetPeers { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Peers is not set")) + } + if !issetLosts { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Losts is not set")) + } + return nil +} + +func (p *PartItem) 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 *PartItem) 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 *PartItem) ReadField3(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.Peers = tSlice + for i := 0; i < size; i++ { + _elem29 := nebula0.NewHostAddr() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.Peers = append(p.Peers, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) ReadField4(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.Losts = tSlice + for i := 0; i < size; i++ { + _elem30 := nebula0.NewHostAddr() + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.Losts = append(p.Losts, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *PartItem) 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 *PartItem) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + 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 *PartItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) + } + return err +} + +func (p *PartItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("losts", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:losts: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Losts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Losts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:losts: ", p), err) + } + return err +} + +func (p *PartItem) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + peersVal := fmt.Sprintf("%v", p.Peers) + lostsVal := fmt.Sprintf("%v", p.Losts) + return fmt.Sprintf("PartItem({PartID:%s Leader:%s Peers:%s Losts:%s})", partIDVal, leaderVal, peersVal, lostsVal) +} + +// Attributes: +// - SpaceID +// - PartIds +type ListPartsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartIds []nebula0.PartitionID `thrift:"part_ids,2" db:"part_ids" json:"part_ids"` +} + +func NewListPartsReq() *ListPartsReq { + return &ListPartsReq{} +} + +func (p *ListPartsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ListPartsReq) GetPartIds() []nebula0.PartitionID { + return p.PartIds +} +func (p *ListPartsReq) 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 *ListPartsReq) 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 *ListPartsReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.PartIds = tSlice + for i := 0; i < size; i++ { + var _elem31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem31 = temp + } + p.PartIds = append(p.PartIds, _elem31) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsReq"); 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 *ListPartsReq) 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 *ListPartsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_ids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_ids: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_ids: ", p), err) + } + return err +} + +func (p *ListPartsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIdsVal := fmt.Sprintf("%v", p.PartIds) + return fmt.Sprintf("ListPartsReq({SpaceID:%s PartIds:%s})", spaceIDVal, partIdsVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +type ListPartsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts []*PartItem `thrift:"parts,3" db:"parts" json:"parts"` +} + +func NewListPartsResp() *ListPartsResp { + return &ListPartsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListPartsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListPartsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListPartsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListPartsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListPartsResp) GetParts() []*PartItem { + return p.Parts +} +func (p *ListPartsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartItem, 0, size) + p.Parts = tSlice + for i := 0; i < size; i++ { + _elem32 := NewPartItem() + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + } + p.Parts = append(p.Parts, _elem32) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsResp"); 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) + } + return err +} + +func (p *ListPartsResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("ListPartsResp({Code:%s Leader:%s Parts:%s})", codeVal, leaderVal, partsVal) +} + +// Attributes: +// - SpaceID +type GetPartsAllocReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetPartsAllocReq() *GetPartsAllocReq { + return &GetPartsAllocReq{} +} + +func (p *GetPartsAllocReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetPartsAllocReq) 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocReq"); 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetPartsAllocReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +// - Terms +type GetPartsAllocResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts map[nebula0.PartitionID][]*nebula0.HostAddr `thrift:"parts,3" db:"parts" json:"parts"` + Terms map[nebula0.PartitionID]int64 `thrift:"terms,4" db:"terms" json:"terms,omitempty"` +} + +func NewGetPartsAllocResp() *GetPartsAllocResp { + return &GetPartsAllocResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetPartsAllocResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetPartsAllocResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetPartsAllocResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetPartsAllocResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetPartsAllocResp) GetParts() map[nebula0.PartitionID][]*nebula0.HostAddr { + return p.Parts +} + +var GetPartsAllocResp_Terms_DEFAULT map[nebula0.PartitionID]int64 + +func (p *GetPartsAllocResp) GetTerms() map[nebula0.PartitionID]int64 { + return p.Terms +} +func (p *GetPartsAllocResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetPartsAllocResp) IsSetTerms() bool { + return p != nil && p.Terms != nil +} + +func (p *GetPartsAllocResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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.HostAddr, size) + p.Parts = tMap + for i := 0; i < size; i++ { + var _key33 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key33 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + _val34 := tSlice + for i := 0; i < size; i++ { + _elem35 := nebula0.NewHostAddr() + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + _val34 = append(_val34, _elem35) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key33] = _val34 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID]int64, size) + p.Terms = tMap + for i := 0; i < size; i++ { + var _key36 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key36 = temp + } + var _val37 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val37 = v + } + p.Terms[_key36] = _val37 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTerms() { + if err := oprot.WriteFieldBegin("terms", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:terms: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I64, len(p.Terms)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Terms { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:terms: ", p), err) + } + } + return err +} + +func (p *GetPartsAllocResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + termsVal := fmt.Sprintf("%v", p.Terms) + return fmt.Sprintf("GetPartsAllocResp({Code:%s Leader:%s Parts:%s Terms:%s})", codeVal, leaderVal, partsVal, termsVal) +} + +// Attributes: +// - Segment +// - Pairs +type MultiPutReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Pairs []*nebula0.KeyValue `thrift:"pairs,2" db:"pairs" json:"pairs"` +} + +func NewMultiPutReq() *MultiPutReq { + return &MultiPutReq{} +} + +func (p *MultiPutReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiPutReq) GetPairs() []*nebula0.KeyValue { + return p.Pairs +} +func (p *MultiPutReq) 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 *MultiPutReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *MultiPutReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + p.Pairs = tSlice + for i := 0; i < size; i++ { + _elem38 := nebula0.NewKeyValue() + if err := _elem38.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + } + p.Pairs = append(p.Pairs, _elem38) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiPutReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiPutReq"); 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 *MultiPutReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *MultiPutReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("pairs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pairs: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Pairs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Pairs { + 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:pairs: ", p), err) + } + return err +} + +func (p *MultiPutReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + pairsVal := fmt.Sprintf("%v", p.Pairs) + return fmt.Sprintf("MultiPutReq({Segment:%s Pairs:%s})", segmentVal, pairsVal) +} + +// Attributes: +// - Segment +// - Key +type GetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewGetReq() *GetReq { + return &GetReq{} +} + +func (p *GetReq) GetSegment() []byte { + return p.Segment +} + +func (p *GetReq) GetKey() []byte { + return p.Key +} +func (p *GetReq) 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 *GetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *GetReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *GetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetReq"); 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 *GetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *GetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) + } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) + } + return err +} + +func (p *GetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("GetReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Code +// - Leader +// - Value +type GetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Value []byte `thrift:"value,3" db:"value" json:"value"` +} + +func NewGetResp() *GetResp { + return &GetResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetResp) GetValue() []byte { + return p.Value +} +func (p *GetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetResp) 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 *GetResp) 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 *GetResp) 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 *GetResp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Value = v + } + return nil +} + +func (p *GetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetResp"); 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 *GetResp) 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 *GetResp) 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 *GetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) + } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) + } + return err +} + +func (p *GetResp) 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) + } + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("GetResp({Code:%s Leader:%s Value:%s})", codeVal, leaderVal, valueVal) +} + +// Attributes: +// - Segment +// - Keys +type MultiGetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Keys [][]byte `thrift:"keys,2" db:"keys" json:"keys"` +} + +func NewMultiGetReq() *MultiGetReq { + return &MultiGetReq{} +} + +func (p *MultiGetReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiGetReq) GetKeys() [][]byte { + return p.Keys +} +func (p *MultiGetReq) 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 *MultiGetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *MultiGetReq) 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.Keys = tSlice + for i := 0; i < size; i++ { + var _elem39 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem39 = v + } + p.Keys = append(p.Keys, _elem39) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetReq"); 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 *MultiGetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *MultiGetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.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:keys: ", p), err) + } + return err +} + +func (p *MultiGetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keysVal := fmt.Sprintf("%v", p.Keys) + return fmt.Sprintf("MultiGetReq({Segment:%s Keys:%s})", segmentVal, keysVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type MultiGetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewMultiGetResp() *MultiGetResp { + return &MultiGetResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *MultiGetResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var MultiGetResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *MultiGetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return MultiGetResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *MultiGetResp) GetValues() [][]byte { + return p.Values +} +func (p *MultiGetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i++ { + var _elem40 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem40 = v + } + p.Values = append(p.Values, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetResp"); 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) + } + return err +} + +func (p *MultiGetResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("MultiGetResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Segment +// - Key +type RemoveReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewRemoveReq() *RemoveReq { + return &RemoveReq{} +} + +func (p *RemoveReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveReq) GetKey() []byte { + return p.Key +} +func (p *RemoveReq) 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 *RemoveReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *RemoveReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *RemoveReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveReq"); 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 *RemoveReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *RemoveReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) + } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) + } + return err +} + +func (p *RemoveReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("RemoveReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type RemoveRangeReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewRemoveRangeReq() *RemoveRangeReq { + return &RemoveRangeReq{} +} + +func (p *RemoveRangeReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveRangeReq) GetStart() []byte { + return p.Start +} + +func (p *RemoveRangeReq) GetEnd() []byte { + return p.End +} +func (p *RemoveRangeReq) 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 *RemoveRangeReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *RemoveRangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Start = v + } + return nil +} + +func (p *RemoveRangeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.End = v + } + return nil +} + +func (p *RemoveRangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveRangeReq"); 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 *RemoveRangeReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) + } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) + } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("RemoveRangeReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type ScanReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewScanReq() *ScanReq { + return &ScanReq{} +} + +func (p *ScanReq) GetSegment() []byte { + return p.Segment +} + +func (p *ScanReq) GetStart() []byte { + return p.Start +} + +func (p *ScanReq) GetEnd() []byte { + return p.End +} +func (p *ScanReq) 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 *ScanReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *ScanReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Start = v + } + return nil +} + +func (p *ScanReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.End = v + } + return nil +} + +func (p *ScanReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanReq"); 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 *ScanReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *ScanReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) + } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) + } + return err +} + +func (p *ScanReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) + } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) + } + return err +} + +func (p *ScanReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("ScanReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type ScanResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewScanResp() *ScanResp { + return &ScanResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ScanResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ScanResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ScanResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ScanResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ScanResp) GetValues() [][]byte { + return p.Values +} +func (p *ScanResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ScanResp) 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i++ { + var _elem41 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem41 = v + } + p.Values = append(p.Values, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanResp"); 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) + } + return err +} + +func (p *ScanResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("ScanResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Code +// - Leader +// - ClusterID +// - LastUpdateTimeInMs +type HBResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LastUpdateTimeInMs int64 `thrift:"last_update_time_in_ms,4" db:"last_update_time_in_ms" json:"last_update_time_in_ms"` +} + +func NewHBResp() *HBResp { + return &HBResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *HBResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var HBResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *HBResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return HBResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *HBResp) GetClusterID() ClusterID { + return p.ClusterID +} + +func (p *HBResp) GetLastUpdateTimeInMs() int64 { + return p.LastUpdateTimeInMs +} +func (p *HBResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *HBResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) 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 *HBResp) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.LastUpdateTimeInMs = v + } + return nil +} + +func (p *HBResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("last_update_time_in_ms", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:last_update_time_in_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastUpdateTimeInMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_update_time_in_ms (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:last_update_time_in_ms: ", p), err) + } + return err +} + +func (p *HBResp) 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) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + lastUpdateTimeInMsVal := fmt.Sprintf("%v", p.LastUpdateTimeInMs) + return fmt.Sprintf("HBResp({Code:%s Leader:%s ClusterID:%s LastUpdateTimeInMs:%s})", codeVal, leaderVal, clusterIDVal, lastUpdateTimeInMsVal) +} + +// Attributes: +// - PartID +// - Term +type LeaderInfo struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Term int64 `thrift:"term,2" db:"term" json:"term"` +} + +func NewLeaderInfo() *LeaderInfo { + return &LeaderInfo{} +} + +func (p *LeaderInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *LeaderInfo) GetTerm() int64 { + return p.Term +} +func (p *LeaderInfo) 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 *LeaderInfo) 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 *LeaderInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Term = v + } + return nil +} + +func (p *LeaderInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderInfo"); 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 *LeaderInfo) 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 *LeaderInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) + } + if err := oprot.WriteI64(int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) + } + return err +} + +func (p *LeaderInfo) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + termVal := fmt.Sprintf("%v", p.Term) + return fmt.Sprintf("LeaderInfo({PartID:%s Term:%s})", partIDVal, termVal) +} + +// Attributes: +// - Role +// - Host +// - ClusterID +// - LeaderPartIds +// - GitInfoSha +// - Version +type HBReq struct { + Role HostRole `thrift:"role,1" db:"role" json:"role"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LeaderPartIds map[nebula0.GraphSpaceID][]*LeaderInfo `thrift:"leader_partIds,4" db:"leader_partIds" json:"leader_partIds,omitempty"` + GitInfoSha []byte `thrift:"git_info_sha,5" db:"git_info_sha" json:"git_info_sha"` + Version []byte `thrift:"version,6" db:"version" json:"version,omitempty"` +} + +func NewHBReq() *HBReq { + return &HBReq{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *HBReq) GetRole() HostRole { + return p.Role +} + +var HBReq_Host_DEFAULT *nebula0.HostAddr + +func (p *HBReq) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return HBReq_Host_DEFAULT + } + return p.Host +} + +func (p *HBReq) GetClusterID() ClusterID { + return p.ClusterID +} + +var HBReq_LeaderPartIds_DEFAULT map[nebula0.GraphSpaceID][]*LeaderInfo + +func (p *HBReq) GetLeaderPartIds() map[nebula0.GraphSpaceID][]*LeaderInfo { + return p.LeaderPartIds +} + +func (p *HBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} + +var HBReq_Version_DEFAULT []byte + +func (p *HBReq) GetVersion() []byte { + return p.Version +} +func (p *HBReq) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *HBReq) IsSetLeaderPartIds() bool { + return p != nil && p.LeaderPartIds != nil +} + +func (p *HBReq) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HBReq) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := HostRole(v) + p.Role = temp + } + return nil +} + +func (p *HBReq) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HBReq) 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 *HBReq) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]*LeaderInfo, size) + p.LeaderPartIds = tMap + for i := 0; i < size; i++ { + var _key42 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + _key42 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*LeaderInfo, 0, size) + _val43 := tSlice + for i := 0; i < size; i++ { + _elem44 := NewLeaderInfo() + if err := _elem44.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + } + _val43 = append(_val43, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderPartIds[_key42] = _val43 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.GitInfoSha = v + } + return nil +} + +func (p *HBReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Version = v + } + return nil +} + +func (p *HBReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBReq"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HBReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) + } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) + } + return err +} + +func (p *HBReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *HBReq) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetLeaderPartIds() { + if err := oprot.WriteFieldBegin("leader_partIds", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:leader_partIds: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderPartIds)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderPartIds { + 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 4:leader_partIds: ", p), err) + } + } + return err +} + +func (p *HBReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:git_info_sha: ", p), err) + } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:git_info_sha: ", p), err) + } + return err +} + +func (p *HBReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:version: ", p), err) + } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:version: ", p), err) + } + } + return err +} + +func (p *HBReq) String() string { + if p == nil { + return "" + } + + roleVal := fmt.Sprintf("%v", p.Role) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + leaderPartIdsVal := fmt.Sprintf("%v", p.LeaderPartIds) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HBReq({Role:%s Host:%s ClusterID:%s LeaderPartIds:%s GitInfoSha:%s Version:%s})", roleVal, hostVal, clusterIDVal, leaderPartIdsVal, gitInfoShaVal, versionVal) +} + +// Attributes: +// - Name +// - TypeLength +type IndexFieldDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + TypeLength *int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewIndexFieldDef() *IndexFieldDef { + return &IndexFieldDef{} +} + +func (p *IndexFieldDef) GetName() []byte { + return p.Name +} + +var IndexFieldDef_TypeLength_DEFAULT int16 + +func (p *IndexFieldDef) GetTypeLength() int16 { + if !p.IsSetTypeLength() { + return IndexFieldDef_TypeLength_DEFAULT + } + return *p.TypeLength +} +func (p *IndexFieldDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != nil +} + +func (p *IndexFieldDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName 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 + } + issetName = 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 !issetName { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")) + } + return nil +} + +func (p *IndexFieldDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IndexFieldDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TypeLength = &v + } + return nil +} + +func (p *IndexFieldDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexFieldDef"); 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 *IndexFieldDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *IndexFieldDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) + } + if err := oprot.WriteI16(int16(*p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) + } + } + return err +} + +func (p *IndexFieldDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeLengthVal string + if p.TypeLength == nil { + typeLengthVal = "" + } else { + typeLengthVal = fmt.Sprintf("%v", *p.TypeLength) + } + return fmt.Sprintf("IndexFieldDef({Name:%s TypeLength:%s})", nameVal, typeLengthVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - TagName +// - Fields +// - IfNotExists +// - Comment +type CreateTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + TagName []byte `thrift:"tag_name,3" db:"tag_name" json:"tag_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateTagIndexReq() *CreateTagIndexReq { + return &CreateTagIndexReq{} +} + +func (p *CreateTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateTagIndexReq) GetTagName() []byte { + return p.TagName +} + +func (p *CreateTagIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateTagIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} + +var CreateTagIndexReq_Comment_DEFAULT []byte + +func (p *CreateTagIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateTagIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateTagIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem45 := NewIndexFieldDef() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.Fields = append(p.Fields, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_name: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *CreateTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + tagNameVal := fmt.Sprintf("%v", p.TagName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagIndexReq() *DropTagIndexReq { + return &DropTagIndexReq{} +} + +func (p *DropTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropTagIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagIndexReq) 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 *DropTagIndexReq) 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 *DropTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *DropTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagIndexReq"); 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 *DropTagIndexReq) 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 *DropTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *DropTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetTagIndexReq() *GetTagIndexReq { + return &GetTagIndexReq{} +} + +func (p *GetTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetTagIndexReq) 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 *GetTagIndexReq) 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 *GetTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *GetTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexReq"); 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 *GetTagIndexReq) 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 *GetTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *GetTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetTagIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetTagIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetTagIndexResp() *GetTagIndexResp { + return &GetTagIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + +func (p *GetTagIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetTagIndexResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetTagIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagIndexResp_Leader_DEFAULT + } + return p.Leader +} + +var GetTagIndexResp_Item_DEFAULT *IndexItem + +func (p *GetTagIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetTagIndexResp_Item_DEFAULT + } + return p.Item +} +func (p *GetTagIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetTagIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexResp"); 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetTagIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetTagIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListTagIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagIndexesReq() *ListTagIndexesReq { + return &ListTagIndexesReq{} +} + +func (p *ListTagIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagIndexesReq) 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesReq"); 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListTagIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListTagIndexesResp() *ListTagIndexesResp { + return &ListTagIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListTagIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListTagIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListTagIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListTagIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListTagIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem46 := NewIndexItem() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Items = append(p.Items, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesResp"); 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListTagIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListTagIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - EdgeName +// - Fields +// - IfNotExists +// - Comment +type CreateEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + EdgeName []byte `thrift:"edge_name,3" db:"edge_name" json:"edge_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { + return &CreateEdgeIndexReq{} +} + +func (p *CreateEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateEdgeIndexReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *CreateEdgeIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateEdgeIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} + +var CreateEdgeIndexReq_Comment_DEFAULT []byte + +func (p *CreateEdgeIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateEdgeIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateEdgeIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem47 := NewIndexFieldDef() + if err := _elem47.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + } + p.Fields = append(p.Fields, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_name: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *CreateEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeIndexReq() *DropEdgeIndexReq { + return &DropEdgeIndexReq{} +} + +func (p *DropEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropEdgeIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeIndexReq) 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *DropEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeIndexReq"); 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *DropEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetEdgeIndexReq() *GetEdgeIndexReq { + return &GetEdgeIndexReq{} +} + +func (p *GetEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetEdgeIndexReq) 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *GetEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexReq"); 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *GetEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetEdgeIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetEdgeIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetEdgeIndexResp() *GetEdgeIndexResp { + return &GetEdgeIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + +func (p *GetEdgeIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetEdgeIndexResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetEdgeIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeIndexResp_Leader_DEFAULT + } + return p.Leader +} + +var GetEdgeIndexResp_Item_DEFAULT *IndexItem + +func (p *GetEdgeIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetEdgeIndexResp_Item_DEFAULT + } + return p.Item +} +func (p *GetEdgeIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetEdgeIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexResp"); 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetEdgeIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetEdgeIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListEdgeIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgeIndexesReq() *ListEdgeIndexesReq { + return &ListEdgeIndexesReq{} +} + +func (p *ListEdgeIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesReq"); 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgeIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListEdgeIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListEdgeIndexesResp() *ListEdgeIndexesResp { + return &ListEdgeIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListEdgeIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListEdgeIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListEdgeIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgeIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListEdgeIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListEdgeIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem48 := NewIndexItem() + if err := _elem48.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.Items = append(p.Items, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgeIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesResp"); 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListEdgeIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListEdgeIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type RebuildIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewRebuildIndexReq() *RebuildIndexReq { + return &RebuildIndexReq{} +} + +func (p *RebuildIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *RebuildIndexReq) 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 *RebuildIndexReq) 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 *RebuildIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *RebuildIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexReq"); 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 *RebuildIndexReq) 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 *RebuildIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *RebuildIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("RebuildIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Account +// - EncodedPwd +// - IfNotExists +type CreateUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` + IfNotExists bool `thrift:"if_not_exists,3" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateUserReq() *CreateUserReq { + return &CreateUserReq{} +} + +func (p *CreateUserReq) GetAccount() []byte { + return p.Account +} + +func (p *CreateUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} + +func (p *CreateUserReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateUserReq) 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 *CreateUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *CreateUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EncodedPwd = v + } + return nil +} + +func (p *CreateUserReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateUserReq"); 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 *CreateUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *CreateUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) + } + return err +} + +func (p *CreateUserReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateUserReq({Account:%s EncodedPwd:%s IfNotExists:%s})", accountVal, encodedPwdVal, ifNotExistsVal) +} + +// Attributes: +// - Account +// - IfExists +type DropUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropUserReq() *DropUserReq { + return &DropUserReq{} +} + +func (p *DropUserReq) GetAccount() []byte { + return p.Account +} + +func (p *DropUserReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropUserReq) 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 *DropUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *DropUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropUserReq"); 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 *DropUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *DropUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) + } + return err +} + +func (p *DropUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropUserReq({Account:%s IfExists:%s})", accountVal, ifExistsVal) +} + +// Attributes: +// - Account +// - EncodedPwd +type AlterUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` +} + +func NewAlterUserReq() *AlterUserReq { + return &AlterUserReq{} +} + +func (p *AlterUserReq) GetAccount() []byte { + return p.Account +} + +func (p *AlterUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} +func (p *AlterUserReq) 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 *AlterUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *AlterUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EncodedPwd = v + } + return nil +} + +func (p *AlterUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterUserReq"); 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 *AlterUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *AlterUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) + } + return err +} + +func (p *AlterUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + return fmt.Sprintf("AlterUserReq({Account:%s EncodedPwd:%s})", accountVal, encodedPwdVal) +} + +// Attributes: +// - RoleItem +type GrantRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewGrantRoleReq() *GrantRoleReq { + return &GrantRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var GrantRoleReq_RoleItem_DEFAULT *RoleItem + +func (p *GrantRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return GrantRoleReq_RoleItem_DEFAULT + } + return p.RoleItem +} +func (p *GrantRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *GrantRoleReq) 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 *GrantRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *GrantRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GrantRoleReq"); 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 *GrantRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) + } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) + } + return err +} + +func (p *GrantRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("GrantRoleReq({RoleItem:%s})", roleItemVal) +} + +// Attributes: +// - RoleItem +type RevokeRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewRevokeRoleReq() *RevokeRoleReq { + return &RevokeRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var RevokeRoleReq_RoleItem_DEFAULT *RoleItem + +func (p *RevokeRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return RevokeRoleReq_RoleItem_DEFAULT + } + return p.RoleItem +} +func (p *RevokeRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *RevokeRoleReq) 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 *RevokeRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *RevokeRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RevokeRoleReq"); 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 *RevokeRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) + } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) + } + return err +} + +func (p *RevokeRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("RevokeRoleReq({RoleItem:%s})", roleItemVal) +} + +type ListUsersReq struct { +} + +func NewListUsersReq() *ListUsersReq { + return &ListUsersReq{} +} + +func (p *ListUsersReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListUsersReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListUsersReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Users +type ListUsersResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Users map[string][]byte `thrift:"users,3" db:"users" json:"users"` +} + +func NewListUsersResp() *ListUsersResp { + return &ListUsersResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListUsersResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListUsersResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListUsersResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListUsersResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListUsersResp) GetUsers() map[string][]byte { + return p.Users +} +func (p *ListUsersResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.Users = tMap + for i := 0; i < size; i++ { + var _key49 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key49 = v + } + var _val50 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val50 = v + } + p.Users[_key49] = _val50 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListUsersResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersResp"); 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("users", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:users: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Users)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Users { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:users: ", p), err) + } + return err +} + +func (p *ListUsersResp) 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) + } + usersVal := fmt.Sprintf("%v", p.Users) + return fmt.Sprintf("ListUsersResp({Code:%s Leader:%s Users:%s})", codeVal, leaderVal, usersVal) +} + +// Attributes: +// - SpaceID +type ListRolesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListRolesReq() *ListRolesReq { + return &ListRolesReq{} +} + +func (p *ListRolesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListRolesReq) 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 *ListRolesReq) 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 *ListRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesReq"); 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 *ListRolesReq) 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 *ListRolesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListRolesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Roles +type ListRolesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Roles []*RoleItem `thrift:"roles,3" db:"roles" json:"roles"` +} + +func NewListRolesResp() *ListRolesResp { + return &ListRolesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListRolesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListRolesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListRolesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListRolesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListRolesResp) GetRoles() []*RoleItem { + return p.Roles +} +func (p *ListRolesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*RoleItem, 0, size) + p.Roles = tSlice + for i := 0; i < size; i++ { + _elem51 := NewRoleItem() + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + } + p.Roles = append(p.Roles, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListRolesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesResp"); 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("roles", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:roles: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Roles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Roles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:roles: ", p), err) + } + return err +} + +func (p *ListRolesResp) 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) + } + rolesVal := fmt.Sprintf("%v", p.Roles) + return fmt.Sprintf("ListRolesResp({Code:%s Leader:%s Roles:%s})", codeVal, leaderVal, rolesVal) +} + +// Attributes: +// - Account +type GetUserRolesReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` +} + +func NewGetUserRolesReq() *GetUserRolesReq { + return &GetUserRolesReq{} +} + +func (p *GetUserRolesReq) GetAccount() []byte { + return p.Account +} +func (p *GetUserRolesReq) 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 *GetUserRolesReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *GetUserRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUserRolesReq"); 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 *GetUserRolesReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *GetUserRolesReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + return fmt.Sprintf("GetUserRolesReq({Account:%s})", accountVal) +} + +// Attributes: +// - Account +// - NewEncodedPwd_ +// - OldEncodedPwd +type ChangePasswordReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + NewEncodedPwd_ []byte `thrift:"new_encoded_pwd,2" db:"new_encoded_pwd" json:"new_encoded_pwd"` + OldEncodedPwd []byte `thrift:"old_encoded_pwd,3" db:"old_encoded_pwd" json:"old_encoded_pwd"` +} + +func NewChangePasswordReq() *ChangePasswordReq { + return &ChangePasswordReq{} +} + +func (p *ChangePasswordReq) GetAccount() []byte { + return p.Account +} + +func (p *ChangePasswordReq) GetNewEncodedPwd_() []byte { + return p.NewEncodedPwd_ +} + +func (p *ChangePasswordReq) GetOldEncodedPwd() []byte { + return p.OldEncodedPwd +} +func (p *ChangePasswordReq) 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 *ChangePasswordReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *ChangePasswordReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewEncodedPwd_ = v + } + return nil +} + +func (p *ChangePasswordReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.OldEncodedPwd = v + } + return nil +} + +func (p *ChangePasswordReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChangePasswordReq"); 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 *ChangePasswordReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.NewEncodedPwd_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_encoded_pwd: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("old_encoded_pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:old_encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.OldEncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_encoded_pwd (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:old_encoded_pwd: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + newEncodedPwdVal := fmt.Sprintf("%v", p.NewEncodedPwd_) + oldEncodedPwdVal := fmt.Sprintf("%v", p.OldEncodedPwd) + return fmt.Sprintf("ChangePasswordReq({Account:%s NewEncodedPwd_:%s OldEncodedPwd:%s})", accountVal, newEncodedPwdVal, oldEncodedPwdVal) +} + +// Attributes: +// - SpaceID +// - Id +// - HostDel +// - Stop +// - Reset +type BalanceReq struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + Id *int64 `thrift:"id,2" db:"id" json:"id,omitempty"` + HostDel []*nebula0.HostAddr `thrift:"host_del,3" db:"host_del" json:"host_del,omitempty"` + Stop *bool `thrift:"stop,4" db:"stop" json:"stop,omitempty"` + Reset *bool `thrift:"reset,5" db:"reset" json:"reset,omitempty"` +} + +func NewBalanceReq() *BalanceReq { + return &BalanceReq{} +} + +var BalanceReq_SpaceID_DEFAULT nebula0.GraphSpaceID + +func (p *BalanceReq) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return BalanceReq_SpaceID_DEFAULT + } + return *p.SpaceID +} + +var BalanceReq_Id_DEFAULT int64 + +func (p *BalanceReq) GetId() int64 { + if !p.IsSetId() { + return BalanceReq_Id_DEFAULT + } + return *p.Id +} + +var BalanceReq_HostDel_DEFAULT []*nebula0.HostAddr + +func (p *BalanceReq) GetHostDel() []*nebula0.HostAddr { + return p.HostDel +} + +var BalanceReq_Stop_DEFAULT bool + +func (p *BalanceReq) GetStop() bool { + if !p.IsSetStop() { + return BalanceReq_Stop_DEFAULT + } + return *p.Stop +} + +var BalanceReq_Reset_DEFAULT bool + +func (p *BalanceReq) GetReset() bool { + if !p.IsSetReset() { + return BalanceReq_Reset_DEFAULT + } + return *p.Reset +} +func (p *BalanceReq) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *BalanceReq) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *BalanceReq) IsSetHostDel() bool { + return p != nil && p.HostDel != nil +} + +func (p *BalanceReq) IsSetStop() bool { + return p != nil && p.Stop != nil +} + +func (p *BalanceReq) IsSetReset() bool { + return p != nil && p.Reset != nil +} + +func (p *BalanceReq) 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 + } + 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 *BalanceReq) 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 *BalanceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Id = &v + } + return nil +} + +func (p *BalanceReq) ReadField3(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.HostDel = tSlice + for i := 0; i < size; i++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.HostDel = append(p.HostDel, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Stop = &v + } + return nil +} + +func (p *BalanceReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Reset = &v + } + return nil +} + +func (p *BalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceReq"); 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 *BalanceReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *BalanceReq) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetId() { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetHostDel() { + if err := oprot.WriteFieldBegin("host_del", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_del: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HostDel)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HostDel { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host_del: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStop() { + if err := oprot.WriteFieldBegin("stop", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop: ", p), err) + } + if err := oprot.WriteBool(bool(*p.Stop)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetReset() { + if err := oprot.WriteFieldBegin("reset", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:reset: ", p), err) + } + if err := oprot.WriteBool(bool(*p.Reset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reset (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:reset: ", p), err) + } + } + return err +} + +func (p *BalanceReq) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", *p.Id) + } + hostDelVal := fmt.Sprintf("%v", p.HostDel) + var stopVal string + if p.Stop == nil { + stopVal = "" + } else { + stopVal = fmt.Sprintf("%v", *p.Stop) + } + var resetVal string + if p.Reset == nil { + resetVal = "" + } else { + resetVal = fmt.Sprintf("%v", *p.Reset) + } + return fmt.Sprintf("BalanceReq({SpaceID:%s Id:%s HostDel:%s Stop:%s Reset:%s})", spaceIDVal, idVal, hostDelVal, stopVal, resetVal) +} + +// Attributes: +// - Id +// - Result_ +type BalanceTask struct { + Id []byte `thrift:"id,1" db:"id" json:"id"` + Result_ TaskResult_ `thrift:"result,2" db:"result" json:"result"` +} + +func NewBalanceTask() *BalanceTask { + return &BalanceTask{} +} + +func (p *BalanceTask) GetId() []byte { + return p.Id +} + +func (p *BalanceTask) GetResult_() TaskResult_ { + return p.Result_ +} +func (p *BalanceTask) 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 *BalanceTask) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *BalanceTask) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TaskResult_(v) + p.Result_ = temp + } + return nil +} + +func (p *BalanceTask) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceTask"); 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 *BalanceTask) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := oprot.WriteBinary(p.Id); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *BalanceTask) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:result: ", p), err) + } + if err := oprot.WriteI32(int32(p.Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.result (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:result: ", p), err) + } + return err +} + +func (p *BalanceTask) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + resultVal := fmt.Sprintf("%v", p.Result_) + return fmt.Sprintf("BalanceTask({Id:%s Result_:%s})", idVal, resultVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +// - Tasks +type BalanceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id int64 `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` + Tasks []*BalanceTask `thrift:"tasks,4" db:"tasks" json:"tasks"` +} + +func NewBalanceResp() *BalanceResp { + return &BalanceResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *BalanceResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *BalanceResp) GetId() int64 { + return p.Id +} + +var BalanceResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *BalanceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return BalanceResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *BalanceResp) GetTasks() []*BalanceTask { + return p.Tasks +} +func (p *BalanceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *BalanceResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *BalanceResp) ReadField3(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 *BalanceResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BalanceTask, 0, size) + p.Tasks = tSlice + for i := 0; i < size; i++ { + _elem53 := NewBalanceTask() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) + } + p.Tasks = append(p.Tasks, _elem53) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + return err +} + +func (p *BalanceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) + } + return err +} + +func (p *BalanceResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tasks", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tasks: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tasks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tasks { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tasks: ", p), err) + } + return err +} + +func (p *BalanceResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + idVal := fmt.Sprintf("%v", p.Id) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + tasksVal := fmt.Sprintf("%v", p.Tasks) + return fmt.Sprintf("BalanceResp({Code:%s Id:%s Leader:%s Tasks:%s})", codeVal, idVal, leaderVal, tasksVal) +} + +type LeaderBalanceReq struct { +} + +func NewLeaderBalanceReq() *LeaderBalanceReq { + return &LeaderBalanceReq{} +} + +func (p *LeaderBalanceReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LeaderBalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderBalanceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *LeaderBalanceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("LeaderBalanceReq({})") +} + +// Attributes: +// - Module +// - Name +// - Mode +// - Value +type ConfigItem struct { + Module ConfigModule `thrift:"module,1" db:"module" json:"module"` + Name []byte `thrift:"name,2" db:"name" json:"name"` + Mode ConfigMode `thrift:"mode,3" db:"mode" json:"mode"` + Value *nebula0.Value `thrift:"value,4" db:"value" json:"value"` +} + +func NewConfigItem() *ConfigItem { + return &ConfigItem{} +} + +func (p *ConfigItem) GetModule() ConfigModule { + return p.Module +} + +func (p *ConfigItem) GetName() []byte { + return p.Name +} + +func (p *ConfigItem) GetMode() ConfigMode { + return p.Mode +} + +var ConfigItem_Value_DEFAULT *nebula0.Value + +func (p *ConfigItem) GetValue() *nebula0.Value { + if !p.IsSetValue() { + return ConfigItem_Value_DEFAULT + } + return p.Value +} +func (p *ConfigItem) IsSetValue() bool { + return p != nil && p.Value != nil +} + +func (p *ConfigItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ConfigItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ConfigModule(v) + p.Module = temp + } + return nil +} + +func (p *ConfigItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *ConfigItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := ConfigMode(v) + p.Mode = temp + } + return nil +} + +func (p *ConfigItem) ReadField4(iprot thrift.Protocol) error { + p.Value = nebula0.NewValue() + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ConfigItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ConfigItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:module: ", p), err) + } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:module: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) + } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err) + } + if err := oprot.WriteI32(int32(p.Mode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) + } + return err +} + +func (p *ConfigItem) String() string { + if p == nil { + return "" + } + + moduleVal := fmt.Sprintf("%v", p.Module) + nameVal := fmt.Sprintf("%v", p.Name) + modeVal := fmt.Sprintf("%v", p.Mode) + var valueVal string + if p.Value == nil { + valueVal = "" + } else { + valueVal = fmt.Sprintf("%v", p.Value) + } + return fmt.Sprintf("ConfigItem({Module:%s Name:%s Mode:%s Value:%s})", moduleVal, nameVal, modeVal, valueVal) +} + +// Attributes: +// - Items +type RegConfigReq struct { + Items []*ConfigItem `thrift:"items,1" db:"items" json:"items"` +} + +func NewRegConfigReq() *RegConfigReq { + return &RegConfigReq{} +} + +func (p *RegConfigReq) GetItems() []*ConfigItem { + return p.Items +} +func (p *RegConfigReq) 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 *RegConfigReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem54 := NewConfigItem() + if err := _elem54.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.Items = append(p.Items, _elem54) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RegConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RegConfigReq"); 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 *RegConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:items: ", p), err) + } + return err +} + +func (p *RegConfigReq) String() string { + if p == nil { + return "" + } + + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("RegConfigReq({Items:%s})", itemsVal) +} + +// Attributes: +// - Item +type GetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewGetConfigReq() *GetConfigReq { + return &GetConfigReq{ + Item: NewConfigItem(), + } +} + +var GetConfigReq_Item_DEFAULT *ConfigItem + +func (p *GetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return GetConfigReq_Item_DEFAULT + } + return p.Item +} +func (p *GetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetConfigReq) 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 *GetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigReq"); 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 *GetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) + } + return err +} + +func (p *GetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type GetConfigResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewGetConfigResp() *GetConfigResp { + return &GetConfigResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetConfigResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetConfigResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetConfigResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetConfigResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetConfigResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *GetConfigResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem55 := NewConfigItem() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) + } + p.Items = append(p.Items, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetConfigResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigResp"); 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *GetConfigResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("GetConfigResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - Item +type SetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewSetConfigReq() *SetConfigReq { + return &SetConfigReq{ + Item: NewConfigItem(), + } +} + +var SetConfigReq_Item_DEFAULT *ConfigItem + +func (p *SetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return SetConfigReq_Item_DEFAULT + } + return p.Item +} +func (p *SetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *SetConfigReq) 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 *SetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *SetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SetConfigReq"); 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 *SetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) + } + return err +} + +func (p *SetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("SetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Space +// - Module +type ListConfigsReq struct { + Space []byte `thrift:"space,1" db:"space" json:"space"` + Module ConfigModule `thrift:"module,2" db:"module" json:"module"` +} + +func NewListConfigsReq() *ListConfigsReq { + return &ListConfigsReq{} +} + +func (p *ListConfigsReq) GetSpace() []byte { + return p.Space +} + +func (p *ListConfigsReq) GetModule() ConfigModule { + return p.Module +} +func (p *ListConfigsReq) 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 *ListConfigsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Space = v + } + return nil +} + +func (p *ListConfigsReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ConfigModule(v) + p.Module = temp + } + return nil +} + +func (p *ListConfigsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsReq"); 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 *ListConfigsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) + } + if err := oprot.WriteBinary(p.Space); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) + } + return err +} + +func (p *ListConfigsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:module: ", p), err) + } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:module: ", p), err) + } + return err +} + +func (p *ListConfigsReq) String() string { + if p == nil { + return "" + } + + spaceVal := fmt.Sprintf("%v", p.Space) + moduleVal := fmt.Sprintf("%v", p.Module) + return fmt.Sprintf("ListConfigsReq({Space:%s Module:%s})", spaceVal, moduleVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListConfigsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListConfigsResp() *ListConfigsResp { + return &ListConfigsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListConfigsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListConfigsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListConfigsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListConfigsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListConfigsResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *ListConfigsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem56 := NewConfigItem() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Items = append(p.Items, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListConfigsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsResp"); 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListConfigsResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListConfigsResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +type CreateSnapshotReq struct { +} + +func NewCreateSnapshotReq() *CreateSnapshotReq { + return &CreateSnapshotReq{} +} + +func (p *CreateSnapshotReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateSnapshotReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("CreateSnapshotReq({})") +} + +// Attributes: +// - Name +type DropSnapshotReq struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` +} + +func NewDropSnapshotReq() *DropSnapshotReq { + return &DropSnapshotReq{} +} + +func (p *DropSnapshotReq) GetName() []byte { + return p.Name +} +func (p *DropSnapshotReq) 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 *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 + } + return nil +} + +func (p *DropSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSnapshotReq"); 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 *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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *DropSnapshotReq) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropSnapshotReq({Name:%s})", nameVal) +} + +type ListSnapshotsReq struct { +} + +func NewListSnapshotsReq() *ListSnapshotsReq { + return &ListSnapshotsReq{} +} + +func (p *ListSnapshotsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSnapshotsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSnapshotsReq({})") +} + +// Attributes: +// - Name +// - Status +// - Hosts +type Snapshot struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status SnapshotStatus `thrift:"status,2" db:"status" json:"status"` + Hosts []byte `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewSnapshot() *Snapshot { + return &Snapshot{} +} + +func (p *Snapshot) GetName() []byte { + return p.Name +} + +func (p *Snapshot) GetStatus() SnapshotStatus { + return p.Status +} + +func (p *Snapshot) GetHosts() []byte { + return p.Hosts +} +func (p *Snapshot) 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 *Snapshot) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *Snapshot) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := SnapshotStatus(v) + p.Status = temp + } + return nil +} + +func (p *Snapshot) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Hosts = v + } + return nil +} + +func (p *Snapshot) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Snapshot"); 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 *Snapshot) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *Snapshot) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *Snapshot) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) + } + if err := oprot.WriteBinary(p.Hosts); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hosts (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) + } + return err +} + +func (p *Snapshot) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("Snapshot({Name:%s Status:%s Hosts:%s})", nameVal, statusVal, hostsVal) +} + +// Attributes: +// - Code +// - Leader +// - Snapshots +type ListSnapshotsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Snapshots []*Snapshot `thrift:"snapshots,3" db:"snapshots" json:"snapshots"` +} + +func NewListSnapshotsResp() *ListSnapshotsResp { + return &ListSnapshotsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSnapshotsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSnapshotsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSnapshotsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSnapshotsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSnapshotsResp) GetSnapshots() []*Snapshot { + return p.Snapshots +} +func (p *ListSnapshotsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Snapshot, 0, size) + p.Snapshots = tSlice + for i := 0; i < size; i++ { + _elem57 := NewSnapshot() + if err := _elem57.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) + } + p.Snapshots = append(p.Snapshots, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSnapshotsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsResp"); 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("snapshots", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:snapshots: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Snapshots)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Snapshots { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:snapshots: ", p), err) + } + return err +} + +func (p *ListSnapshotsResp) 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) + } + snapshotsVal := fmt.Sprintf("%v", p.Snapshots) + return fmt.Sprintf("ListSnapshotsResp({Code:%s Leader:%s Snapshots:%s})", codeVal, leaderVal, snapshotsVal) +} + +// Attributes: +// - SpaceID +type ListIndexStatusReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListIndexStatusReq() *ListIndexStatusReq { + return &ListIndexStatusReq{} +} + +func (p *ListIndexStatusReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListIndexStatusReq) 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusReq"); 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListIndexStatusReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Name +// - Status +type IndexStatus struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status []byte `thrift:"status,2" db:"status" json:"status"` +} + +func NewIndexStatus() *IndexStatus { + return &IndexStatus{} +} + +func (p *IndexStatus) GetName() []byte { + return p.Name +} + +func (p *IndexStatus) GetStatus() []byte { + return p.Status +} +func (p *IndexStatus) 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 *IndexStatus) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IndexStatus) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Status = v + } + return nil +} + +func (p *IndexStatus) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexStatus"); 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 *IndexStatus) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *IndexStatus) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteBinary(p.Status); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *IndexStatus) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("IndexStatus({Name:%s Status:%s})", nameVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Statuses +type ListIndexStatusResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statuses []*IndexStatus `thrift:"statuses,3" db:"statuses" json:"statuses"` +} + +func NewListIndexStatusResp() *ListIndexStatusResp { + return &ListIndexStatusResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListIndexStatusResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListIndexStatusResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListIndexStatusResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListIndexStatusResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListIndexStatusResp) GetStatuses() []*IndexStatus { + return p.Statuses +} +func (p *ListIndexStatusResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexStatus, 0, size) + p.Statuses = tSlice + for i := 0; i < size; i++ { + _elem58 := NewIndexStatus() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Statuses = append(p.Statuses, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) + } + if err := oprot.WriteI32(int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) + } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + statusesVal := fmt.Sprintf("%v", p.Statuses) + return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) +} + +// Attributes: +// - ZoneName +// - Nodes +type AddZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewAddZoneReq() *AddZoneReq { + return &AddZoneReq{} +} + +func (p *AddZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneReq) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *AddZoneReq) 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 *AddZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddZoneReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i++ { + _elem59 := nebula0.NewHostAddr() + if err := _elem59.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Nodes = append(p.Nodes, _elem59) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneReq"); err != nil { + 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 *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *AddZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) + } + return err +} + +func (p *AddZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("AddZoneReq({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - ZoneName +type DropZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewDropZoneReq() *DropZoneReq { + return &DropZoneReq{} +} + +func (p *DropZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropZoneReq) 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 *DropZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *DropZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type AddHostIntoZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewAddHostIntoZoneReq() *AddHostIntoZoneReq { + return &AddHostIntoZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var AddHostIntoZoneReq_Node_DEFAULT *nebula0.HostAddr + +func (p *AddHostIntoZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return AddHostIntoZoneReq_Node_DEFAULT + } + return p.Node +} + +func (p *AddHostIntoZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *AddHostIntoZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *AddHostIntoZoneReq) 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 *AddHostIntoZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostIntoZoneReq"); 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 *AddHostIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) + } + return err +} + +func (p *AddHostIntoZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("AddHostIntoZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type DropHostFromZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewDropHostFromZoneReq() *DropHostFromZoneReq { + return &DropHostFromZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var DropHostFromZoneReq_Node_DEFAULT *nebula0.HostAddr + +func (p *DropHostFromZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return DropHostFromZoneReq_Node_DEFAULT + } + return p.Node +} + +func (p *DropHostFromZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropHostFromZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *DropHostFromZoneReq) 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 *DropHostFromZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropHostFromZoneReq"); 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 *DropHostFromZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) + } + return err +} + +func (p *DropHostFromZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropHostFromZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - ZoneName +type GetZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewGetZoneReq() *GetZoneReq { + return &GetZoneReq{} +} + +func (p *GetZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *GetZoneReq) 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 *GetZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *GetZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneReq"); 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 *GetZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *GetZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("GetZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type GetZoneResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewGetZoneResp() *GetZoneResp { + return &GetZoneResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetZoneResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetZoneResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetZoneResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetZoneResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetZoneResp) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *GetZoneResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) ReadField3(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++ { + _elem60 := nebula0.NewHostAddr() + if err := _elem60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) + } + p.Hosts = append(p.Hosts, _elem60) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetZoneResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneResp"); 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *GetZoneResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("GetZoneResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +type ListZonesReq struct { +} + +func NewListZonesReq() *ListZonesReq { + return &ListZonesReq{} +} + +func (p *ListZonesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListZonesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListZonesReq({})") +} + +// Attributes: +// - ZoneName +// - Nodes +type Zone struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewZone() *Zone { + return &Zone{} +} + +func (p *Zone) GetZoneName() []byte { + return p.ZoneName +} + +func (p *Zone) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *Zone) 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 *Zone) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *Zone) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i++ { + _elem61 := nebula0.NewHostAddr() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + } + p.Nodes = append(p.Nodes, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Zone) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Zone"); 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 *Zone) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *Zone) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) + } + return err +} + +func (p *Zone) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("Zone({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - Code +// - Leader +// - Zones +type ListZonesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Zones []*Zone `thrift:"zones,3" db:"zones" json:"zones"` +} + +func NewListZonesResp() *ListZonesResp { + return &ListZonesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListZonesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListZonesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListZonesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListZonesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListZonesResp) GetZones() []*Zone { + return p.Zones +} +func (p *ListZonesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Zone, 0, size) + p.Zones = tSlice + for i := 0; i < size; i++ { + _elem62 := NewZone() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Zones = append(p.Zones, _elem62) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListZonesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesResp"); 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zones", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zones: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zones: ", p), err) + } + return err +} + +func (p *ListZonesResp) 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) + } + zonesVal := fmt.Sprintf("%v", p.Zones) + return fmt.Sprintf("ListZonesResp({Code:%s Leader:%s Zones:%s})", codeVal, leaderVal, zonesVal) +} + +// Attributes: +// - GroupName +// - ZoneNames +type AddGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewAddGroupReq() *AddGroupReq { + return &AddGroupReq{} +} + +func (p *AddGroupReq) GetGroupName() []byte { + return p.GroupName +} + +func (p *AddGroupReq) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *AddGroupReq) 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 *AddGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *AddGroupReq) 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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem63 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem63 = v + } + p.ZoneNames = append(p.ZoneNames, _elem63) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddGroupReq"); 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 *AddGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *AddGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) + } + return err +} + +func (p *AddGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("AddGroupReq({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - GroupName +type DropGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewDropGroupReq() *DropGroupReq { + return &DropGroupReq{} +} + +func (p *DropGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropGroupReq) 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 *DropGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *DropGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropGroupReq"); 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 *DropGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *DropGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type AddZoneIntoGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewAddZoneIntoGroupReq() *AddZoneIntoGroupReq { + return &AddZoneIntoGroupReq{} +} + +func (p *AddZoneIntoGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneIntoGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *AddZoneIntoGroupReq) 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 *AddZoneIntoGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddZoneIntoGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *AddZoneIntoGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneIntoGroupReq"); 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 *AddZoneIntoGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *AddZoneIntoGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) + } + return err +} + +func (p *AddZoneIntoGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("AddZoneIntoGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type DropZoneFromGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewDropZoneFromGroupReq() *DropZoneFromGroupReq { + return &DropZoneFromGroupReq{} +} + +func (p *DropZoneFromGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *DropZoneFromGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropZoneFromGroupReq) 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 *DropZoneFromGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropZoneFromGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *DropZoneFromGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneFromGroupReq"); 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 *DropZoneFromGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *DropZoneFromGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) + } + return err +} + +func (p *DropZoneFromGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropZoneFromGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - GroupName +type GetGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewGetGroupReq() *GetGroupReq { + return &GetGroupReq{} +} + +func (p *GetGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *GetGroupReq) 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 *GetGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *GetGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupReq"); 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 *GetGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *GetGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("GetGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - Code +// - Leader +// - ZoneNames +type GetGroupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ZoneNames [][]byte `thrift:"zone_names,3" db:"zone_names" json:"zone_names"` +} + +func NewGetGroupResp() *GetGroupResp { + return &GetGroupResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetGroupResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetGroupResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetGroupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetGroupResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetGroupResp) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *GetGroupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) ReadField3(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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem64 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem64 = v + } + p.ZoneNames = append(p.ZoneNames, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetGroupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupResp"); 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zone_names: ", p), err) + } + return err +} + +func (p *GetGroupResp) 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) + } + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("GetGroupResp({Code:%s Leader:%s ZoneNames:%s})", codeVal, leaderVal, zoneNamesVal) +} + +type ListGroupsReq struct { +} + +func NewListGroupsReq() *ListGroupsReq { + return &ListGroupsReq{} +} + +func (p *ListGroupsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListGroupsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListGroupsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListGroupsReq({})") +} + +// Attributes: +// - GroupName +// - ZoneNames +type Group struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewGroup() *Group { + return &Group{} +} + +func (p *Group) GetGroupName() []byte { + return p.GroupName +} + +func (p *Group) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *Group) 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 *Group) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *Group) 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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem65 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem65 = v + } + p.ZoneNames = append(p.ZoneNames, _elem65) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Group) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Group"); 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 *Group) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *Group) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) + } + return err +} + +func (p *Group) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("Group({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - Code +// - Leader +// - Groups +type ListGroupsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Groups []*Group `thrift:"groups,3" db:"groups" json:"groups"` +} + +func NewListGroupsResp() *ListGroupsResp { + return &ListGroupsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListGroupsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListGroupsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListGroupsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListGroupsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListGroupsResp) GetGroups() []*Group { + return p.Groups +} +func (p *ListGroupsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Group, 0, size) + p.Groups = tSlice + for i := 0; i < size; i++ { + _elem66 := NewGroup() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + p.Groups = append(p.Groups, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListGroupsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsResp"); 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("groups", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:groups: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Groups)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Groups { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:groups: ", p), err) + } + return err +} + +func (p *ListGroupsResp) 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) + } + groupsVal := fmt.Sprintf("%v", p.Groups) + return fmt.Sprintf("ListGroupsResp({Code:%s Leader:%s Groups:%s})", codeVal, leaderVal, groupsVal) +} + +// Attributes: +// - SpaceID +// - Type +// - Hosts +type AddListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewAddListenerReq() *AddListenerReq { + return &AddListenerReq{} +} + +func (p *AddListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddListenerReq) GetType() ListenerType { + return p.Type +} + +func (p *AddListenerReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *AddListenerReq) 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 *AddListenerReq) 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 *AddListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *AddListenerReq) ReadField3(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++ { + _elem67 := nebula0.NewHostAddr() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) + } + p.Hosts = append(p.Hosts, _elem67) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddListenerReq"); 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 *AddListenerReq) 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 *AddListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *AddListenerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *AddListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("AddListenerReq({SpaceID:%s Type:%s Hosts:%s})", spaceIDVal, typeVal, hostsVal) +} + +// Attributes: +// - SpaceID +// - Type +type RemoveListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` +} + +func NewRemoveListenerReq() *RemoveListenerReq { + return &RemoveListenerReq{} +} + +func (p *RemoveListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemoveListenerReq) GetType() ListenerType { + return p.Type +} +func (p *RemoveListenerReq) 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 *RemoveListenerReq) 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 *RemoveListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *RemoveListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveListenerReq"); 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 *RemoveListenerReq) 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 *RemoveListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *RemoveListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("RemoveListenerReq({SpaceID:%s Type:%s})", spaceIDVal, typeVal) +} + +// Attributes: +// - SpaceID +type ListListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListListenerReq() *ListListenerReq { + return &ListListenerReq{} +} + +func (p *ListListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListListenerReq) 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 *ListListenerReq) 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 *ListListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerReq"); 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 *ListListenerReq) 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 *ListListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListListenerReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Type +// - Host +// - PartID +// - Status +type ListenerInfo struct { + Type ListenerType `thrift:"type,1" db:"type" json:"type"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + PartID nebula0.PartitionID `thrift:"part_id,3" db:"part_id" json:"part_id"` + Status HostStatus `thrift:"status,4" db:"status" json:"status"` +} + +func NewListenerInfo() *ListenerInfo { + return &ListenerInfo{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *ListenerInfo) GetType() ListenerType { + return p.Type +} + +var ListenerInfo_Host_DEFAULT *nebula0.HostAddr + +func (p *ListenerInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return ListenerInfo_Host_DEFAULT + } + return p.Host +} + +func (p *ListenerInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *ListenerInfo) GetStatus() HostStatus { + return p.Status +} +func (p *ListenerInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *ListenerInfo) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListenerInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *ListenerInfo) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ListenerInfo) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.PartitionID(v) + p.PartID = temp + } + return nil +} + +func (p *ListenerInfo) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := HostStatus(v) + p.Status = temp + } + return nil +} + +func (p *ListenerInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListenerInfo"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListenerInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *ListenerInfo) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + partIDVal := fmt.Sprintf("%v", p.PartID) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("ListenerInfo({Type:%s Host:%s PartID:%s Status:%s})", typeVal, hostVal, partIDVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Listeners +type ListListenerResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Listeners []*ListenerInfo `thrift:"listeners,3" db:"listeners" json:"listeners"` +} + +func NewListListenerResp() *ListListenerResp { + return &ListListenerResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListListenerResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListListenerResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListListenerResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListListenerResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListListenerResp) GetListeners() []*ListenerInfo { + return p.Listeners +} +func (p *ListListenerResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ListenerInfo, 0, size) + p.Listeners = tSlice + for i := 0; i < size; i++ { + _elem68 := NewListenerInfo() + if err := _elem68.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + } + p.Listeners = append(p.Listeners, _elem68) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListListenerResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerResp"); 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("listeners", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:listeners: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Listeners { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:listeners: ", p), err) + } + return err +} + +func (p *ListListenerResp) 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) + } + listenersVal := fmt.Sprintf("%v", p.Listeners) + return fmt.Sprintf("ListListenerResp({Code:%s Leader:%s Listeners:%s})", codeVal, leaderVal, listenersVal) +} + +// Attributes: +// - SpaceID +type GetStatisReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetStatisReq() *GetStatisReq { + return &GetStatisReq{} +} + +func (p *GetStatisReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetStatisReq) 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 *GetStatisReq) 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 *GetStatisReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisReq"); 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 *GetStatisReq) 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 *GetStatisReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetStatisReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Statis +type GetStatisResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statis *StatisItem `thrift:"statis,3" db:"statis" json:"statis"` +} + +func NewGetStatisResp() *GetStatisResp { + return &GetStatisResp{ + Leader: nebula0.NewHostAddr(), + Statis: NewStatisItem(), + } +} + +func (p *GetStatisResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetStatisResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetStatisResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetStatisResp_Leader_DEFAULT + } + return p.Leader +} + +var GetStatisResp_Statis_DEFAULT *StatisItem + +func (p *GetStatisResp) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return GetStatisResp_Statis_DEFAULT + } + return p.Statis +} +func (p *GetStatisResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetStatisResp) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) ReadField3(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *GetStatisResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisResp"); 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 *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statis: ", p), err) + } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statis: ", p), err) + } + return err +} + +func (p *GetStatisResp) 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) + } + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("GetStatisResp({Code:%s Leader:%s Statis:%s})", codeVal, leaderVal, statisVal) +} + +// Attributes: +// - Host +// - Info +type BackupInfo struct { + Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewBackupInfo() *BackupInfo { + return &BackupInfo{ + Host: nebula0.NewHostAddr(), + } +} + +var BackupInfo_Host_DEFAULT *nebula0.HostAddr + +func (p *BackupInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return BackupInfo_Host_DEFAULT + } + return p.Host +} + +func (p *BackupInfo) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *BackupInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *BackupInfo) 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 *BackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *BackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i++ { + _elem69 := nebula0.NewCheckpointInfo() + if err := _elem69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) + } + p.Info = append(p.Info, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BackupInfo"); 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 *BackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) + } + return err +} + +func (p *BackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) + } + return err +} + +func (p *BackupInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("BackupInfo({Host:%s Info:%s})", hostVal, infoVal) +} + +// Attributes: +// - Space +// - Info +type SpaceBackupInfo struct { + Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` + Info []*BackupInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewSpaceBackupInfo() *SpaceBackupInfo { + return &SpaceBackupInfo{ + Space: NewSpaceDesc(), + } +} + +var SpaceBackupInfo_Space_DEFAULT *SpaceDesc + +func (p *SpaceBackupInfo) GetSpace() *SpaceDesc { + if !p.IsSetSpace() { + return SpaceBackupInfo_Space_DEFAULT + } + return p.Space +} + +func (p *SpaceBackupInfo) GetInfo() []*BackupInfo { + return p.Info +} +func (p *SpaceBackupInfo) IsSetSpace() bool { + return p != nil && p.Space != nil +} + +func (p *SpaceBackupInfo) 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 *SpaceBackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Space = NewSpaceDesc() + if err := p.Space.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Space), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BackupInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i++ { + _elem70 := NewBackupInfo() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) + } + p.Info = append(p.Info, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceBackupInfo"); 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 *SpaceBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) + } + if err := p.Space.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Space), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) + } + return err +} + +func (p *SpaceBackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) + } + return err +} + +func (p *SpaceBackupInfo) String() string { + if p == nil { + return "" + } + + var spaceVal string + if p.Space == nil { + spaceVal = "" + } else { + spaceVal = fmt.Sprintf("%v", p.Space) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("SpaceBackupInfo({Space:%s Info:%s})", spaceVal, infoVal) +} + +// Attributes: +// - BackupInfo +// - MetaFiles +// - BackupName +// - Full +// - IncludeSystemSpace +// - CreateTime +type BackupMeta struct { + BackupInfo map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"backup_info,1" db:"backup_info" json:"backup_info"` + MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` + BackupName []byte `thrift:"backup_name,3" db:"backup_name" json:"backup_name"` + Full bool `thrift:"full,4" db:"full" json:"full"` + IncludeSystemSpace bool `thrift:"include_system_space,5" db:"include_system_space" json:"include_system_space"` + CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` +} + +func NewBackupMeta() *BackupMeta { + return &BackupMeta{} +} + +func (p *BackupMeta) GetBackupInfo() map[nebula0.GraphSpaceID]*SpaceBackupInfo { + return p.BackupInfo +} + +func (p *BackupMeta) GetMetaFiles() [][]byte { + return p.MetaFiles +} + +func (p *BackupMeta) GetBackupName() []byte { + return p.BackupName +} + +func (p *BackupMeta) GetFull() bool { + return p.Full +} + +func (p *BackupMeta) GetIncludeSystemSpace() bool { + return p.IncludeSystemSpace +} + +func (p *BackupMeta) GetCreateTime() int64 { + return p.CreateTime +} +func (p *BackupMeta) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BackupMeta) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) + p.BackupInfo = tMap + for i := 0; i < size; i++ { + var _key71 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + _key71 = temp + } + _val72 := NewSpaceBackupInfo() + if err := _val72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val72), err) + } + p.BackupInfo[_key71] = _val72 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BackupMeta) 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.MetaFiles = tSlice + for i := 0; i < size; i++ { + var _elem73 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem73 = v + } + p.MetaFiles = append(p.MetaFiles, _elem73) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupName = v + } + return nil +} + +func (p *BackupMeta) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Full = v + } + return nil +} + +func (p *BackupMeta) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IncludeSystemSpace = v + } + return nil +} + +func (p *BackupMeta) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.CreateTime = v + } + 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) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *BackupMeta) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_info: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.BackupInfo)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.BackupInfo { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_info: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_files", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:meta_files: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.MetaFiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaFiles { + 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:meta_files: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_name: ", p), err) + } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_name: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("full", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:full: ", p), err) + } + if err := oprot.WriteBool(bool(p.Full)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:full: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("include_system_space", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:include_system_space: ", p), err) + } + if err := oprot.WriteBool(bool(p.IncludeSystemSpace)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.include_system_space (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:include_system_space: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:create_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:create_time: ", p), err) + } + return err +} + +func (p *BackupMeta) String() string { + if p == nil { + return "" + } + + backupInfoVal := fmt.Sprintf("%v", p.BackupInfo) + metaFilesVal := fmt.Sprintf("%v", p.MetaFiles) + backupNameVal := fmt.Sprintf("%v", p.BackupName) + fullVal := fmt.Sprintf("%v", p.Full) + includeSystemSpaceVal := fmt.Sprintf("%v", p.IncludeSystemSpace) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + return fmt.Sprintf("BackupMeta({BackupInfo:%s MetaFiles:%s BackupName:%s Full:%s IncludeSystemSpace:%s CreateTime:%s})", backupInfoVal, metaFilesVal, backupNameVal, fullVal, includeSystemSpaceVal, createTimeVal) +} + +// Attributes: +// - Spaces +type CreateBackupReq struct { + Spaces [][]byte `thrift:"spaces,1" db:"spaces" json:"spaces,omitempty"` +} + +func NewCreateBackupReq() *CreateBackupReq { + return &CreateBackupReq{} +} + +var CreateBackupReq_Spaces_DEFAULT [][]byte + +func (p *CreateBackupReq) GetSpaces() [][]byte { + return p.Spaces +} +func (p *CreateBackupReq) IsSetSpaces() bool { + return p != nil && p.Spaces != nil +} + +func (p *CreateBackupReq) 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 *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i++ { + var _elem74 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem74 = v + } + p.Spaces = append(p.Spaces, _elem74) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateBackupReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaces() { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spaces: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + 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:spaces: ", 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) +} + +// Attributes: +// - Code +// - Leader +// - Meta +type CreateBackupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Meta *BackupMeta `thrift:"meta,3" db:"meta" json:"meta"` +} + +func NewCreateBackupResp() *CreateBackupResp { + return &CreateBackupResp{ + Leader: nebula0.NewHostAddr(), + Meta: NewBackupMeta(), + } +} + +func (p *CreateBackupResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var CreateBackupResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *CreateBackupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateBackupResp_Leader_DEFAULT + } + return p.Leader +} + +var CreateBackupResp_Meta_DEFAULT *BackupMeta + +func (p *CreateBackupResp) GetMeta() *BackupMeta { + if !p.IsSetMeta() { + return CreateBackupResp_Meta_DEFAULT + } + return p.Meta +} +func (p *CreateBackupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateBackupResp) IsSetMeta() bool { + return p != nil && p.Meta != nil +} + +func (p *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) ReadField3(iprot thrift.Protocol) error { + p.Meta = NewBackupMeta() + if err := p.Meta.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Meta), err) + } + return nil +} + +func (p *CreateBackupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateBackupResp"); 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta: ", p), err) + } + if err := p.Meta.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Meta), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta: ", p), err) + } + return err +} + +func (p *CreateBackupResp) 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) + } + var metaVal string + if p.Meta == nil { + metaVal = "" + } else { + metaVal = fmt.Sprintf("%v", p.Meta) + } + return fmt.Sprintf("CreateBackupResp({Code:%s Leader:%s Meta:%s})", codeVal, leaderVal, metaVal) +} + +// Attributes: +// - FromHost +// - ToHost +type HostPair struct { + FromHost *nebula0.HostAddr `thrift:"from_host,1" db:"from_host" json:"from_host"` + ToHost *nebula0.HostAddr `thrift:"to_host,2" db:"to_host" json:"to_host"` +} + +func NewHostPair() *HostPair { + return &HostPair{ + FromHost: nebula0.NewHostAddr(), + ToHost: nebula0.NewHostAddr(), + } +} + +var HostPair_FromHost_DEFAULT *nebula0.HostAddr + +func (p *HostPair) GetFromHost() *nebula0.HostAddr { + if !p.IsSetFromHost() { + return HostPair_FromHost_DEFAULT + } + return p.FromHost +} + +var HostPair_ToHost_DEFAULT *nebula0.HostAddr + +func (p *HostPair) GetToHost() *nebula0.HostAddr { + if !p.IsSetToHost() { + return HostPair_ToHost_DEFAULT + } + return p.ToHost +} +func (p *HostPair) IsSetFromHost() bool { + return p != nil && p.FromHost != nil +} + +func (p *HostPair) IsSetToHost() bool { + return p != nil && p.ToHost != nil +} + +func (p *HostPair) 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 *HostPair) ReadField1(iprot thrift.Protocol) error { + p.FromHost = nebula0.NewHostAddr() + if err := p.FromHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.FromHost), err) + } + return nil +} + +func (p *HostPair) ReadField2(iprot thrift.Protocol) error { + p.ToHost = nebula0.NewHostAddr() + if err := p.ToHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ToHost), err) + } + return nil +} + +func (p *HostPair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostPair"); 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 *HostPair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("from_host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:from_host: ", p), err) + } + if err := p.FromHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.FromHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:from_host: ", p), err) + } + return err +} + +func (p *HostPair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("to_host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:to_host: ", p), err) + } + if err := p.ToHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ToHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:to_host: ", p), err) + } + return err +} + +func (p *HostPair) String() string { + if p == nil { + return "" + } + + var fromHostVal string + if p.FromHost == nil { + fromHostVal = "" + } else { + fromHostVal = fmt.Sprintf("%v", p.FromHost) + } + var toHostVal string + if p.ToHost == nil { + toHostVal = "" + } else { + toHostVal = fmt.Sprintf("%v", p.ToHost) + } + return fmt.Sprintf("HostPair({FromHost:%s ToHost:%s})", fromHostVal, toHostVal) +} + +// Attributes: +// - Files +// - Hosts +type RestoreMetaReq struct { + Files [][]byte `thrift:"files,1" db:"files" json:"files"` + Hosts []*HostPair `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewRestoreMetaReq() *RestoreMetaReq { + return &RestoreMetaReq{} +} + +func (p *RestoreMetaReq) GetFiles() [][]byte { + return p.Files +} + +func (p *RestoreMetaReq) GetHosts() []*HostPair { + return p.Hosts +} +func (p *RestoreMetaReq) 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 *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Files = tSlice + for i := 0; i < size; i++ { + var _elem75 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem75 = v + } + p.Files = append(p.Files, _elem75) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostPair, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i++ { + _elem76 := NewHostPair() + if err := _elem76.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem76), err) + } + p.Hosts = append(p.Hosts, _elem76) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RestoreMetaReq"); 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 *RestoreMetaReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + 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:files: ", p), err) + } + return err +} + +func (p *RestoreMetaReq) 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 *RestoreMetaReq) String() string { + if p == nil { + return "" + } + + filesVal := fmt.Sprintf("%v", p.Files) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("RestoreMetaReq({Files:%s Hosts:%s})", filesVal, hostsVal) +} + +// Attributes: +// - Host +// - User +// - Pwd +type FTClient struct { + Host *nebula0.HostAddr `thrift:"host,1,required" db:"host" json:"host"` + User []byte `thrift:"user,2" db:"user" json:"user,omitempty"` + Pwd []byte `thrift:"pwd,3" db:"pwd" json:"pwd,omitempty"` +} + +func NewFTClient() *FTClient { + return &FTClient{ + Host: nebula0.NewHostAddr(), + } +} + +var FTClient_Host_DEFAULT *nebula0.HostAddr + +func (p *FTClient) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return FTClient_Host_DEFAULT + } + return p.Host +} + +var FTClient_User_DEFAULT []byte + +func (p *FTClient) GetUser() []byte { + return p.User +} + +var FTClient_Pwd_DEFAULT []byte + +func (p *FTClient) GetPwd() []byte { + return p.Pwd +} +func (p *FTClient) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *FTClient) IsSetUser() bool { + return p != nil && p.User != nil +} + +func (p *FTClient) IsSetPwd() bool { + return p != nil && p.Pwd != nil +} + +func (p *FTClient) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHost 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 + } + issetHost = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHost { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")) + } + return nil +} + +func (p *FTClient) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *FTClient) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.User = v + } + return nil +} + +func (p *FTClient) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Pwd = v + } + return nil +} + +func (p *FTClient) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTClient"); 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 *FTClient) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) + } + return err +} + +func (p *FTClient) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetUser() { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err) + } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err) + } + } + return err +} + +func (p *FTClient) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetPwd() { + if err := oprot.WriteFieldBegin("pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pwd: ", p), err) + } + if err := oprot.WriteBinary(p.Pwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pwd (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pwd: ", p), err) + } + } + return err +} + +func (p *FTClient) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + userVal := fmt.Sprintf("%v", p.User) + pwdVal := fmt.Sprintf("%v", p.Pwd) + return fmt.Sprintf("FTClient({Host:%s User:%s Pwd:%s})", hostVal, userVal, pwdVal) +} + +// Attributes: +// - Type +// - Clients +type SignInFTServiceReq struct { + Type FTServiceType `thrift:"type,1" db:"type" json:"type"` + Clients []*FTClient `thrift:"clients,2" db:"clients" json:"clients"` +} + +func NewSignInFTServiceReq() *SignInFTServiceReq { + return &SignInFTServiceReq{} +} + +func (p *SignInFTServiceReq) GetType() FTServiceType { + return p.Type +} + +func (p *SignInFTServiceReq) GetClients() []*FTClient { + return p.Clients +} +func (p *SignInFTServiceReq) 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 *SignInFTServiceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := FTServiceType(v) + p.Type = temp + } + return nil +} + +func (p *SignInFTServiceReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i++ { + _elem77 := NewFTClient() + if err := _elem77.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem77), err) + } + p.Clients = append(p.Clients, _elem77) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SignInFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignInFTServiceReq"); 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 *SignInFTServiceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *SignInFTServiceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:clients: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + 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:clients: ", p), err) + } + return err +} + +func (p *SignInFTServiceReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("SignInFTServiceReq({Type:%s Clients:%s})", typeVal, clientsVal) +} + +type SignOutFTServiceReq struct { +} + +func NewSignOutFTServiceReq() *SignOutFTServiceReq { + return &SignOutFTServiceReq{} +} + +func (p *SignOutFTServiceReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignOutFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignOutFTServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *SignOutFTServiceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("SignOutFTServiceReq({})") +} + +type ListFTClientsReq struct { +} + +func NewListFTClientsReq() *ListFTClientsReq { + return &ListFTClientsReq{} +} + +func (p *ListFTClientsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTClientsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListFTClientsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTClientsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Clients +type ListFTClientsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Clients []*FTClient `thrift:"clients,3" db:"clients" json:"clients"` +} + +func NewListFTClientsResp() *ListFTClientsResp { + return &ListFTClientsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListFTClientsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListFTClientsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListFTClientsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTClientsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListFTClientsResp) GetClients() []*FTClient { + return p.Clients +} +func (p *ListFTClientsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i++ { + _elem78 := NewFTClient() + if err := _elem78.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + } + p.Clients = append(p.Clients, _elem78) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListFTClientsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsResp"); 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:clients: ", p), err) + } + return err +} + +func (p *ListFTClientsResp) 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) + } + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("ListFTClientsResp({Code:%s Leader:%s Clients:%s})", codeVal, leaderVal, clientsVal) +} + +// Attributes: +// - SpaceID +// - DependSchema +// - Fields +type FTIndex struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + DependSchema *SchemaID `thrift:"depend_schema,2" db:"depend_schema" json:"depend_schema"` + Fields [][]byte `thrift:"fields,3" db:"fields" json:"fields"` +} + +func NewFTIndex() *FTIndex { + return &FTIndex{} +} + +func (p *FTIndex) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +var FTIndex_DependSchema_DEFAULT *SchemaID + +func (p *FTIndex) GetDependSchema() *SchemaID { + if !p.IsSetDependSchema() { + return FTIndex_DependSchema_DEFAULT + } + return p.DependSchema +} + +func (p *FTIndex) GetFields() [][]byte { + return p.Fields +} +func (p *FTIndex) IsSetDependSchema() bool { + return p != nil && p.DependSchema != nil +} + +func (p *FTIndex) 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 *FTIndex) 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 *FTIndex) ReadField2(iprot thrift.Protocol) error { + p.DependSchema = NewSchemaID() + if err := p.DependSchema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DependSchema), err) + } + return nil +} + +func (p *FTIndex) ReadField3(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.Fields = tSlice + for i := 0; i < size; i++ { + var _elem79 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem79 = v + } + p.Fields = append(p.Fields, _elem79) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *FTIndex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTIndex"); 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 *FTIndex) 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 *FTIndex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("depend_schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:depend_schema: ", p), err) + } + if err := p.DependSchema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DependSchema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:depend_schema: ", p), err) + } + return err +} + +func (p *FTIndex) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fields: ", p), err) + } + return err +} + +func (p *FTIndex) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var dependSchemaVal string + if p.DependSchema == nil { + dependSchemaVal = "" + } else { + dependSchemaVal = fmt.Sprintf("%v", p.DependSchema) + } + fieldsVal := fmt.Sprintf("%v", p.Fields) + return fmt.Sprintf("FTIndex({SpaceID:%s DependSchema:%s Fields:%s})", spaceIDVal, dependSchemaVal, fieldsVal) +} + +// Attributes: +// - FulltextIndexName +// - Index +type CreateFTIndexReq struct { + FulltextIndexName []byte `thrift:"fulltext_index_name,1" db:"fulltext_index_name" json:"fulltext_index_name"` + Index *FTIndex `thrift:"index,2" db:"index" json:"index"` +} + +func NewCreateFTIndexReq() *CreateFTIndexReq { + return &CreateFTIndexReq{ + Index: NewFTIndex(), + } +} + +func (p *CreateFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} + +var CreateFTIndexReq_Index_DEFAULT *FTIndex + +func (p *CreateFTIndexReq) GetIndex() *FTIndex { + if !p.IsSetIndex() { + return CreateFTIndexReq_Index_DEFAULT + } + return p.Index +} +func (p *CreateFTIndexReq) IsSetIndex() bool { + return p != nil && p.Index != nil +} + +func (p *CreateFTIndexReq) 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 *CreateFTIndexReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.FulltextIndexName = v + } + return nil +} + +func (p *CreateFTIndexReq) ReadField2(iprot thrift.Protocol) error { + p.Index = NewFTIndex() + if err := p.Index.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Index), err) + } + return nil +} + +func (p *CreateFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateFTIndexReq"); 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 *CreateFTIndexReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fulltext_index_name: ", p), err) + } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fulltext_index_name: ", p), err) + } + return err +} + +func (p *CreateFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index: ", p), err) + } + if err := p.Index.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Index), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index: ", p), err) + } + return err +} + +func (p *CreateFTIndexReq) String() string { + if p == nil { + return "" + } + + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + var indexVal string + if p.Index == nil { + indexVal = "" + } else { + indexVal = fmt.Sprintf("%v", p.Index) + } + return fmt.Sprintf("CreateFTIndexReq({FulltextIndexName:%s Index:%s})", fulltextIndexNameVal, indexVal) +} + +// Attributes: +// - SpaceID +// - FulltextIndexName +type DropFTIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + FulltextIndexName []byte `thrift:"fulltext_index_name,2" db:"fulltext_index_name" json:"fulltext_index_name"` +} + +func NewDropFTIndexReq() *DropFTIndexReq { + return &DropFTIndexReq{} +} + +func (p *DropFTIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} +func (p *DropFTIndexReq) 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 *DropFTIndexReq) 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 *DropFTIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.FulltextIndexName = v + } + return nil +} + +func (p *DropFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropFTIndexReq"); 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 *DropFTIndexReq) 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 *DropFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fulltext_index_name: ", p), err) + } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fulltext_index_name: ", p), err) + } + return err +} + +func (p *DropFTIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + return fmt.Sprintf("DropFTIndexReq({SpaceID:%s FulltextIndexName:%s})", spaceIDVal, fulltextIndexNameVal) +} + +type ListFTIndexesReq struct { +} + +func NewListFTIndexesReq() *ListFTIndexesReq { + return &ListFTIndexesReq{} +} + +func (p *ListFTIndexesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListFTIndexesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTIndexesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Indexes +type ListFTIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Indexes map[string]*FTIndex `thrift:"indexes,3" db:"indexes" json:"indexes"` +} + +func NewListFTIndexesResp() *ListFTIndexesResp { + return &ListFTIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListFTIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListFTIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListFTIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListFTIndexesResp) GetIndexes() map[string]*FTIndex { + return p.Indexes +} +func (p *ListFTIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*FTIndex, size) + p.Indexes = tMap + for i := 0; i < size; i++ { + var _key80 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key80 = v + } + _val81 := NewFTIndex() + if err := _val81.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val81), err) + } + p.Indexes[_key80] = _val81 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListFTIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesResp"); 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indexes", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indexes: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Indexes)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Indexes { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indexes: ", p), err) + } + return err +} + +func (p *ListFTIndexesResp) 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) + } + indexesVal := fmt.Sprintf("%v", p.Indexes) + return fmt.Sprintf("ListFTIndexesResp({Code:%s Leader:%s Indexes:%s})", codeVal, leaderVal, indexesVal) +} + +// Attributes: +// - StartTime +// - Status +// - Duration +// - Query +// - GraphAddr +type QueryDesc struct { + StartTime nebula0.Timestamp `thrift:"start_time,1" db:"start_time" json:"start_time"` + Status QueryStatus `thrift:"status,2" db:"status" json:"status"` + Duration int64 `thrift:"duration,3" db:"duration" json:"duration"` + Query []byte `thrift:"query,4" db:"query" json:"query"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,5" db:"graph_addr" json:"graph_addr"` +} + +func NewQueryDesc() *QueryDesc { + return &QueryDesc{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *QueryDesc) GetStartTime() nebula0.Timestamp { + return p.StartTime +} + +func (p *QueryDesc) GetStatus() QueryStatus { + return p.Status +} + +func (p *QueryDesc) GetDuration() int64 { + return p.Duration +} + +func (p *QueryDesc) GetQuery() []byte { + return p.Query +} + +var QueryDesc_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *QueryDesc) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return QueryDesc_GraphAddr_DEFAULT + } + return p.GraphAddr +} +func (p *QueryDesc) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *QueryDesc) 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 + } + 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 *QueryDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.Timestamp(v) + p.StartTime = temp + } + return nil +} + +func (p *QueryDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := QueryStatus(v) + p.Status = temp + } + return nil +} + +func (p *QueryDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Duration = v + } + return nil +} + +func (p *QueryDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Query = v + } + return nil +} + +func (p *QueryDesc) ReadField5(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *QueryDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("QueryDesc"); 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 *QueryDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_time: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("duration", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err) + } + if err := oprot.WriteI64(int64(p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:query: ", p), err) + } + if err := oprot.WriteBinary(p.Query); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.query (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:query: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:graph_addr: ", p), err) + } + return err +} + +func (p *QueryDesc) String() string { + if p == nil { + return "" + } + + startTimeVal := fmt.Sprintf("%v", p.StartTime) + statusVal := fmt.Sprintf("%v", p.Status) + durationVal := fmt.Sprintf("%v", p.Duration) + queryVal := fmt.Sprintf("%v", p.Query) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + return fmt.Sprintf("QueryDesc({StartTime:%s Status:%s Duration:%s Query:%s GraphAddr:%s})", startTimeVal, statusVal, durationVal, queryVal, graphAddrVal) +} + +// Attributes: +// - SessionID +// - CreateTime +// - UpdateTime +// - UserName +// - SpaceName +// - GraphAddr +// - Timezone +// - ClientIP +// - Configs +// - Queries +type Session struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` + CreateTime nebula0.Timestamp `thrift:"create_time,2" db:"create_time" json:"create_time"` + UpdateTime nebula0.Timestamp `thrift:"update_time,3" db:"update_time" json:"update_time"` + UserName []byte `thrift:"user_name,4" db:"user_name" json:"user_name"` + SpaceName []byte `thrift:"space_name,5" db:"space_name" json:"space_name"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,6" db:"graph_addr" json:"graph_addr"` + Timezone int32 `thrift:"timezone,7" db:"timezone" json:"timezone"` + ClientIP []byte `thrift:"client_ip,8" db:"client_ip" json:"client_ip"` + Configs map[string]*nebula0.Value `thrift:"configs,9" db:"configs" json:"configs"` + Queries map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"queries,10" db:"queries" json:"queries"` +} + +func NewSession() *Session { + return &Session{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *Session) GetSessionID() nebula0.SessionID { + return p.SessionID +} + +func (p *Session) GetCreateTime() nebula0.Timestamp { + return p.CreateTime +} + +func (p *Session) GetUpdateTime() nebula0.Timestamp { + return p.UpdateTime +} + +func (p *Session) GetUserName() []byte { + return p.UserName +} + +func (p *Session) GetSpaceName() []byte { + return p.SpaceName +} + +var Session_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *Session) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return Session_GraphAddr_DEFAULT + } + return p.GraphAddr +} + +func (p *Session) GetTimezone() int32 { + return p.Timezone +} + +func (p *Session) GetClientIP() []byte { + return p.ClientIP +} + +func (p *Session) GetConfigs() map[string]*nebula0.Value { + return p.Configs +} + +func (p *Session) GetQueries() map[nebula0.ExecutionPlanID]*QueryDesc { + return p.Queries +} +func (p *Session) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *Session) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *Session) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *Session) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.Timestamp(v) + p.CreateTime = temp + } + return nil +} + +func (p *Session) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.Timestamp(v) + p.UpdateTime = temp + } + return nil +} + +func (p *Session) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.UserName = v + } + return nil +} + +func (p *Session) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *Session) ReadField6(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *Session) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.Timezone = v + } + return nil +} + +func (p *Session) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.ClientIP = v + } + return nil +} + +func (p *Session) ReadField9(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula0.Value, size) + p.Configs = tMap + for i := 0; i < size; i++ { + var _key82 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key82 = v + } + _val83 := nebula0.NewValue() + if err := _val83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val83), err) + } + p.Configs[_key82] = _val83 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) ReadField10(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.Queries = tMap + for i := 0; i < size; i++ { + var _key84 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _key84 = temp + } + _val85 := NewQueryDesc() + if err := _val85.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val85), err) + } + p.Queries[_key84] = _val85 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Session"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *Session) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *Session) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:create_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:create_time: ", p), err) + } + return err +} + +func (p *Session) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("update_time", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:update_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.UpdateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_time (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update_time: ", p), err) + } + return err +} + +func (p *Session) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) + } + if err := oprot.WriteBinary(p.UserName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) + } + return err +} + +func (p *Session) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:space_name: ", p), err) + } + return err +} + +func (p *Session) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:graph_addr: ", p), err) + } + return err +} + +func (p *Session) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("timezone", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timezone: ", p), err) + } + if err := oprot.WriteI32(int32(p.Timezone)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timezone (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timezone: ", p), err) + } + return err +} + +func (p *Session) writeField8(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:client_ip: ", p), err) + } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:client_ip: ", p), err) + } + return err +} + +func (p *Session) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("configs", thrift.MAP, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:configs: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Configs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:configs: ", p), err) + } + return err +} + +func (p *Session) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("queries", thrift.MAP, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.Queries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Queries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:queries: ", p), err) + } + return err +} + +func (p *Session) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + updateTimeVal := fmt.Sprintf("%v", p.UpdateTime) + userNameVal := fmt.Sprintf("%v", p.UserName) + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + timezoneVal := fmt.Sprintf("%v", p.Timezone) + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + configsVal := fmt.Sprintf("%v", p.Configs) + queriesVal := fmt.Sprintf("%v", p.Queries) + return fmt.Sprintf("Session({SessionID:%s CreateTime:%s UpdateTime:%s UserName:%s SpaceName:%s GraphAddr:%s Timezone:%s ClientIP:%s Configs:%s Queries:%s})", sessionIDVal, createTimeVal, updateTimeVal, userNameVal, spaceNameVal, graphAddrVal, timezoneVal, clientIPVal, configsVal, queriesVal) +} + +// Attributes: +// - User +// - GraphAddr +// - ClientIP +type CreateSessionReq struct { + User []byte `thrift:"user,1" db:"user" json:"user"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,2" db:"graph_addr" json:"graph_addr"` + ClientIP []byte `thrift:"client_ip,3" db:"client_ip" json:"client_ip"` +} + +func NewCreateSessionReq() *CreateSessionReq { + return &CreateSessionReq{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *CreateSessionReq) GetUser() []byte { + return p.User +} + +var CreateSessionReq_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *CreateSessionReq) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return CreateSessionReq_GraphAddr_DEFAULT + } + return p.GraphAddr +} + +func (p *CreateSessionReq) GetClientIP() []byte { + return p.ClientIP +} +func (p *CreateSessionReq) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *CreateSessionReq) 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 *CreateSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.User = v + } + return nil +} + +func (p *CreateSessionReq) ReadField2(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ClientIP = v + } + return nil +} + +func (p *CreateSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionReq"); 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 *CreateSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user: ", p), err) + } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user: ", p), err) + } + return err +} + +func (p *CreateSessionReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:graph_addr: ", p), err) + } + return err +} + +func (p *CreateSessionReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_ip: ", p), err) + } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_ip: ", p), err) + } + return err +} + +func (p *CreateSessionReq) String() string { + if p == nil { + return "" + } + + userVal := fmt.Sprintf("%v", p.User) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + return fmt.Sprintf("CreateSessionReq({User:%s GraphAddr:%s ClientIP:%s})", userVal, graphAddrVal, clientIPVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type CreateSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewCreateSessionResp() *CreateSessionResp { + return &CreateSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + +func (p *CreateSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var CreateSessionResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *CreateSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateSessionResp_Leader_DEFAULT + } + return p.Leader +} + +var CreateSessionResp_Session_DEFAULT *Session + +func (p *CreateSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return CreateSessionResp_Session_DEFAULT + } + return p.Session +} +func (p *CreateSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *CreateSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionResp"); 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) + } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) + } + return err +} + +func (p *CreateSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("CreateSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - Sessions +type UpdateSessionsReq struct { + Sessions []*Session `thrift:"sessions,1" db:"sessions" json:"sessions"` +} + +func NewUpdateSessionsReq() *UpdateSessionsReq { + return &UpdateSessionsReq{} +} + +func (p *UpdateSessionsReq) GetSessions() []*Session { + return p.Sessions +} +func (p *UpdateSessionsReq) 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 *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i++ { + _elem86 := NewSession() + if err := _elem86.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem86), err) + } + p.Sessions = append(p.Sessions, _elem86) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsReq"); 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 *UpdateSessionsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessions: ", p), err) + } + return err +} + +func (p *UpdateSessionsReq) String() string { + if p == nil { + return "" + } + + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("UpdateSessionsReq({Sessions:%s})", sessionsVal) +} + +// Attributes: +// - Code +// - Leader +// - KilledQueries +type UpdateSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + KilledQueries map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"killed_queries,3" db:"killed_queries" json:"killed_queries"` +} + +func NewUpdateSessionsResp() *UpdateSessionsResp { + return &UpdateSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *UpdateSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var UpdateSessionsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *UpdateSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return UpdateSessionsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *UpdateSessionsResp) GetKilledQueries() map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc { + return p.KilledQueries +} +func (p *UpdateSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.KilledQueries = tMap + for i := 0; i < size; i++ { + var _key87 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.SessionID(v) + _key87 = temp + } + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + _val88 := tMap + for i := 0; i < size; i++ { + var _key89 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _key89 = temp + } + _val90 := NewQueryDesc() + if err := _val90.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val90), err) + } + _val88[_key89] = _val90 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.KilledQueries[_key87] = _val88 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *UpdateSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsResp"); 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("killed_queries", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:killed_queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.MAP, len(p.KilledQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KilledQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:killed_queries: ", p), err) + } + return err +} + +func (p *UpdateSessionsResp) 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) + } + killedQueriesVal := fmt.Sprintf("%v", p.KilledQueries) + return fmt.Sprintf("UpdateSessionsResp({Code:%s Leader:%s KilledQueries:%s})", codeVal, leaderVal, killedQueriesVal) +} + +type ListSessionsReq struct { +} + +func NewListSessionsReq() *ListSessionsReq { + return &ListSessionsReq{} +} + +func (p *ListSessionsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSessionsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSessionsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Sessions +type ListSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Sessions []*Session `thrift:"sessions,3" db:"sessions" json:"sessions"` +} + +func NewListSessionsResp() *ListSessionsResp { + return &ListSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSessionsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSessionsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSessionsResp) GetSessions() []*Session { + return p.Sessions +} +func (p *ListSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i++ { + _elem91 := NewSession() + if err := _elem91.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) + } + p.Sessions = append(p.Sessions, _elem91) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsResp"); 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessions: ", p), err) + } + return err +} + +func (p *ListSessionsResp) 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) + } + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("ListSessionsResp({Code:%s Leader:%s Sessions:%s})", codeVal, leaderVal, sessionsVal) +} + +// Attributes: +// - SessionID +type GetSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewGetSessionReq() *GetSessionReq { + return &GetSessionReq{} +} + +func (p *GetSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *GetSessionReq) 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 *GetSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *GetSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionReq"); 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 *GetSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *GetSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("GetSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type GetSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewGetSessionResp() *GetSessionResp { + return &GetSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + +func (p *GetSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetSessionResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSessionResp_Leader_DEFAULT + } + return p.Leader +} + +var GetSessionResp_Session_DEFAULT *Session + +func (p *GetSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return GetSessionResp_Session_DEFAULT + } + return p.Session +} +func (p *GetSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *GetSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionResp"); 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) + } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) + } + return err +} + +func (p *GetSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("GetSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - SessionID +type RemoveSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewRemoveSessionReq() *RemoveSessionReq { + return &RemoveSessionReq{} +} + +func (p *RemoveSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *RemoveSessionReq) 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 *RemoveSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *RemoveSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveSessionReq"); 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 *RemoveSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *RemoveSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("RemoveSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - KillQueries +type KillQueryReq struct { + KillQueries map[nebula0.SessionID][]nebula0.ExecutionPlanID `thrift:"kill_queries,1" db:"kill_queries" json:"kill_queries"` +} + +func NewKillQueryReq() *KillQueryReq { + return &KillQueryReq{} +} + +func (p *KillQueryReq) GetKillQueries() map[nebula0.SessionID][]nebula0.ExecutionPlanID { + return p.KillQueries +} +func (p *KillQueryReq) 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 *KillQueryReq) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID][]nebula0.ExecutionPlanID, size) + p.KillQueries = tMap + for i := 0; i < size; i++ { + var _key92 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.SessionID(v) + _key92 = temp + } + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]nebula0.ExecutionPlanID, 0, size) + _val93 := tSet + for i := 0; i < size; i++ { + var _elem94 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _elem94 = temp + } + _val93 = append(_val93, _elem94) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.KillQueries[_key92] = _val93 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KillQueryReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KillQueryReq"); 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 *KillQueryReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kill_queries", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kill_queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.SET, len(p.KillQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KillQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I64, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[nebula0.ExecutionPlanID]bool, len(v)) + for _, v := range v { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range v { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kill_queries: ", p), err) + } + return err +} + +func (p *KillQueryReq) String() string { + if p == nil { + return "" + } + + killQueriesVal := fmt.Sprintf("%v", p.KillQueries) + return fmt.Sprintf("KillQueryReq({KillQueries:%s})", killQueriesVal) +} + +// Attributes: +// - Code +// - JobID +// - TaskID +// - Statis +type ReportTaskReq struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Statis *StatisItem `thrift:"statis,4" db:"statis" json:"statis,omitempty"` +} + +func NewReportTaskReq() *ReportTaskReq { + return &ReportTaskReq{} +} + +func (p *ReportTaskReq) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *ReportTaskReq) GetJobID() int32 { + return p.JobID +} + +func (p *ReportTaskReq) GetTaskID() int32 { + return p.TaskID +} + +var ReportTaskReq_Statis_DEFAULT *StatisItem + +func (p *ReportTaskReq) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return ReportTaskReq_Statis_DEFAULT + } + return p.Statis +} +func (p *ReportTaskReq) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *ReportTaskReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.JobID = v + } + return nil +} + +func (p *ReportTaskReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TaskID = v + } + return nil +} + +func (p *ReportTaskReq) ReadField4(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *ReportTaskReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ReportTaskReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) + } + return err +} + +func (p *ReportTaskReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) + } + return err +} + +func (p *ReportTaskReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:statis: ", p), err) + } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:statis: ", p), err) + } + } + return err +} + +func (p *ReportTaskReq) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("ReportTaskReq({Code:%s JobID:%s TaskID:%s Statis:%s})", codeVal, jobIDVal, taskIDVal, statisVal) +} + +// Attributes: +// - Code +// - Leader +// - MetaServers +// - StorageServers +type ListClusterInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + MetaServers []*nebula0.HostAddr `thrift:"meta_servers,3" db:"meta_servers" json:"meta_servers"` + StorageServers []*nebula0.NodeInfo `thrift:"storage_servers,4" db:"storage_servers" json:"storage_servers"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListClusterInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListClusterInfoResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListClusterInfoResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListClusterInfoResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListClusterInfoResp) GetMetaServers() []*nebula0.HostAddr { + return p.MetaServers +} + +func (p *ListClusterInfoResp) GetStorageServers() []*nebula0.NodeInfo { + return p.StorageServers +} +func (p *ListClusterInfoResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListClusterInfoResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField3(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.MetaServers = tSlice + for i := 0; i < size; i++ { + _elem95 := nebula0.NewHostAddr() + if err := _elem95.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) + } + p.MetaServers = append(p.MetaServers, _elem95) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.NodeInfo, 0, size) + p.StorageServers = tSlice + for i := 0; i < size; i++ { + _elem96 := nebula0.NewNodeInfo() + if err := _elem96.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem96), err) + } + p.StorageServers = append(p.StorageServers, _elem96) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_servers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta_servers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MetaServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta_servers: ", p), err) + } + return err +} + +func (p *ListClusterInfoResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("storage_servers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:storage_servers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorageServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorageServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:storage_servers: ", p), err) + } + return err +} + +func (p *ListClusterInfoResp) 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) + } + metaServersVal := fmt.Sprintf("%v", p.MetaServers) + storageServersVal := fmt.Sprintf("%v", p.StorageServers) + return fmt.Sprintf("ListClusterInfoResp({Code:%s Leader:%s MetaServers:%s StorageServers:%s})", codeVal, leaderVal, metaServersVal, storageServersVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - Code +// - Dir +type GetMetaDirInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewGetMetaDirInfoResp() *GetMetaDirInfoResp { + return &GetMetaDirInfoResp{ + Dir: nebula0.NewDirInfo(), + } +} + +func (p *GetMetaDirInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetMetaDirInfoResp_Dir_DEFAULT *nebula0.DirInfo + +func (p *GetMetaDirInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return GetMetaDirInfoResp_Dir_DEFAULT + } + return p.Dir +} +func (p *GetMetaDirInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *GetMetaDirInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoResp"); 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) + } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) + } + return err +} + +func (p *GetMetaDirInfoResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("GetMetaDirInfoResp({Code:%s Dir:%s})", codeVal, dirVal) +} + +type GetMetaDirInfoReq struct { +} + +func NewGetMetaDirInfoReq() *GetMetaDirInfoReq { + return &GetMetaDirInfoReq{} +} + +func (p *GetMetaDirInfoReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetMetaDirInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *GetMetaDirInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetMetaDirInfoReq({})") +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/constants.go b/ccore/nebula/internal/thrift/v2_5_0/storage/constants.go new file mode 100644 index 0000000..093dc3e --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/constants.go @@ -0,0 +1,30 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/general_storage_service-remote/general_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_5_0/storage/general_storage_service-remote/general_storage_service-remote.go new file mode 100755 index 0000000..471d32f --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/general_storage_service-remote/general_storage_service-remote.go @@ -0,0 +1,202 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " KVGetResponse get(KVGetRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse put(KVPutRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse remove(KVRemoveRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGeneralStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg258 := flag.Arg(1) + mbTrans259 := thrift.NewMemoryBufferLen(len(arg258)) + defer mbTrans259.Close() + _, err260 := mbTrans259.WriteString(arg258) + if err260 != nil { + Usage() + return + } + factory261 := thrift.NewSimpleJSONProtocolFactory() + jsProt262 := factory261.GetProtocol(mbTrans259) + argvalue0 := storage.NewKVGetRequest() + err263 := argvalue0.Read(jsProt262) + if err263 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "put": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg264 := flag.Arg(1) + mbTrans265 := thrift.NewMemoryBufferLen(len(arg264)) + defer mbTrans265.Close() + _, err266 := mbTrans265.WriteString(arg264) + if err266 != nil { + Usage() + return + } + factory267 := thrift.NewSimpleJSONProtocolFactory() + jsProt268 := factory267.GetProtocol(mbTrans265) + argvalue0 := storage.NewKVPutRequest() + err269 := argvalue0.Read(jsProt268) + if err269 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg270 := flag.Arg(1) + mbTrans271 := thrift.NewMemoryBufferLen(len(arg270)) + defer mbTrans271.Close() + _, err272 := mbTrans271.WriteString(arg270) + if err272 != nil { + Usage() + return + } + factory273 := thrift.NewSimpleJSONProtocolFactory() + jsProt274 := factory273.GetProtocol(mbTrans271) + argvalue0 := storage.NewKVRemoveRequest() + err275 := argvalue0.Read(jsProt274) + if err275 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/generalstorageservice.go b/ccore/nebula/internal/thrift/v2_5_0/storage/generalstorageservice.go new file mode 100644 index 0000000..186e9db --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/generalstorageservice.go @@ -0,0 +1,1086 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GeneralStorageService interface { + // Parameters: + // - Req + Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + Get(req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GeneralStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GeneralStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GeneralStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceClientProtocol(prot thrift.Protocol) *GeneralStorageServiceClient { + return NewGeneralStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceThreadsafeClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GeneralStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GeneralStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GeneralStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return NewGeneralStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GeneralStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GeneralStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GeneralStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGeneralStorageServiceChannelClient(channel thrift.RequestChannel) *GeneralStorageServiceChannelClient { + return &GeneralStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + var result GeneralStorageServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + var result GeneralStorageServicePutResult + err = p.RequestChannel.Call(ctx, "put", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + var result GeneralStorageServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GeneralStorageService +} + +func (p *GeneralStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GeneralStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GeneralStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGeneralStorageServiceProcessor(handler GeneralStorageService) *GeneralStorageServiceProcessor { + self256 := &GeneralStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self256.processorMap["get"] = &generalStorageServiceProcessorGet{handler:handler} + self256.processorMap["put"] = &generalStorageServiceProcessorPut{handler:handler} + self256.processorMap["remove"] = &generalStorageServiceProcessorRemove{handler:handler} + return self256 +} + +type generalStorageServiceProcessorGet struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceGetArgs) + var result GeneralStorageServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorPut struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServicePutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("put", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServicePutArgs) + var result GeneralStorageServicePutResult + if retval, err := p.handler.Put(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorRemove struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceRemoveArgs) + var result GeneralStorageServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GeneralStorageServiceGetArgs struct { + thrift.IRequest + Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceGetArgs() *GeneralStorageServiceGetArgs { + return &GeneralStorageServiceGetArgs{ + Req: NewKVGetRequest(), + } +} + +var GeneralStorageServiceGetArgs_Req_DEFAULT *KVGetRequest +func (p *GeneralStorageServiceGetArgs) GetReq() *KVGetRequest { + if !p.IsSetReq() { + return GeneralStorageServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceGetArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVGetRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceGetResult struct { + thrift.IResponse + Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceGetResult() *GeneralStorageServiceGetResult { + return &GeneralStorageServiceGetResult{} +} + +var GeneralStorageServiceGetResult_Success_DEFAULT *KVGetResponse +func (p *GeneralStorageServiceGetResult) GetSuccess() *KVGetResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceGetResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewKVGetResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServicePutArgs struct { + thrift.IRequest + Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServicePutArgs() *GeneralStorageServicePutArgs { + return &GeneralStorageServicePutArgs{ + Req: NewKVPutRequest(), + } +} + +var GeneralStorageServicePutArgs_Req_DEFAULT *KVPutRequest +func (p *GeneralStorageServicePutArgs) GetReq() *KVPutRequest { + if !p.IsSetReq() { + return GeneralStorageServicePutArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServicePutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServicePutArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVPutRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServicePutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServicePutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServicePutResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServicePutResult() *GeneralStorageServicePutResult { + return &GeneralStorageServicePutResult{} +} + +var GeneralStorageServicePutResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServicePutResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServicePutResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServicePutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServicePutResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServicePutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServicePutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServiceRemoveArgs struct { + thrift.IRequest + Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceRemoveArgs() *GeneralStorageServiceRemoveArgs { + return &GeneralStorageServiceRemoveArgs{ + Req: NewKVRemoveRequest(), + } +} + +var GeneralStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest +func (p *GeneralStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { + if !p.IsSetReq() { + return GeneralStorageServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVRemoveRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceRemoveResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceRemoveResult() *GeneralStorageServiceRemoveResult { + return &GeneralStorageServiceRemoveResult{} +} + +var GeneralStorageServiceRemoveResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServiceRemoveResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceRemoveResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/graph_storage_service-remote/graph_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_5_0/storage/graph_storage_service-remote/graph_storage_service-remote.go new file mode 100755 index 0000000..fa601cb --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -0,0 +1,488 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse getNeighbors(GetNeighborsRequest req)") + fmt.Fprintln(os.Stderr, " GetPropResponse getProps(GetPropRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addVertices(AddVerticesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteEdges(DeleteEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteVertices(DeleteVerticesRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateVertex(UpdateVertexRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ScanVertexResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanEdgeResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") + fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdgesAtomic(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGraphStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "getNeighbors": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") + flag.Usage() + } + arg74 := flag.Arg(1) + mbTrans75 := thrift.NewMemoryBufferLen(len(arg74)) + defer mbTrans75.Close() + _, err76 := mbTrans75.WriteString(arg74) + if err76 != nil { + Usage() + return + } + factory77 := thrift.NewSimpleJSONProtocolFactory() + jsProt78 := factory77.GetProtocol(mbTrans75) + argvalue0 := storage.NewGetNeighborsRequest() + err79 := argvalue0.Read(jsProt78) + if err79 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetNeighbors(value0)) + fmt.Print("\n") + break + case "getProps": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetProps requires 1 args") + flag.Usage() + } + arg80 := flag.Arg(1) + mbTrans81 := thrift.NewMemoryBufferLen(len(arg80)) + defer mbTrans81.Close() + _, err82 := mbTrans81.WriteString(arg80) + if err82 != nil { + Usage() + return + } + factory83 := thrift.NewSimpleJSONProtocolFactory() + jsProt84 := factory83.GetProtocol(mbTrans81) + argvalue0 := storage.NewGetPropRequest() + err85 := argvalue0.Read(jsProt84) + if err85 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetProps(value0)) + fmt.Print("\n") + break + case "addVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") + flag.Usage() + } + arg86 := flag.Arg(1) + mbTrans87 := thrift.NewMemoryBufferLen(len(arg86)) + defer mbTrans87.Close() + _, err88 := mbTrans87.WriteString(arg86) + if err88 != nil { + Usage() + return + } + factory89 := thrift.NewSimpleJSONProtocolFactory() + jsProt90 := factory89.GetProtocol(mbTrans87) + argvalue0 := storage.NewAddVerticesRequest() + err91 := argvalue0.Read(jsProt90) + if err91 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddVertices(value0)) + fmt.Print("\n") + break + case "addEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") + flag.Usage() + } + arg92 := flag.Arg(1) + mbTrans93 := thrift.NewMemoryBufferLen(len(arg92)) + defer mbTrans93.Close() + _, err94 := mbTrans93.WriteString(arg92) + if err94 != nil { + Usage() + return + } + factory95 := thrift.NewSimpleJSONProtocolFactory() + jsProt96 := factory95.GetProtocol(mbTrans93) + argvalue0 := storage.NewAddEdgesRequest() + err97 := argvalue0.Read(jsProt96) + if err97 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdges(value0)) + fmt.Print("\n") + break + case "deleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") + flag.Usage() + } + arg98 := flag.Arg(1) + mbTrans99 := thrift.NewMemoryBufferLen(len(arg98)) + defer mbTrans99.Close() + _, err100 := mbTrans99.WriteString(arg98) + if err100 != nil { + Usage() + return + } + factory101 := thrift.NewSimpleJSONProtocolFactory() + jsProt102 := factory101.GetProtocol(mbTrans99) + argvalue0 := storage.NewDeleteEdgesRequest() + err103 := argvalue0.Read(jsProt102) + if err103 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteEdges(value0)) + fmt.Print("\n") + break + case "deleteVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") + flag.Usage() + } + arg104 := flag.Arg(1) + mbTrans105 := thrift.NewMemoryBufferLen(len(arg104)) + defer mbTrans105.Close() + _, err106 := mbTrans105.WriteString(arg104) + if err106 != nil { + Usage() + return + } + factory107 := thrift.NewSimpleJSONProtocolFactory() + jsProt108 := factory107.GetProtocol(mbTrans105) + argvalue0 := storage.NewDeleteVerticesRequest() + err109 := argvalue0.Read(jsProt108) + if err109 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteVertices(value0)) + fmt.Print("\n") + break + case "updateVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") + flag.Usage() + } + arg110 := flag.Arg(1) + mbTrans111 := thrift.NewMemoryBufferLen(len(arg110)) + defer mbTrans111.Close() + _, err112 := mbTrans111.WriteString(arg110) + if err112 != nil { + Usage() + return + } + factory113 := thrift.NewSimpleJSONProtocolFactory() + jsProt114 := factory113.GetProtocol(mbTrans111) + argvalue0 := storage.NewUpdateVertexRequest() + err115 := argvalue0.Read(jsProt114) + if err115 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateVertex(value0)) + fmt.Print("\n") + break + case "updateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") + flag.Usage() + } + arg116 := flag.Arg(1) + mbTrans117 := thrift.NewMemoryBufferLen(len(arg116)) + defer mbTrans117.Close() + _, err118 := mbTrans117.WriteString(arg116) + if err118 != nil { + Usage() + return + } + factory119 := thrift.NewSimpleJSONProtocolFactory() + jsProt120 := factory119.GetProtocol(mbTrans117) + argvalue0 := storage.NewUpdateEdgeRequest() + err121 := argvalue0.Read(jsProt120) + if err121 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateEdge(value0)) + fmt.Print("\n") + break + case "scanVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") + flag.Usage() + } + arg122 := flag.Arg(1) + mbTrans123 := thrift.NewMemoryBufferLen(len(arg122)) + defer mbTrans123.Close() + _, err124 := mbTrans123.WriteString(arg122) + if err124 != nil { + Usage() + return + } + factory125 := thrift.NewSimpleJSONProtocolFactory() + jsProt126 := factory125.GetProtocol(mbTrans123) + argvalue0 := storage.NewScanVertexRequest() + err127 := argvalue0.Read(jsProt126) + if err127 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanVertex(value0)) + fmt.Print("\n") + break + case "scanEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") + flag.Usage() + } + arg128 := flag.Arg(1) + mbTrans129 := thrift.NewMemoryBufferLen(len(arg128)) + defer mbTrans129.Close() + _, err130 := mbTrans129.WriteString(arg128) + if err130 != nil { + Usage() + return + } + factory131 := thrift.NewSimpleJSONProtocolFactory() + jsProt132 := factory131.GetProtocol(mbTrans129) + argvalue0 := storage.NewScanEdgeRequest() + err133 := argvalue0.Read(jsProt132) + if err133 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanEdge(value0)) + fmt.Print("\n") + break + case "getUUID": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") + flag.Usage() + } + arg134 := flag.Arg(1) + mbTrans135 := thrift.NewMemoryBufferLen(len(arg134)) + defer mbTrans135.Close() + _, err136 := mbTrans135.WriteString(arg134) + if err136 != nil { + Usage() + return + } + factory137 := thrift.NewSimpleJSONProtocolFactory() + jsProt138 := factory137.GetProtocol(mbTrans135) + argvalue0 := storage.NewGetUUIDReq() + err139 := argvalue0.Read(jsProt138) + if err139 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUUID(value0)) + fmt.Print("\n") + break + case "lookupIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") + flag.Usage() + } + arg140 := flag.Arg(1) + mbTrans141 := thrift.NewMemoryBufferLen(len(arg140)) + defer mbTrans141.Close() + _, err142 := mbTrans141.WriteString(arg140) + if err142 != nil { + Usage() + return + } + factory143 := thrift.NewSimpleJSONProtocolFactory() + jsProt144 := factory143.GetProtocol(mbTrans141) + argvalue0 := storage.NewLookupIndexRequest() + err145 := argvalue0.Read(jsProt144) + if err145 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupIndex(value0)) + fmt.Print("\n") + break + case "lookupAndTraverse": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") + flag.Usage() + } + arg146 := flag.Arg(1) + mbTrans147 := thrift.NewMemoryBufferLen(len(arg146)) + defer mbTrans147.Close() + _, err148 := mbTrans147.WriteString(arg146) + if err148 != nil { + Usage() + return + } + factory149 := thrift.NewSimpleJSONProtocolFactory() + jsProt150 := factory149.GetProtocol(mbTrans147) + argvalue0 := storage.NewLookupAndTraverseRequest() + err151 := argvalue0.Read(jsProt150) + if err151 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupAndTraverse(value0)) + fmt.Print("\n") + break + case "addEdgesAtomic": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdgesAtomic requires 1 args") + flag.Usage() + } + arg152 := flag.Arg(1) + mbTrans153 := thrift.NewMemoryBufferLen(len(arg152)) + defer mbTrans153.Close() + _, err154 := mbTrans153.WriteString(arg152) + if err154 != nil { + Usage() + return + } + factory155 := thrift.NewSimpleJSONProtocolFactory() + jsProt156 := factory155.GetProtocol(mbTrans153) + argvalue0 := storage.NewAddEdgesRequest() + err157 := argvalue0.Read(jsProt156) + if err157 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdgesAtomic(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/graphstorageservice.go b/ccore/nebula/internal/thrift/v2_5_0/storage/graphstorageservice.go new file mode 100644 index 0000000..940d44b --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/graphstorageservice.go @@ -0,0 +1,4518 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GraphStorageService interface { + // Parameters: + // - Req + GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + AddEdgesAtomic(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceClientProtocol(prot thrift.Protocol) *GraphStorageServiceClient { + return NewGraphStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdgesAtomic", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdgesAtomic() +} + + +func (p *GraphStorageServiceClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesAtomicResult + err = p.CC.RecvMsg("addEdgesAtomic", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceThreadsafeClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return NewGraphStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdgesAtomic", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdgesAtomic() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesAtomicResult + err = p.CC.RecvMsg("addEdgesAtomic", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphStorageServiceChannelClient(channel thrift.RequestChannel) *GraphStorageServiceChannelClient { + return &GraphStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + var result GraphStorageServiceGetNeighborsResult + err = p.RequestChannel.Call(ctx, "getNeighbors", &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) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + var result GraphStorageServiceGetPropsResult + err = p.RequestChannel.Call(ctx, "getProps", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + var result GraphStorageServiceAddVerticesResult + err = p.RequestChannel.Call(ctx, "addVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + var result GraphStorageServiceAddEdgesResult + err = p.RequestChannel.Call(ctx, "addEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteEdgesResult + err = p.RequestChannel.Call(ctx, "deleteEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteVerticesResult + err = p.RequestChannel.Call(ctx, "deleteVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + var result GraphStorageServiceUpdateVertexResult + err = p.RequestChannel.Call(ctx, "updateVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + var result GraphStorageServiceUpdateEdgeResult + err = p.RequestChannel.Call(ctx, "updateEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + var result GraphStorageServiceScanVertexResult + err = p.RequestChannel.Call(ctx, "scanVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + var result GraphStorageServiceScanEdgeResult + err = p.RequestChannel.Call(ctx, "scanEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + var result GraphStorageServiceGetUUIDResult + err = p.RequestChannel.Call(ctx, "getUUID", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + var result GraphStorageServiceLookupIndexResult + err = p.RequestChannel.Call(ctx, "lookupIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + var result GraphStorageServiceLookupAndTraverseResult + err = p.RequestChannel.Call(ctx, "lookupAndTraverse", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddEdgesAtomic(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + var result GraphStorageServiceAddEdgesAtomicResult + err = p.RequestChannel.Call(ctx, "addEdgesAtomic", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphStorageService +} + +func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { + self72 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self72.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self72.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self72.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self72.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self72.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self72.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self72.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self72.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self72.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self72.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self72.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self72.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self72.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self72.processorMap["addEdgesAtomic"] = &graphStorageServiceProcessorAddEdgesAtomic{handler:handler} + return self72 +} + +type graphStorageServiceProcessorGetNeighbors struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetNeighbors) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetNeighborsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetNeighbors) 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("getNeighbors", 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 *graphStorageServiceProcessorGetNeighbors) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetNeighborsArgs) + var result GraphStorageServiceGetNeighborsResult + if retval, err := p.handler.GetNeighbors(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getNeighbors: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetProps struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetProps) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetPropsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetProps) 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("getProps", 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 *graphStorageServiceProcessorGetProps) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetPropsArgs) + var result GraphStorageServiceGetPropsResult + if retval, err := p.handler.GetProps(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProps: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddVertices) 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("addVertices", 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 *graphStorageServiceProcessorAddVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddVerticesArgs) + var result GraphStorageServiceAddVerticesResult + if retval, err := p.handler.AddVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdges) 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("addEdges", 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 *graphStorageServiceProcessorAddEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesArgs) + var result GraphStorageServiceAddEdgesResult + if retval, err := p.handler.AddEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteEdges) 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("deleteEdges", 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 *graphStorageServiceProcessorDeleteEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteEdgesArgs) + var result GraphStorageServiceDeleteEdgesResult + if retval, err := p.handler.DeleteEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteVertices) 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("deleteVertices", 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 *graphStorageServiceProcessorDeleteVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteVerticesArgs) + var result GraphStorageServiceDeleteVerticesResult + if retval, err := p.handler.DeleteVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateVertex) 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("updateVertex", 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 *graphStorageServiceProcessorUpdateVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateVertexArgs) + var result GraphStorageServiceUpdateVertexResult + if retval, err := p.handler.UpdateVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateEdge) 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("updateEdge", 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 *graphStorageServiceProcessorUpdateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateEdgeArgs) + var result GraphStorageServiceUpdateEdgeResult + if retval, err := p.handler.UpdateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanVertex) 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("scanVertex", 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 *graphStorageServiceProcessorScanVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanVertexArgs) + var result GraphStorageServiceScanVertexResult + if retval, err := p.handler.ScanVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanEdge) 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("scanEdge", 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 *graphStorageServiceProcessorScanEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanEdgeArgs) + var result GraphStorageServiceScanEdgeResult + if retval, err := p.handler.ScanEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetUUID struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetUUID) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetUUIDArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetUUID) 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("getUUID", 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 *graphStorageServiceProcessorGetUUID) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetUUIDArgs) + var result GraphStorageServiceGetUUIDResult + if retval, err := p.handler.GetUUID(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUUID: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupIndex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupIndex) 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("lookupIndex", 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 *graphStorageServiceProcessorLookupIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupIndexArgs) + var result GraphStorageServiceLookupIndexResult + if retval, err := p.handler.LookupIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupAndTraverse struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupAndTraverseArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) 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("lookupAndTraverse", 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 *graphStorageServiceProcessorLookupAndTraverse) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupAndTraverseArgs) + var result GraphStorageServiceLookupAndTraverseResult + if retval, err := p.handler.LookupAndTraverse(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupAndTraverse: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdgesAtomic struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesAtomicArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) 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("addEdgesAtomic", 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 *graphStorageServiceProcessorAddEdgesAtomic) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesAtomicArgs) + var result GraphStorageServiceAddEdgesAtomicResult + if retval, err := p.handler.AddEdgesAtomic(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdgesAtomic: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GraphStorageServiceGetNeighborsArgs struct { + thrift.IRequest + Req *GetNeighborsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetNeighborsArgs() *GraphStorageServiceGetNeighborsArgs { + return &GraphStorageServiceGetNeighborsArgs{ + Req: NewGetNeighborsRequest(), + } +} + +var GraphStorageServiceGetNeighborsArgs_Req_DEFAULT *GetNeighborsRequest +func (p *GraphStorageServiceGetNeighborsArgs) GetReq() *GetNeighborsRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetNeighborsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetNeighborsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetNeighborsRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetNeighborsResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetNeighborsResult() *GraphStorageServiceGetNeighborsResult { + return &GraphStorageServiceGetNeighborsResult{} +} + +var GraphStorageServiceGetNeighborsResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceGetNeighborsResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetNeighborsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetNeighborsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetPropsArgs struct { + thrift.IRequest + Req *GetPropRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetPropsArgs() *GraphStorageServiceGetPropsArgs { + return &GraphStorageServiceGetPropsArgs{ + Req: NewGetPropRequest(), + } +} + +var GraphStorageServiceGetPropsArgs_Req_DEFAULT *GetPropRequest +func (p *GraphStorageServiceGetPropsArgs) GetReq() *GetPropRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetPropsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetPropsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPropRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetPropsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetPropsResult struct { + thrift.IResponse + Success *GetPropResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetPropsResult() *GraphStorageServiceGetPropsResult { + return &GraphStorageServiceGetPropsResult{} +} + +var GraphStorageServiceGetPropsResult_Success_DEFAULT *GetPropResponse +func (p *GraphStorageServiceGetPropsResult) GetSuccess() *GetPropResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetPropsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetPropsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPropResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetPropsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddVerticesArgs struct { + thrift.IRequest + Req *AddVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddVerticesArgs() *GraphStorageServiceAddVerticesArgs { + return &GraphStorageServiceAddVerticesArgs{ + Req: NewAddVerticesRequest(), + } +} + +var GraphStorageServiceAddVerticesArgs_Req_DEFAULT *AddVerticesRequest +func (p *GraphStorageServiceAddVerticesArgs) GetReq() *AddVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddVerticesResult() *GraphStorageServiceAddVerticesResult { + return &GraphStorageServiceAddVerticesResult{} +} + +var GraphStorageServiceAddVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesArgs() *GraphStorageServiceAddEdgesArgs { + return &GraphStorageServiceAddEdgesArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceAddEdgesArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesResult() *GraphStorageServiceAddEdgesResult { + return &GraphStorageServiceAddEdgesResult{} +} + +var GraphStorageServiceAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteEdgesArgs struct { + thrift.IRequest + Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteEdgesArgs() *GraphStorageServiceDeleteEdgesArgs { + return &GraphStorageServiceDeleteEdgesArgs{ + Req: NewDeleteEdgesRequest(), + } +} + +var GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest +func (p *GraphStorageServiceDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteEdgesResult() *GraphStorageServiceDeleteEdgesResult { + return &GraphStorageServiceDeleteEdgesResult{} +} + +var GraphStorageServiceDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteVerticesArgs struct { + thrift.IRequest + Req *DeleteVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteVerticesArgs() *GraphStorageServiceDeleteVerticesArgs { + return &GraphStorageServiceDeleteVerticesArgs{ + Req: NewDeleteVerticesRequest(), + } +} + +var GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT *DeleteVerticesRequest +func (p *GraphStorageServiceDeleteVerticesArgs) GetReq() *DeleteVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteVerticesResult() *GraphStorageServiceDeleteVerticesResult { + return &GraphStorageServiceDeleteVerticesResult{} +} + +var GraphStorageServiceDeleteVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateVertexArgs struct { + thrift.IRequest + Req *UpdateVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateVertexArgs() *GraphStorageServiceUpdateVertexArgs { + return &GraphStorageServiceUpdateVertexArgs{ + Req: NewUpdateVertexRequest(), + } +} + +var GraphStorageServiceUpdateVertexArgs_Req_DEFAULT *UpdateVertexRequest +func (p *GraphStorageServiceUpdateVertexArgs) GetReq() *UpdateVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateVertexResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateVertexResult() *GraphStorageServiceUpdateVertexResult { + return &GraphStorageServiceUpdateVertexResult{} +} + +var GraphStorageServiceUpdateVertexResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateVertexResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateEdgeArgs struct { + thrift.IRequest + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateEdgeArgs() *GraphStorageServiceUpdateEdgeArgs { + return &GraphStorageServiceUpdateEdgeArgs{ + Req: NewUpdateEdgeRequest(), + } +} + +var GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT *UpdateEdgeRequest +func (p *GraphStorageServiceUpdateEdgeArgs) GetReq() *UpdateEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateEdgeResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateEdgeResult() *GraphStorageServiceUpdateEdgeResult { + return &GraphStorageServiceUpdateEdgeResult{} +} + +var GraphStorageServiceUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanVertexArgs struct { + thrift.IRequest + Req *ScanVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanVertexArgs() *GraphStorageServiceScanVertexArgs { + return &GraphStorageServiceScanVertexArgs{ + Req: NewScanVertexRequest(), + } +} + +var GraphStorageServiceScanVertexArgs_Req_DEFAULT *ScanVertexRequest +func (p *GraphStorageServiceScanVertexArgs) GetReq() *ScanVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanVertexResult struct { + thrift.IResponse + Success *ScanVertexResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { + return &GraphStorageServiceScanVertexResult{} +} + +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanVertexResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanVertexResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanVertexResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanEdgeArgs struct { + thrift.IRequest + Req *ScanEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanEdgeArgs() *GraphStorageServiceScanEdgeArgs { + return &GraphStorageServiceScanEdgeArgs{ + Req: NewScanEdgeRequest(), + } +} + +var GraphStorageServiceScanEdgeArgs_Req_DEFAULT *ScanEdgeRequest +func (p *GraphStorageServiceScanEdgeArgs) GetReq() *ScanEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanEdgeResult struct { + thrift.IResponse + Success *ScanEdgeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { + return &GraphStorageServiceScanEdgeResult{} +} + +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanEdgeResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanEdgeResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanEdgeResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetUUIDArgs struct { + thrift.IRequest + Req *GetUUIDReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetUUIDArgs() *GraphStorageServiceGetUUIDArgs { + return &GraphStorageServiceGetUUIDArgs{ + Req: NewGetUUIDReq(), + } +} + +var GraphStorageServiceGetUUIDArgs_Req_DEFAULT *GetUUIDReq +func (p *GraphStorageServiceGetUUIDArgs) GetReq() *GetUUIDReq { + if !p.IsSetReq() { + return GraphStorageServiceGetUUIDArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetUUIDArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUUIDReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetUUIDResult struct { + thrift.IResponse + Success *GetUUIDResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetUUIDResult() *GraphStorageServiceGetUUIDResult { + return &GraphStorageServiceGetUUIDResult{} +} + +var GraphStorageServiceGetUUIDResult_Success_DEFAULT *GetUUIDResp +func (p *GraphStorageServiceGetUUIDResult) GetSuccess() *GetUUIDResp { + if !p.IsSetSuccess() { + return GraphStorageServiceGetUUIDResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetUUIDResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetUUIDResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupIndexArgs struct { + thrift.IRequest + Req *LookupIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupIndexArgs() *GraphStorageServiceLookupIndexArgs { + return &GraphStorageServiceLookupIndexArgs{ + Req: NewLookupIndexRequest(), + } +} + +var GraphStorageServiceLookupIndexArgs_Req_DEFAULT *LookupIndexRequest +func (p *GraphStorageServiceLookupIndexArgs) GetReq() *LookupIndexRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupIndexResult struct { + thrift.IResponse + Success *LookupIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupIndexResult() *GraphStorageServiceLookupIndexResult { + return &GraphStorageServiceLookupIndexResult{} +} + +var GraphStorageServiceLookupIndexResult_Success_DEFAULT *LookupIndexResp +func (p *GraphStorageServiceLookupIndexResult) GetSuccess() *LookupIndexResp { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewLookupIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupAndTraverseArgs struct { + thrift.IRequest + Req *LookupAndTraverseRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupAndTraverseArgs() *GraphStorageServiceLookupAndTraverseArgs { + return &GraphStorageServiceLookupAndTraverseArgs{ + Req: NewLookupAndTraverseRequest(), + } +} + +var GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT *LookupAndTraverseRequest +func (p *GraphStorageServiceLookupAndTraverseArgs) GetReq() *LookupAndTraverseRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupAndTraverseArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupAndTraverseRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupAndTraverseResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupAndTraverseResult() *GraphStorageServiceLookupAndTraverseResult { + return &GraphStorageServiceLookupAndTraverseResult{} +} + +var GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceLookupAndTraverseResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupAndTraverseResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesAtomicArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesAtomicArgs() *GraphStorageServiceAddEdgesAtomicArgs { + return &GraphStorageServiceAddEdgesAtomicArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesAtomicArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesAtomicArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesAtomicResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesAtomicResult() *GraphStorageServiceAddEdgesAtomicResult { + return &GraphStorageServiceAddEdgesAtomicResult{} +} + +var GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesAtomicResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesAtomicResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/storage_admin_service-remote/storage_admin_service-remote.go b/ccore/nebula/internal/thrift/v2_5_0/storage/storage_admin_service-remote/storage_admin_service-remote.go new file mode 100755 index 0000000..c7eba79 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -0,0 +1,540 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AdminExecResp transLeader(TransLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addPart(AddPartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addLearner(AddLearnerReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp removePart(RemovePartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp memberChange(MemberChangeReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp waitingForCatchUpData(CatchUpDataReq req)") + fmt.Fprintln(os.Stderr, " CreateCPResp createCheckpoint(CreateCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp dropCheckpoint(DropCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp blockingWrites(BlockingSignRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildTagIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildEdgeIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetLeaderPartsResp getLeaderParts(GetLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp checkPeers(CheckPeersReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addAdminTask(AddAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp stopAdminTask(StopAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listClusterInfo(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewStorageAdminServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "transLeader": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") + flag.Usage() + } + arg160 := flag.Arg(1) + mbTrans161 := thrift.NewMemoryBufferLen(len(arg160)) + defer mbTrans161.Close() + _, err162 := mbTrans161.WriteString(arg160) + if err162 != nil { + Usage() + return + } + factory163 := thrift.NewSimpleJSONProtocolFactory() + jsProt164 := factory163.GetProtocol(mbTrans161) + argvalue0 := storage.NewTransLeaderReq() + err165 := argvalue0.Read(jsProt164) + if err165 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TransLeader(value0)) + fmt.Print("\n") + break + case "addPart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddPart requires 1 args") + flag.Usage() + } + arg166 := flag.Arg(1) + mbTrans167 := thrift.NewMemoryBufferLen(len(arg166)) + defer mbTrans167.Close() + _, err168 := mbTrans167.WriteString(arg166) + if err168 != nil { + Usage() + return + } + factory169 := thrift.NewSimpleJSONProtocolFactory() + jsProt170 := factory169.GetProtocol(mbTrans167) + argvalue0 := storage.NewAddPartReq() + err171 := argvalue0.Read(jsProt170) + if err171 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddPart(value0)) + fmt.Print("\n") + break + case "addLearner": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") + flag.Usage() + } + arg172 := flag.Arg(1) + mbTrans173 := thrift.NewMemoryBufferLen(len(arg172)) + defer mbTrans173.Close() + _, err174 := mbTrans173.WriteString(arg172) + if err174 != nil { + Usage() + return + } + factory175 := thrift.NewSimpleJSONProtocolFactory() + jsProt176 := factory175.GetProtocol(mbTrans173) + argvalue0 := storage.NewAddLearnerReq() + err177 := argvalue0.Read(jsProt176) + if err177 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddLearner(value0)) + fmt.Print("\n") + break + case "removePart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") + flag.Usage() + } + arg178 := flag.Arg(1) + mbTrans179 := thrift.NewMemoryBufferLen(len(arg178)) + defer mbTrans179.Close() + _, err180 := mbTrans179.WriteString(arg178) + if err180 != nil { + Usage() + return + } + factory181 := thrift.NewSimpleJSONProtocolFactory() + jsProt182 := factory181.GetProtocol(mbTrans179) + argvalue0 := storage.NewRemovePartReq() + err183 := argvalue0.Read(jsProt182) + if err183 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemovePart(value0)) + fmt.Print("\n") + break + case "memberChange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") + flag.Usage() + } + arg184 := flag.Arg(1) + mbTrans185 := thrift.NewMemoryBufferLen(len(arg184)) + defer mbTrans185.Close() + _, err186 := mbTrans185.WriteString(arg184) + if err186 != nil { + Usage() + return + } + factory187 := thrift.NewSimpleJSONProtocolFactory() + jsProt188 := factory187.GetProtocol(mbTrans185) + argvalue0 := storage.NewMemberChangeReq() + err189 := argvalue0.Read(jsProt188) + if err189 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MemberChange(value0)) + fmt.Print("\n") + break + case "waitingForCatchUpData": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") + flag.Usage() + } + arg190 := flag.Arg(1) + mbTrans191 := thrift.NewMemoryBufferLen(len(arg190)) + defer mbTrans191.Close() + _, err192 := mbTrans191.WriteString(arg190) + if err192 != nil { + Usage() + return + } + factory193 := thrift.NewSimpleJSONProtocolFactory() + jsProt194 := factory193.GetProtocol(mbTrans191) + argvalue0 := storage.NewCatchUpDataReq() + err195 := argvalue0.Read(jsProt194) + if err195 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.WaitingForCatchUpData(value0)) + fmt.Print("\n") + break + case "createCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") + flag.Usage() + } + arg196 := flag.Arg(1) + mbTrans197 := thrift.NewMemoryBufferLen(len(arg196)) + defer mbTrans197.Close() + _, err198 := mbTrans197.WriteString(arg196) + if err198 != nil { + Usage() + return + } + factory199 := thrift.NewSimpleJSONProtocolFactory() + jsProt200 := factory199.GetProtocol(mbTrans197) + argvalue0 := storage.NewCreateCPRequest() + err201 := argvalue0.Read(jsProt200) + if err201 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateCheckpoint(value0)) + fmt.Print("\n") + break + case "dropCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") + flag.Usage() + } + arg202 := flag.Arg(1) + mbTrans203 := thrift.NewMemoryBufferLen(len(arg202)) + defer mbTrans203.Close() + _, err204 := mbTrans203.WriteString(arg202) + if err204 != nil { + Usage() + return + } + factory205 := thrift.NewSimpleJSONProtocolFactory() + jsProt206 := factory205.GetProtocol(mbTrans203) + argvalue0 := storage.NewDropCPRequest() + err207 := argvalue0.Read(jsProt206) + if err207 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropCheckpoint(value0)) + fmt.Print("\n") + break + case "blockingWrites": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") + flag.Usage() + } + arg208 := flag.Arg(1) + mbTrans209 := thrift.NewMemoryBufferLen(len(arg208)) + defer mbTrans209.Close() + _, err210 := mbTrans209.WriteString(arg208) + if err210 != nil { + Usage() + return + } + factory211 := thrift.NewSimpleJSONProtocolFactory() + jsProt212 := factory211.GetProtocol(mbTrans209) + argvalue0 := storage.NewBlockingSignRequest() + err213 := argvalue0.Read(jsProt212) + if err213 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BlockingWrites(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg214 := flag.Arg(1) + mbTrans215 := thrift.NewMemoryBufferLen(len(arg214)) + defer mbTrans215.Close() + _, err216 := mbTrans215.WriteString(arg214) + if err216 != nil { + Usage() + return + } + factory217 := thrift.NewSimpleJSONProtocolFactory() + jsProt218 := factory217.GetProtocol(mbTrans215) + argvalue0 := storage.NewRebuildIndexRequest() + err219 := argvalue0.Read(jsProt218) + if err219 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg220 := flag.Arg(1) + mbTrans221 := thrift.NewMemoryBufferLen(len(arg220)) + defer mbTrans221.Close() + _, err222 := mbTrans221.WriteString(arg220) + if err222 != nil { + Usage() + return + } + factory223 := thrift.NewSimpleJSONProtocolFactory() + jsProt224 := factory223.GetProtocol(mbTrans221) + argvalue0 := storage.NewRebuildIndexRequest() + err225 := argvalue0.Read(jsProt224) + if err225 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "getLeaderParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") + flag.Usage() + } + arg226 := flag.Arg(1) + mbTrans227 := thrift.NewMemoryBufferLen(len(arg226)) + defer mbTrans227.Close() + _, err228 := mbTrans227.WriteString(arg226) + if err228 != nil { + Usage() + return + } + factory229 := thrift.NewSimpleJSONProtocolFactory() + jsProt230 := factory229.GetProtocol(mbTrans227) + argvalue0 := storage.NewGetLeaderReq() + err231 := argvalue0.Read(jsProt230) + if err231 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetLeaderParts(value0)) + fmt.Print("\n") + break + case "checkPeers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") + flag.Usage() + } + arg232 := flag.Arg(1) + mbTrans233 := thrift.NewMemoryBufferLen(len(arg232)) + defer mbTrans233.Close() + _, err234 := mbTrans233.WriteString(arg232) + if err234 != nil { + Usage() + return + } + factory235 := thrift.NewSimpleJSONProtocolFactory() + jsProt236 := factory235.GetProtocol(mbTrans233) + argvalue0 := storage.NewCheckPeersReq() + err237 := argvalue0.Read(jsProt236) + if err237 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckPeers(value0)) + fmt.Print("\n") + break + case "addAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") + flag.Usage() + } + arg238 := flag.Arg(1) + mbTrans239 := thrift.NewMemoryBufferLen(len(arg238)) + defer mbTrans239.Close() + _, err240 := mbTrans239.WriteString(arg238) + if err240 != nil { + Usage() + return + } + factory241 := thrift.NewSimpleJSONProtocolFactory() + jsProt242 := factory241.GetProtocol(mbTrans239) + argvalue0 := storage.NewAddAdminTaskRequest() + err243 := argvalue0.Read(jsProt242) + if err243 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddAdminTask(value0)) + fmt.Print("\n") + break + case "stopAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") + flag.Usage() + } + arg244 := flag.Arg(1) + mbTrans245 := thrift.NewMemoryBufferLen(len(arg244)) + defer mbTrans245.Close() + _, err246 := mbTrans245.WriteString(arg244) + if err246 != nil { + Usage() + return + } + factory247 := thrift.NewSimpleJSONProtocolFactory() + jsProt248 := factory247.GetProtocol(mbTrans245) + argvalue0 := storage.NewStopAdminTaskRequest() + err249 := argvalue0.Read(jsProt248) + if err249 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.StopAdminTask(value0)) + fmt.Print("\n") + break + case "listClusterInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListClusterInfo requires 1 args") + flag.Usage() + } + arg250 := flag.Arg(1) + mbTrans251 := thrift.NewMemoryBufferLen(len(arg250)) + defer mbTrans251.Close() + _, err252 := mbTrans251.WriteString(arg250) + if err252 != nil { + Usage() + return + } + factory253 := thrift.NewSimpleJSONProtocolFactory() + jsProt254 := factory253.GetProtocol(mbTrans251) + argvalue0 := storage.NewListClusterInfoReq() + err255 := argvalue0.Read(jsProt254) + if err255 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListClusterInfo(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/storageadminservice.go b/ccore/nebula/internal/thrift/v2_5_0/storage/storageadminservice.go new file mode 100644 index 0000000..5b62208 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/storageadminservice.go @@ -0,0 +1,5142 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type StorageAdminService interface { + // Parameters: + // - Req + TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn +} + +func(client *StorageAdminServiceClient) Open() error { + return client.CC.Open() +} + +func(client *StorageAdminServiceClient) Close() error { + return client.CC.Close() +} + +func(client *StorageAdminServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewStorageAdminServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceClientProtocol(prot thrift.Protocol) *StorageAdminServiceClient { + return NewStorageAdminServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceThreadsafeClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *StorageAdminServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *StorageAdminServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *StorageAdminServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewStorageAdminServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceThreadsafeClientProtocol(prot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return NewStorageAdminServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *StorageAdminServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *StorageAdminServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *StorageAdminServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewStorageAdminServiceChannelClient(channel thrift.RequestChannel) *StorageAdminServiceChannelClient { + return &StorageAdminServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + var result StorageAdminServiceTransLeaderResult + err = p.RequestChannel.Call(ctx, "transLeader", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + var result StorageAdminServiceAddPartResult + err = p.RequestChannel.Call(ctx, "addPart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + var result StorageAdminServiceAddLearnerResult + err = p.RequestChannel.Call(ctx, "addLearner", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + var result StorageAdminServiceRemovePartResult + err = p.RequestChannel.Call(ctx, "removePart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + var result StorageAdminServiceMemberChangeResult + err = p.RequestChannel.Call(ctx, "memberChange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.RequestChannel.Call(ctx, "waitingForCatchUpData", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceCreateCheckpointResult + err = p.RequestChannel.Call(ctx, "createCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceDropCheckpointResult + err = p.RequestChannel.Call(ctx, "dropCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + var result StorageAdminServiceBlockingWritesResult + err = p.RequestChannel.Call(ctx, "blockingWrites", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + var result StorageAdminServiceGetLeaderPartsResult + err = p.RequestChannel.Call(ctx, "getLeaderParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + var result StorageAdminServiceCheckPeersResult + err = p.RequestChannel.Call(ctx, "checkPeers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceAddAdminTaskResult + err = p.RequestChannel.Call(ctx, "addAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceStopAdminTaskResult + err = p.RequestChannel.Call(ctx, "stopAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + var result StorageAdminServiceListClusterInfoResult + err = p.RequestChannel.Call(ctx, "listClusterInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler StorageAdminService +} + +func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *StorageAdminServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { + self158 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self158.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self158.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self158.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self158.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self158.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self158.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self158.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self158.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self158.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self158.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} + self158.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} + self158.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self158.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self158.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self158.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self158.processorMap["listClusterInfo"] = &storageAdminServiceProcessorListClusterInfo{handler:handler} + return self158 +} + +type storageAdminServiceProcessorTransLeader struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorTransLeader) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceTransLeaderArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorTransLeader) 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("transLeader", 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 *storageAdminServiceProcessorTransLeader) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceTransLeaderArgs) + var result StorageAdminServiceTransLeaderResult + if retval, err := p.handler.TransLeader(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transLeader: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddPart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddPart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddPartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddPart) 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("addPart", 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 *storageAdminServiceProcessorAddPart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddPartArgs) + var result StorageAdminServiceAddPartResult + if retval, err := p.handler.AddPart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addPart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddLearner struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddLearner) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddLearnerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddLearner) 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("addLearner", 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 *storageAdminServiceProcessorAddLearner) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddLearnerArgs) + var result StorageAdminServiceAddLearnerResult + if retval, err := p.handler.AddLearner(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addLearner: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRemovePart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRemovePart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRemovePartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRemovePart) 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("removePart", 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 *storageAdminServiceProcessorRemovePart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRemovePartArgs) + var result StorageAdminServiceRemovePartResult + if retval, err := p.handler.RemovePart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removePart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorMemberChange struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorMemberChange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceMemberChangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorMemberChange) 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("memberChange", 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 *storageAdminServiceProcessorMemberChange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceMemberChangeArgs) + var result StorageAdminServiceMemberChangeResult + if retval, err := p.handler.MemberChange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing memberChange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorWaitingForCatchUpData struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) 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("waitingForCatchUpData", 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 *storageAdminServiceProcessorWaitingForCatchUpData) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceWaitingForCatchUpDataArgs) + var result StorageAdminServiceWaitingForCatchUpDataResult + if retval, err := p.handler.WaitingForCatchUpData(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing waitingForCatchUpData: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCreateCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCreateCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) 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("createCheckpoint", 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 *storageAdminServiceProcessorCreateCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCreateCheckpointArgs) + var result StorageAdminServiceCreateCheckpointResult + if retval, err := p.handler.CreateCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorDropCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorDropCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceDropCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorDropCheckpoint) 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("dropCheckpoint", 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 *storageAdminServiceProcessorDropCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceDropCheckpointArgs) + var result StorageAdminServiceDropCheckpointResult + if retval, err := p.handler.DropCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorBlockingWrites struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorBlockingWrites) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceBlockingWritesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorBlockingWrites) 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("blockingWrites", 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 *storageAdminServiceProcessorBlockingWrites) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceBlockingWritesArgs) + var result StorageAdminServiceBlockingWritesResult + if retval, err := p.handler.BlockingWrites(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing blockingWrites: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildTagIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *storageAdminServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildTagIndexArgs) + var result StorageAdminServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildEdgeIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *storageAdminServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildEdgeIndexArgs) + var result StorageAdminServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorGetLeaderParts struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorGetLeaderParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceGetLeaderPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorGetLeaderParts) 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("getLeaderParts", 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 *storageAdminServiceProcessorGetLeaderParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceGetLeaderPartsArgs) + var result StorageAdminServiceGetLeaderPartsResult + if retval, err := p.handler.GetLeaderParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getLeaderParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCheckPeers struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCheckPeers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCheckPeersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCheckPeers) 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("checkPeers", 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 *storageAdminServiceProcessorCheckPeers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCheckPeersArgs) + var result StorageAdminServiceCheckPeersResult + if retval, err := p.handler.CheckPeers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPeers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddAdminTask) 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("addAdminTask", 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 *storageAdminServiceProcessorAddAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddAdminTaskArgs) + var result StorageAdminServiceAddAdminTaskResult + if retval, err := p.handler.AddAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorStopAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorStopAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceStopAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorStopAdminTask) 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("stopAdminTask", 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 *storageAdminServiceProcessorStopAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceStopAdminTaskArgs) + var result StorageAdminServiceStopAdminTaskResult + if retval, err := p.handler.StopAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stopAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorListClusterInfo struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorListClusterInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceListClusterInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorListClusterInfo) 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("listClusterInfo", 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 *storageAdminServiceProcessorListClusterInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceListClusterInfoArgs) + var result StorageAdminServiceListClusterInfoResult + if retval, err := p.handler.ListClusterInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listClusterInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type StorageAdminServiceTransLeaderArgs struct { + thrift.IRequest + Req *TransLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceTransLeaderArgs() *StorageAdminServiceTransLeaderArgs { + return &StorageAdminServiceTransLeaderArgs{ + Req: NewTransLeaderReq(), + } +} + +var StorageAdminServiceTransLeaderArgs_Req_DEFAULT *TransLeaderReq +func (p *StorageAdminServiceTransLeaderArgs) GetReq() *TransLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceTransLeaderArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceTransLeaderArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewTransLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceTransLeaderResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceTransLeaderResult() *StorageAdminServiceTransLeaderResult { + return &StorageAdminServiceTransLeaderResult{} +} + +var StorageAdminServiceTransLeaderResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceTransLeaderResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceTransLeaderResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceTransLeaderResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddPartArgs struct { + thrift.IRequest + Req *AddPartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddPartArgs() *StorageAdminServiceAddPartArgs { + return &StorageAdminServiceAddPartArgs{ + Req: NewAddPartReq(), + } +} + +var StorageAdminServiceAddPartArgs_Req_DEFAULT *AddPartReq +func (p *StorageAdminServiceAddPartArgs) GetReq() *AddPartReq { + if !p.IsSetReq() { + return StorageAdminServiceAddPartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddPartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddPartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddPartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddPartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddPartResult() *StorageAdminServiceAddPartResult { + return &StorageAdminServiceAddPartResult{} +} + +var StorageAdminServiceAddPartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddPartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddPartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddPartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddPartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddLearnerArgs struct { + thrift.IRequest + Req *AddLearnerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddLearnerArgs() *StorageAdminServiceAddLearnerArgs { + return &StorageAdminServiceAddLearnerArgs{ + Req: NewAddLearnerReq(), + } +} + +var StorageAdminServiceAddLearnerArgs_Req_DEFAULT *AddLearnerReq +func (p *StorageAdminServiceAddLearnerArgs) GetReq() *AddLearnerReq { + if !p.IsSetReq() { + return StorageAdminServiceAddLearnerArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddLearnerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddLearnerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddLearnerResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddLearnerResult() *StorageAdminServiceAddLearnerResult { + return &StorageAdminServiceAddLearnerResult{} +} + +var StorageAdminServiceAddLearnerResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddLearnerResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddLearnerResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddLearnerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRemovePartArgs struct { + thrift.IRequest + Req *RemovePartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRemovePartArgs() *StorageAdminServiceRemovePartArgs { + return &StorageAdminServiceRemovePartArgs{ + Req: NewRemovePartReq(), + } +} + +var StorageAdminServiceRemovePartArgs_Req_DEFAULT *RemovePartReq +func (p *StorageAdminServiceRemovePartArgs) GetReq() *RemovePartReq { + if !p.IsSetReq() { + return StorageAdminServiceRemovePartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRemovePartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemovePartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRemovePartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRemovePartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRemovePartResult() *StorageAdminServiceRemovePartResult { + return &StorageAdminServiceRemovePartResult{} +} + +var StorageAdminServiceRemovePartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRemovePartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRemovePartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRemovePartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRemovePartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceMemberChangeArgs struct { + thrift.IRequest + Req *MemberChangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceMemberChangeArgs() *StorageAdminServiceMemberChangeArgs { + return &StorageAdminServiceMemberChangeArgs{ + Req: NewMemberChangeReq(), + } +} + +var StorageAdminServiceMemberChangeArgs_Req_DEFAULT *MemberChangeReq +func (p *StorageAdminServiceMemberChangeArgs) GetReq() *MemberChangeReq { + if !p.IsSetReq() { + return StorageAdminServiceMemberChangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceMemberChangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMemberChangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceMemberChangeResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceMemberChangeResult() *StorageAdminServiceMemberChangeResult { + return &StorageAdminServiceMemberChangeResult{} +} + +var StorageAdminServiceMemberChangeResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceMemberChangeResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceMemberChangeResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceMemberChangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceWaitingForCatchUpDataArgs struct { + thrift.IRequest + Req *CatchUpDataReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataArgs() *StorageAdminServiceWaitingForCatchUpDataArgs { + return &StorageAdminServiceWaitingForCatchUpDataArgs{ + Req: NewCatchUpDataReq(), + } +} + +var StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT *CatchUpDataReq +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) GetReq() *CatchUpDataReq { + if !p.IsSetReq() { + return StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCatchUpDataReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceWaitingForCatchUpDataResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataResult() *StorageAdminServiceWaitingForCatchUpDataResult { + return &StorageAdminServiceWaitingForCatchUpDataResult{} +} + +var StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceWaitingForCatchUpDataResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceWaitingForCatchUpDataResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCreateCheckpointArgs struct { + thrift.IRequest + Req *CreateCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCreateCheckpointArgs() *StorageAdminServiceCreateCheckpointArgs { + return &StorageAdminServiceCreateCheckpointArgs{ + Req: NewCreateCPRequest(), + } +} + +var StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT *CreateCPRequest +func (p *StorageAdminServiceCreateCheckpointArgs) GetReq() *CreateCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCreateCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCreateCheckpointResult struct { + thrift.IResponse + Success *CreateCPResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCreateCheckpointResult() *StorageAdminServiceCreateCheckpointResult { + return &StorageAdminServiceCreateCheckpointResult{} +} + +var StorageAdminServiceCreateCheckpointResult_Success_DEFAULT *CreateCPResp +func (p *StorageAdminServiceCreateCheckpointResult) GetSuccess() *CreateCPResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCreateCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCreateCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateCPResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceDropCheckpointArgs struct { + thrift.IRequest + Req *DropCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceDropCheckpointArgs() *StorageAdminServiceDropCheckpointArgs { + return &StorageAdminServiceDropCheckpointArgs{ + Req: NewDropCPRequest(), + } +} + +var StorageAdminServiceDropCheckpointArgs_Req_DEFAULT *DropCPRequest +func (p *StorageAdminServiceDropCheckpointArgs) GetReq() *DropCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceDropCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceDropCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceDropCheckpointResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { + return &StorageAdminServiceDropCheckpointResult{} +} + +var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceDropCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceBlockingWritesArgs struct { + thrift.IRequest + Req *BlockingSignRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceBlockingWritesArgs() *StorageAdminServiceBlockingWritesArgs { + return &StorageAdminServiceBlockingWritesArgs{ + Req: NewBlockingSignRequest(), + } +} + +var StorageAdminServiceBlockingWritesArgs_Req_DEFAULT *BlockingSignRequest +func (p *StorageAdminServiceBlockingWritesArgs) GetReq() *BlockingSignRequest { + if !p.IsSetReq() { + return StorageAdminServiceBlockingWritesArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceBlockingWritesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBlockingSignRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceBlockingWritesResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { + return &StorageAdminServiceBlockingWritesResult{} +} + +var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceBlockingWritesResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildTagIndexArgs() *StorageAdminServiceRebuildTagIndexArgs { + return &StorageAdminServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildTagIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildTagIndexResult() *StorageAdminServiceRebuildTagIndexResult { + return &StorageAdminServiceRebuildTagIndexResult{} +} + +var StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildTagIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildEdgeIndexArgs() *StorageAdminServiceRebuildEdgeIndexArgs { + return &StorageAdminServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildEdgeIndexResult() *StorageAdminServiceRebuildEdgeIndexResult { + return &StorageAdminServiceRebuildEdgeIndexResult{} +} + +var StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildEdgeIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceGetLeaderPartsArgs struct { + thrift.IRequest + Req *GetLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceGetLeaderPartsArgs() *StorageAdminServiceGetLeaderPartsArgs { + return &StorageAdminServiceGetLeaderPartsArgs{ + Req: NewGetLeaderReq(), + } +} + +var StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT *GetLeaderReq +func (p *StorageAdminServiceGetLeaderPartsArgs) GetReq() *GetLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceGetLeaderPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceGetLeaderPartsResult struct { + thrift.IResponse + Success *GetLeaderPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceGetLeaderPartsResult() *StorageAdminServiceGetLeaderPartsResult { + return &StorageAdminServiceGetLeaderPartsResult{} +} + +var StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT *GetLeaderPartsResp +func (p *StorageAdminServiceGetLeaderPartsResult) GetSuccess() *GetLeaderPartsResp { + if !p.IsSetSuccess() { + return StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceGetLeaderPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetLeaderPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCheckPeersArgs struct { + thrift.IRequest + Req *CheckPeersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCheckPeersArgs() *StorageAdminServiceCheckPeersArgs { + return &StorageAdminServiceCheckPeersArgs{ + Req: NewCheckPeersReq(), + } +} + +var StorageAdminServiceCheckPeersArgs_Req_DEFAULT *CheckPeersReq +func (p *StorageAdminServiceCheckPeersArgs) GetReq() *CheckPeersReq { + if !p.IsSetReq() { + return StorageAdminServiceCheckPeersArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCheckPeersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCheckPeersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCheckPeersResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCheckPeersResult() *StorageAdminServiceCheckPeersResult { + return &StorageAdminServiceCheckPeersResult{} +} + +var StorageAdminServiceCheckPeersResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceCheckPeersResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCheckPeersResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCheckPeersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddAdminTaskArgs struct { + thrift.IRequest + Req *AddAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { + return &StorageAdminServiceAddAdminTaskArgs{ + Req: NewAddAdminTaskRequest(), + } +} + +var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddAdminTaskRequest +func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { + return &StorageAdminServiceAddAdminTaskResult{} +} + +var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceStopAdminTaskArgs struct { + thrift.IRequest + Req *StopAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { + return &StorageAdminServiceStopAdminTaskArgs{ + Req: NewStopAdminTaskRequest(), + } +} + +var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopAdminTaskRequest +func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewStopAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceStopAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { + return &StorageAdminServiceStopAdminTaskResult{} +} + +var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceListClusterInfoArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceListClusterInfoArgs() *StorageAdminServiceListClusterInfoArgs { + return &StorageAdminServiceListClusterInfoArgs{ + Req: NewListClusterInfoReq(), + } +} + +var StorageAdminServiceListClusterInfoArgs_Req_DEFAULT *ListClusterInfoReq +func (p *StorageAdminServiceListClusterInfoArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return StorageAdminServiceListClusterInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceListClusterInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceListClusterInfoResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceListClusterInfoResult() *StorageAdminServiceListClusterInfoResult { + return &StorageAdminServiceListClusterInfoResult{} +} + +var StorageAdminServiceListClusterInfoResult_Success_DEFAULT *ListClusterInfoResp +func (p *StorageAdminServiceListClusterInfoResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return StorageAdminServiceListClusterInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceListClusterInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_0/storage/ttypes.go b/ccore/nebula/internal/thrift/v2_5_0/storage/ttypes.go new file mode 100644 index 0000000..a778ef5 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/storage/ttypes.go @@ -0,0 +1,12495 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type StatType int64 +const ( + StatType_SUM StatType = 1 + StatType_COUNT StatType = 2 + StatType_AVG StatType = 3 + StatType_MAX StatType = 4 + StatType_MIN StatType = 5 +) + +var StatTypeToName = map[StatType]string { + StatType_SUM: "SUM", + StatType_COUNT: "COUNT", + StatType_AVG: "AVG", + StatType_MAX: "MAX", + StatType_MIN: "MIN", +} + +var StatTypeToValue = map[string]StatType { + "SUM": StatType_SUM, + "COUNT": StatType_COUNT, + "AVG": StatType_AVG, + "MAX": StatType_MAX, + "MIN": StatType_MIN, +} + +var StatTypeNames = []string { + "SUM", + "COUNT", + "AVG", + "MAX", + "MIN", +} + +var StatTypeValues = []StatType { + StatType_SUM, + StatType_COUNT, + StatType_AVG, + StatType_MAX, + StatType_MIN, +} + +func (p StatType) String() string { + if v, ok := StatTypeToName[p]; ok { + return v + } + return "" +} + +func StatTypeFromString(s string) (StatType, error) { + if v, ok := StatTypeToValue[s]; ok { + return v, nil + } + return StatType(0), fmt.Errorf("not a valid StatType string") +} + +func StatTypePtr(v StatType) *StatType { return &v } + +type OrderDirection int64 +const ( + OrderDirection_ASCENDING OrderDirection = 1 + OrderDirection_DESCENDING OrderDirection = 2 +) + +var OrderDirectionToName = map[OrderDirection]string { + OrderDirection_ASCENDING: "ASCENDING", + OrderDirection_DESCENDING: "DESCENDING", +} + +var OrderDirectionToValue = map[string]OrderDirection { + "ASCENDING": OrderDirection_ASCENDING, + "DESCENDING": OrderDirection_DESCENDING, +} + +var OrderDirectionNames = []string { + "ASCENDING", + "DESCENDING", +} + +var OrderDirectionValues = []OrderDirection { + OrderDirection_ASCENDING, + OrderDirection_DESCENDING, +} + +func (p OrderDirection) String() string { + if v, ok := OrderDirectionToName[p]; ok { + return v + } + return "" +} + +func OrderDirectionFromString(s string) (OrderDirection, error) { + if v, ok := OrderDirectionToValue[s]; ok { + return v, nil + } + return OrderDirection(0), fmt.Errorf("not a valid OrderDirection string") +} + +func OrderDirectionPtr(v OrderDirection) *OrderDirection { return &v } + +type EdgeDirection int64 +const ( + EdgeDirection_BOTH EdgeDirection = 1 + EdgeDirection_IN_EDGE EdgeDirection = 2 + EdgeDirection_OUT_EDGE EdgeDirection = 3 +) + +var EdgeDirectionToName = map[EdgeDirection]string { + EdgeDirection_BOTH: "BOTH", + EdgeDirection_IN_EDGE: "IN_EDGE", + EdgeDirection_OUT_EDGE: "OUT_EDGE", +} + +var EdgeDirectionToValue = map[string]EdgeDirection { + "BOTH": EdgeDirection_BOTH, + "IN_EDGE": EdgeDirection_IN_EDGE, + "OUT_EDGE": EdgeDirection_OUT_EDGE, +} + +var EdgeDirectionNames = []string { + "BOTH", + "IN_EDGE", + "OUT_EDGE", +} + +var EdgeDirectionValues = []EdgeDirection { + EdgeDirection_BOTH, + EdgeDirection_IN_EDGE, + EdgeDirection_OUT_EDGE, +} + +func (p EdgeDirection) String() string { + if v, ok := EdgeDirectionToName[p]; ok { + return v + } + return "" +} + +func EdgeDirectionFromString(s string) (EdgeDirection, error) { + if v, ok := EdgeDirectionToValue[s]; ok { + return v, nil + } + return EdgeDirection(0), fmt.Errorf("not a valid EdgeDirection string") +} + +func EdgeDirectionPtr(v EdgeDirection) *EdgeDirection { return &v } + +type ScanType int64 +const ( + ScanType_PREFIX ScanType = 1 + ScanType_RANGE ScanType = 2 +) + +var ScanTypeToName = map[ScanType]string { + ScanType_PREFIX: "PREFIX", + ScanType_RANGE: "RANGE", +} + +var ScanTypeToValue = map[string]ScanType { + "PREFIX": ScanType_PREFIX, + "RANGE": ScanType_RANGE, +} + +var ScanTypeNames = []string { + "PREFIX", + "RANGE", +} + +var ScanTypeValues = []ScanType { + ScanType_PREFIX, + ScanType_RANGE, +} + +func (p ScanType) String() string { + if v, ok := ScanTypeToName[p]; ok { + return v + } + return "" +} + +func ScanTypeFromString(s string) (ScanType, error) { + if v, ok := ScanTypeToValue[s]; ok { + return v, nil + } + return ScanType(0), fmt.Errorf("not a valid ScanType string") +} + +func ScanTypePtr(v ScanType) *ScanType { return &v } + +type EngineSignType int64 +const ( + EngineSignType_BLOCK_ON EngineSignType = 1 + EngineSignType_BLOCK_OFF EngineSignType = 2 +) + +var EngineSignTypeToName = map[EngineSignType]string { + EngineSignType_BLOCK_ON: "BLOCK_ON", + EngineSignType_BLOCK_OFF: "BLOCK_OFF", +} + +var EngineSignTypeToValue = map[string]EngineSignType { + "BLOCK_ON": EngineSignType_BLOCK_ON, + "BLOCK_OFF": EngineSignType_BLOCK_OFF, +} + +var EngineSignTypeNames = []string { + "BLOCK_ON", + "BLOCK_OFF", +} + +var EngineSignTypeValues = []EngineSignType { + EngineSignType_BLOCK_ON, + EngineSignType_BLOCK_OFF, +} + +func (p EngineSignType) String() string { + if v, ok := EngineSignTypeToName[p]; ok { + return v + } + return "" +} + +func EngineSignTypeFromString(s string) (EngineSignType, error) { + if v, ok := EngineSignTypeToValue[s]; ok { + return v, nil + } + return EngineSignType(0), fmt.Errorf("not a valid EngineSignType string") +} + +func EngineSignTypePtr(v EngineSignType) *EngineSignType { return &v } + +// Attributes: +// - Code +// - PartID +// - Leader +type PartitionResult_ struct { + Code nebula0.ErrorCode `thrift:"code,1,required" db:"code" json:"code"` + PartID nebula0.PartitionID `thrift:"part_id,2,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader,omitempty"` +} + +func NewPartitionResult_() *PartitionResult_ { + return &PartitionResult_{} +} + + +func (p *PartitionResult_) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *PartitionResult_) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartitionResult__Leader_DEFAULT *nebula0.HostAddr +func (p *PartitionResult_) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartitionResult__Leader_DEFAULT + } +return p.Leader +} +func (p *PartitionResult_) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartitionResult_) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetCode bool = false; + var issetPartID 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 + } + issetCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetPartID = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")); + } + if !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + return nil +} + +func (p *PartitionResult_) 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 *PartitionResult_) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartitionResult_) ReadField3(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 *PartitionResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionResult"); 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 *PartitionResult_) 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 *PartitionResult_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + } + return err +} + +func (p *PartitionResult_) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("PartitionResult_({Code:%s PartID:%s Leader:%s})", codeVal, partIDVal, leaderVal) +} + +// Attributes: +// - FailedParts +// - LatencyInUs +type ResponseCommon struct { + FailedParts []*PartitionResult_ `thrift:"failed_parts,1,required" db:"failed_parts" json:"failed_parts"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` +} + +func NewResponseCommon() *ResponseCommon { + return &ResponseCommon{} +} + + +func (p *ResponseCommon) GetFailedParts() []*PartitionResult_ { + return p.FailedParts +} + +func (p *ResponseCommon) GetLatencyInUs() int32 { + return p.LatencyInUs +} +func (p *ResponseCommon) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFailedParts bool = false; + var issetLatencyInUs 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 + } + issetFailedParts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetFailedParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedParts is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ResponseCommon) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartitionResult_, 0, size) + p.FailedParts = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewPartitionResult_() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.FailedParts = append(p.FailedParts, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ResponseCommon) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ResponseCommon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ResponseCommon"); 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 *ResponseCommon) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("failed_parts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:failed_parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FailedParts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.FailedParts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:failed_parts: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ResponseCommon) String() string { + if p == nil { + return "" + } + + failedPartsVal := fmt.Sprintf("%v", p.FailedParts) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + return fmt.Sprintf("ResponseCommon({FailedParts:%s LatencyInUs:%s})", failedPartsVal, latencyInUsVal) +} + +// Attributes: +// - Alias +// - Prop +// - Stat +type StatProp struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Prop []byte `thrift:"prop,2" db:"prop" json:"prop"` + Stat StatType `thrift:"stat,3" db:"stat" json:"stat"` +} + +func NewStatProp() *StatProp { + return &StatProp{} +} + + +func (p *StatProp) GetAlias() []byte { + return p.Alias +} + +func (p *StatProp) GetProp() []byte { + return p.Prop +} + +func (p *StatProp) GetStat() StatType { + return p.Stat +} +func (p *StatProp) 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 *StatProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *StatProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *StatProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := StatType(v) + p.Stat = temp +} + return nil +} + +func (p *StatProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatProp"); 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 *StatProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *StatProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prop: ", p), err) } + return err +} + +func (p *StatProp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stat", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat: ", p), err) } + if err := oprot.WriteI32(int32(p.Stat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stat (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat: ", p), err) } + return err +} + +func (p *StatProp) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + propVal := fmt.Sprintf("%v", p.Prop) + statVal := fmt.Sprintf("%v", p.Stat) + return fmt.Sprintf("StatProp({Alias:%s Prop:%s Stat:%s})", aliasVal, propVal, statVal) +} + +// Attributes: +// - Alias +// - Expr +type Expr struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Expr []byte `thrift:"expr,2" db:"expr" json:"expr"` +} + +func NewExpr() *Expr { + return &Expr{} +} + + +func (p *Expr) GetAlias() []byte { + return p.Alias +} + +func (p *Expr) GetExpr() []byte { + return p.Expr +} +func (p *Expr) 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 *Expr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *Expr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Expr = v +} + return nil +} + +func (p *Expr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Expr"); 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 *Expr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *Expr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("expr", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expr: ", p), err) } + if err := oprot.WriteBinary(p.Expr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expr: ", p), err) } + return err +} + +func (p *Expr) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + exprVal := fmt.Sprintf("%v", p.Expr) + return fmt.Sprintf("Expr({Alias:%s Expr:%s})", aliasVal, exprVal) +} + +// Attributes: +// - Type +// - Props +type EdgeProp struct { + Type nebula0.EdgeType `thrift:"type,1" db:"type" json:"type"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewEdgeProp() *EdgeProp { + return &EdgeProp{} +} + + +func (p *EdgeProp) GetType() nebula0.EdgeType { + return p.Type +} + +func (p *EdgeProp) GetProps() [][]byte { + return p.Props +} +func (p *EdgeProp) 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 *EdgeProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *EdgeProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem3 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem3 = v +} + p.Props = append(p.Props, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *EdgeProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeProp"); 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 *EdgeProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *EdgeProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *EdgeProp) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("EdgeProp({Type:%s Props:%s})", typeVal, propsVal) +} + +// Attributes: +// - Tag +// - Props +type VertexProp struct { + Tag nebula0.TagID `thrift:"tag,1" db:"tag" json:"tag"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewVertexProp() *VertexProp { + return &VertexProp{} +} + + +func (p *VertexProp) GetTag() nebula0.TagID { + return p.Tag +} + +func (p *VertexProp) GetProps() [][]byte { + return p.Props +} +func (p *VertexProp) 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 *VertexProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.Tag = temp +} + return nil +} + +func (p *VertexProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem4 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem4 = v +} + p.Props = append(p.Props, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *VertexProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VertexProp"); 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 *VertexProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) } + if err := oprot.WriteI32(int32(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) } + return err +} + +func (p *VertexProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *VertexProp) String() string { + if p == nil { + return "" + } + + tagVal := fmt.Sprintf("%v", p.Tag) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("VertexProp({Tag:%s Props:%s})", tagVal, propsVal) +} + +// Attributes: +// - Prop +// - Direction +type OrderBy struct { + Prop []byte `thrift:"prop,1" db:"prop" json:"prop"` + Direction OrderDirection `thrift:"direction,2" db:"direction" json:"direction"` +} + +func NewOrderBy() *OrderBy { + return &OrderBy{} +} + + +func (p *OrderBy) GetProp() []byte { + return p.Prop +} + +func (p *OrderBy) GetDirection() OrderDirection { + return p.Direction +} +func (p *OrderBy) 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 *OrderBy) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *OrderBy) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := OrderDirection(v) + p.Direction = temp +} + return nil +} + +func (p *OrderBy) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("OrderBy"); 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 *OrderBy) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prop: ", p), err) } + return err +} + +func (p *OrderBy) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:direction: ", p), err) } + if err := oprot.WriteI32(int32(p.Direction)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:direction: ", p), err) } + return err +} + +func (p *OrderBy) String() string { + if p == nil { + return "" + } + + propVal := fmt.Sprintf("%v", p.Prop) + directionVal := fmt.Sprintf("%v", p.Direction) + return fmt.Sprintf("OrderBy({Prop:%s Direction:%s})", propVal, directionVal) +} + +// Attributes: +// - EdgeTypes +// - EdgeDirection +// - Dedup +// - StatProps +// - VertexProps +// - EdgeProps +// - Expressions +// - OrderBy +// - Random +// - Limit +// - Filter +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"` + Dedup bool `thrift:"dedup,3" db:"dedup" json:"dedup"` + StatProps []*StatProp `thrift:"stat_props,4" db:"stat_props" json:"stat_props,omitempty"` + VertexProps []*VertexProp `thrift:"vertex_props,5" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,6" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,7" db:"expressions" json:"expressions,omitempty"` + OrderBy []*OrderBy `thrift:"order_by,8" db:"order_by" json:"order_by,omitempty"` + Random *bool `thrift:"random,9" db:"random" json:"random,omitempty"` + Limit *int64 `thrift:"limit,10" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,11" db:"filter" json:"filter,omitempty"` +} + +func NewTraverseSpec() *TraverseSpec { + return &TraverseSpec{ + EdgeDirection: 1, + } +} + + +func (p *TraverseSpec) GetEdgeTypes() []nebula0.EdgeType { + return p.EdgeTypes +} + +func (p *TraverseSpec) GetEdgeDirection() EdgeDirection { + return p.EdgeDirection +} + +func (p *TraverseSpec) GetDedup() bool { + return p.Dedup +} +var TraverseSpec_StatProps_DEFAULT []*StatProp + +func (p *TraverseSpec) GetStatProps() []*StatProp { + return p.StatProps +} +var TraverseSpec_VertexProps_DEFAULT []*VertexProp + +func (p *TraverseSpec) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var TraverseSpec_EdgeProps_DEFAULT []*EdgeProp + +func (p *TraverseSpec) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var TraverseSpec_Expressions_DEFAULT []*Expr + +func (p *TraverseSpec) GetExpressions() []*Expr { + return p.Expressions +} +var TraverseSpec_OrderBy_DEFAULT []*OrderBy + +func (p *TraverseSpec) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var TraverseSpec_Random_DEFAULT bool +func (p *TraverseSpec) GetRandom() bool { + if !p.IsSetRandom() { + return TraverseSpec_Random_DEFAULT + } +return *p.Random +} +var TraverseSpec_Limit_DEFAULT int64 +func (p *TraverseSpec) GetLimit() int64 { + if !p.IsSetLimit() { + return TraverseSpec_Limit_DEFAULT + } +return *p.Limit +} +var TraverseSpec_Filter_DEFAULT []byte + +func (p *TraverseSpec) GetFilter() []byte { + return p.Filter +} +func (p *TraverseSpec) IsSetStatProps() bool { + return p != nil && p.StatProps != nil +} + +func (p *TraverseSpec) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *TraverseSpec) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *TraverseSpec) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *TraverseSpec) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *TraverseSpec) IsSetRandom() bool { + return p != nil && p.Random != nil +} + +func (p *TraverseSpec) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *TraverseSpec) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *TraverseSpec) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *TraverseSpec) ReadField1(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 _elem5 nebula0.EdgeType + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.EdgeType(v) + _elem5 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeDirection(v) + p.EdgeDirection = temp +} + return nil +} + +func (p *TraverseSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *TraverseSpec) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*StatProp, 0, size) + p.StatProps = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewStatProp() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.StatProps = append(p.StatProps, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem7 := NewVertexProp() + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.VertexProps = append(p.VertexProps, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField6(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem8 := NewEdgeProp() + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + p.EdgeProps = append(p.EdgeProps, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewExpr() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Expressions = append(p.Expressions, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField8(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem10 := NewOrderBy() + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.OrderBy = append(p.OrderBy, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Random = &v +} + return nil +} + +func (p *TraverseSpec) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *TraverseSpec) ReadField11(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.Filter = 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) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TraverseSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:edge_types: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_direction: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeDirection)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_direction: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dedup: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatProps() { + if err := oprot.WriteFieldBegin("stat_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stat_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StatProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stat_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vertex_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + 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 7:expressions: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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:order_by: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetRandom() { + if err := oprot.WriteFieldBegin("random", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:random: ", p), err) } + if err := oprot.WriteBool(bool(*p.Random)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.random (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:random: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:limit: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) String() string { + if p == nil { + return "" + } + + edgeTypesVal := fmt.Sprintf("%v", p.EdgeTypes) + edgeDirectionVal := fmt.Sprintf("%v", p.EdgeDirection) + dedupVal := fmt.Sprintf("%v", p.Dedup) + statPropsVal := fmt.Sprintf("%v", p.StatProps) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var randomVal string + if p.Random == nil { + randomVal = "" + } else { + randomVal = fmt.Sprintf("%v", *p.Random) + } + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + 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) +} + +// Attributes: +// - SpaceID +// - ColumnNames +// - Parts +// - TraverseSpec +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"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewGetNeighborsRequest() *GetNeighborsRequest { + return &GetNeighborsRequest{ + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *GetNeighborsRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetNeighborsRequest) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetNeighborsRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *GetNeighborsRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return GetNeighborsRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *GetNeighborsRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *GetNeighborsRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + 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 _elem11 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem11 = v +} + p.ColumnNames = append(p.ColumnNames, _elem11) + } + 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.Row, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key12 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key12 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val13 := tSlice + for i := 0; i < size; i ++ { + _elem14 := nebula0.NewRow() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + _val13 = append(_val13, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key12] = _val13 + } + 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) 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 := oprot.WriteFieldStop(); err != nil { + return thrift.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) 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) + } + return fmt.Sprintf("GetNeighborsRequest({SpaceID:%s ColumnNames:%s Parts:%s TraverseSpec:%s})", spaceIDVal, columnNamesVal, partsVal, traverseSpecVal) +} + +// Attributes: +// - Result_ +// - Vertices +type GetNeighborsResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Vertices *nebula0.DataSet `thrift:"vertices,2" 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 +} + +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: +// - Result_ +type ExecResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` +} + +func NewExecResponse() *ExecResponse { + return &ExecResponse{ + Result_: NewResponseCommon(), + } +} + +var ExecResponse_Result__DEFAULT *ResponseCommon +func (p *ExecResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ExecResponse_Result__DEFAULT + } +return p.Result_ +} +func (p *ExecResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ExecResponse) 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 + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 *ExecResponse) 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 *ExecResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResponse"); 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 *ExecResponse) 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 *ExecResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("ExecResponse({Result_:%s})", resultVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - VertexProps +// - EdgeProps +// - Expressions +// - Dedup +// - OrderBy +// - Limit +// - Filter +type GetPropRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.Row `thrift:"parts,2" db:"parts" json:"parts"` + VertexProps []*VertexProp `thrift:"vertex_props,3" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,4" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,5" db:"expressions" json:"expressions,omitempty"` + Dedup bool `thrift:"dedup,6" db:"dedup" json:"dedup"` + OrderBy []*OrderBy `thrift:"order_by,7" db:"order_by" json:"order_by,omitempty"` + Limit *int64 `thrift:"limit,8" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,9" db:"filter" json:"filter,omitempty"` +} + +func NewGetPropRequest() *GetPropRequest { + return &GetPropRequest{} +} + + +func (p *GetPropRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetPropRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetPropRequest_VertexProps_DEFAULT []*VertexProp + +func (p *GetPropRequest) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var GetPropRequest_EdgeProps_DEFAULT []*EdgeProp + +func (p *GetPropRequest) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var GetPropRequest_Expressions_DEFAULT []*Expr + +func (p *GetPropRequest) GetExpressions() []*Expr { + return p.Expressions +} + +func (p *GetPropRequest) GetDedup() bool { + return p.Dedup +} +var GetPropRequest_OrderBy_DEFAULT []*OrderBy + +func (p *GetPropRequest) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var GetPropRequest_Limit_DEFAULT int64 +func (p *GetPropRequest) GetLimit() int64 { + if !p.IsSetLimit() { + return GetPropRequest_Limit_DEFAULT + } +return *p.Limit +} +var GetPropRequest_Filter_DEFAULT []byte + +func (p *GetPropRequest) GetFilter() []byte { + return p.Filter +} +func (p *GetPropRequest) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *GetPropRequest) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *GetPropRequest) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *GetPropRequest) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *GetPropRequest) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *GetPropRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *GetPropRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key15 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key15 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val16 := tSlice + for i := 0; i < size; i ++ { + _elem17 := nebula0.NewRow() + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + _val16 = append(_val16, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem18 := NewVertexProp() + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.VertexProps = append(p.VertexProps, _elem18) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem19 := NewEdgeProp() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + p.EdgeProps = append(p.EdgeProps, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem20 := NewExpr() + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + } + p.Expressions = append(p.Expressions, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *GetPropRequest) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem21 := NewOrderBy() + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + } + p.OrderBy = append(p.OrderBy, _elem21) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *GetPropRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *GetPropRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:edge_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:expressions: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dedup: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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 7:order_by: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:limit: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:filter: ", p), err) } + } + return err +} + +func (p *GetPropRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + dedupVal := fmt.Sprintf("%v", p.Dedup) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + limitVal = fmt.Sprintf("%v", *p.Limit) + } + filterVal := fmt.Sprintf("%v", p.Filter) + return fmt.Sprintf("GetPropRequest({SpaceID:%s Parts:%s VertexProps:%s EdgeProps:%s Expressions:%s Dedup:%s OrderBy:%s Limit:%s Filter:%s})", spaceIDVal, partsVal, vertexPropsVal, edgePropsVal, expressionsVal, dedupVal, orderByVal, limitVal, filterVal) +} + +// Attributes: +// - Result_ +// - Props +type GetPropResponse struct { + Result_ *ResponseCommon `thrift:"result,1" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewGetPropResponse() *GetPropResponse { + return &GetPropResponse{ + Result_: NewResponseCommon(), + } +} + +var GetPropResponse_Result__DEFAULT *ResponseCommon +func (p *GetPropResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetPropResponse_Result__DEFAULT + } +return p.Result_ +} +var GetPropResponse_Props_DEFAULT *nebula0.DataSet +func (p *GetPropResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return GetPropResponse_Props_DEFAULT + } +return p.Props +} +func (p *GetPropResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetPropResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *GetPropResponse) 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 *GetPropResponse) 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 *GetPropResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *GetPropResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropResponse"); 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 *GetPropResponse) 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 *GetPropResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *GetPropResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("GetPropResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - TagID +// - Props +type NewTag_ struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewTag_() *NewTag_ { + return &NewTag_{} +} + + +func (p *NewTag_) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *NewTag_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewTag_) 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 *NewTag_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *NewTag_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + p.Props = tSlice + for i := 0; i < size; i ++ { + _elem22 := nebula0.NewValue() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.Props = append(p.Props, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewTag_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewTag"); 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 *NewTag_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *NewTag_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewTag_) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewTag_({TagID:%s Props:%s})", tagIDVal, propsVal) +} + +// Attributes: +// - Id +// - Tags +type NewVertex_ struct { + Id *nebula0.Value `thrift:"id,1" db:"id" json:"id"` + Tags []*NewTag_ `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewNewVertex_() *NewVertex_ { + return &NewVertex_{} +} + +var NewVertex__Id_DEFAULT *nebula0.Value +func (p *NewVertex_) GetId() *nebula0.Value { + if !p.IsSetId() { + return NewVertex__Id_DEFAULT + } +return p.Id +} + +func (p *NewVertex_) GetTags() []*NewTag_ { + return p.Tags +} +func (p *NewVertex_) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *NewVertex_) 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 *NewVertex_) ReadField1(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *NewVertex_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewTag_, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem23 := NewNewTag_() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Tags = append(p.Tags, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewVertex_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewVertex"); 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 *NewVertex_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *NewVertex_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *NewVertex_) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("NewVertex_({Id:%s Tags:%s})", idVal, tagsVal) +} + +// Attributes: +// - Src +// - EdgeType +// - Ranking +// - Dst +type EdgeKey struct { + Src *nebula0.Value `thrift:"src,1" db:"src" json:"src"` + EdgeType nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type"` + Ranking nebula0.EdgeRanking `thrift:"ranking,3" db:"ranking" json:"ranking"` + Dst *nebula0.Value `thrift:"dst,4" db:"dst" json:"dst"` +} + +func NewEdgeKey() *EdgeKey { + return &EdgeKey{} +} + +var EdgeKey_Src_DEFAULT *nebula0.Value +func (p *EdgeKey) GetSrc() *nebula0.Value { + if !p.IsSetSrc() { + return EdgeKey_Src_DEFAULT + } +return p.Src +} + +func (p *EdgeKey) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeKey) GetRanking() nebula0.EdgeRanking { + return p.Ranking +} +var EdgeKey_Dst_DEFAULT *nebula0.Value +func (p *EdgeKey) GetDst() *nebula0.Value { + if !p.IsSetDst() { + return EdgeKey_Dst_DEFAULT + } +return p.Dst +} +func (p *EdgeKey) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *EdgeKey) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *EdgeKey) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeKey) ReadField1(iprot thrift.Protocol) error { + p.Src = nebula0.NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *EdgeKey) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeKey) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *EdgeKey) ReadField4(iprot thrift.Protocol) error { + p.Dst = nebula0.NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *EdgeKey) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeKey"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeKey) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *EdgeKey) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + return err +} + +func (p *EdgeKey) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ranking: ", p), err) } + return err +} + +func (p *EdgeKey) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dst: ", p), err) } + return err +} + +func (p *EdgeKey) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + rankingVal := fmt.Sprintf("%v", p.Ranking) + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + return fmt.Sprintf("EdgeKey({Src:%s EdgeType:%s Ranking:%s Dst:%s})", srcVal, edgeTypeVal, rankingVal, dstVal) +} + +// Attributes: +// - Key +// - Props +type NewEdge_ struct { + Key *EdgeKey `thrift:"key,1" db:"key" json:"key"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewEdge_() *NewEdge_ { + return &NewEdge_{ + Key: NewEdgeKey(), + } +} + +var NewEdge__Key_DEFAULT *EdgeKey +func (p *NewEdge_) GetKey() *EdgeKey { + if !p.IsSetKey() { + return NewEdge__Key_DEFAULT + } +return p.Key +} + +func (p *NewEdge_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewEdge_) IsSetKey() bool { + return p != nil && p.Key != nil +} + +func (p *NewEdge_) 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 *NewEdge_) ReadField1(iprot thrift.Protocol) error { + p.Key = NewEdgeKey() + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *NewEdge_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Props = append(p.Props, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewEdge_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewEdge"); 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 *NewEdge_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *NewEdge_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewEdge_) String() string { + if p == nil { + return "" + } + + var keyVal string + if p.Key == nil { + keyVal = "" + } else { + keyVal = fmt.Sprintf("%v", p.Key) + } + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewEdge_({Key:%s Props:%s})", keyVal, propsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +type AddVerticesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewAddVerticesRequest() *AddVerticesRequest { + return &AddVerticesRequest{} +} + + +func (p *AddVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddVerticesRequest) GetParts() map[nebula0.PartitionID][]*NewVertex_ { + return p.Parts +} + +func (p *AddVerticesRequest) GetPropNames() map[nebula0.TagID][][]byte { + return p.PropNames +} + +func (p *AddVerticesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *AddVerticesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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][]*NewVertex_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key25 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key25 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewVertex_, 0, size) + _val26 := tSlice + for i := 0; i < size; i ++ { + _elem27 := NewNewVertex_() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + _val26 = append(_val26, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key25] = _val26 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.TagID][][]byte, size) + p.PropNames = tMap + for i := 0; i < size; i ++ { +var _key28 nebula0.TagID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.TagID(v) + _key28 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val29 := tSlice + for i := 0; i < size; i ++ { +var _elem30 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem30 = v +} + _val29 = append(_val29, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PropNames[_key28] = _val29 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddVerticesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PropNames { + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:prop_names: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +type AddEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewAddEdgesRequest() *AddEdgesRequest { + return &AddEdgesRequest{} +} + + +func (p *AddEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddEdgesRequest) GetParts() map[nebula0.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *AddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *AddEdgesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *AddEdgesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key31 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val32 := tSlice + for i := 0; i < size; i ++ { + _elem33 := NewNewEdge_() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) + } + _val32 = append(_val32, _elem33) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key31] = _val32 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField3(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.PropNames = tSlice + for i := 0; i < size; i ++ { +var _elem34 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem34 = v +} + p.PropNames = append(p.PropNames, _elem34) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddEdgesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteVerticesRequest 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"` +} + +func NewDeleteVerticesRequest() *DeleteVerticesRequest { + return &DeleteVerticesRequest{} +} + + +func (p *DeleteVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteVerticesRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { + return p.Parts +} +func (p *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key35 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key35 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + _val36 := tSlice + for i := 0; i < size; i ++ { + _elem37 := nebula0.NewValue() + if err := _elem37.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + _val36 = append(_val36, _elem37) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key35] = _val36 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteVerticesRequest"); 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("DeleteVerticesRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*EdgeKey `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewDeleteEdgesRequest() *DeleteEdgesRequest { + return &DeleteEdgesRequest{} +} + + +func (p *DeleteEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteEdgesRequest) GetParts() map[nebula0.PartitionID][]*EdgeKey { + return p.Parts +} +func (p *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key38 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key38 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val39 := tSlice + for i := 0; i < size; i ++ { + _elem40 := NewEdgeKey() + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + _val39 = append(_val39, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key38] = _val39 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteEdgesRequest"); 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("DeleteEdgesRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - Result_ +// - Props +type UpdateResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewUpdateResponse() *UpdateResponse { + return &UpdateResponse{ + Result_: NewResponseCommon(), + } +} + +var UpdateResponse_Result__DEFAULT *ResponseCommon +func (p *UpdateResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return UpdateResponse_Result__DEFAULT + } +return p.Result_ +} +var UpdateResponse_Props_DEFAULT *nebula0.DataSet +func (p *UpdateResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return UpdateResponse_Props_DEFAULT + } +return p.Props +} +func (p *UpdateResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *UpdateResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *UpdateResponse) 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 *UpdateResponse) 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 *UpdateResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *UpdateResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateResponse"); 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 *UpdateResponse) 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 *UpdateResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("UpdateResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - Name +// - Value +type UpdatedProp struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewUpdatedProp() *UpdatedProp { + return &UpdatedProp{} +} + + +func (p *UpdatedProp) GetName() []byte { + return p.Name +} + +func (p *UpdatedProp) GetValue() []byte { + return p.Value +} +func (p *UpdatedProp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetValue 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *UpdatedProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *UpdatedProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *UpdatedProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdatedProp"); 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 *UpdatedProp) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *UpdatedProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *UpdatedProp) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("UpdatedProp({Name:%s Value:%s})", nameVal, valueVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - VertexID +// - TagID +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + VertexID *nebula0.Value `thrift:"vertex_id,3" db:"vertex_id" json:"vertex_id"` + TagID nebula0.TagID `thrift:"tag_id,4,required" db:"tag_id" json:"tag_id"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,5" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,6" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,7" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,8" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateVertexRequest() *UpdateVertexRequest { + return &UpdateVertexRequest{} +} + + +func (p *UpdateVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateVertexRequest_VertexID_DEFAULT *nebula0.Value +func (p *UpdateVertexRequest) GetVertexID() *nebula0.Value { + if !p.IsSetVertexID() { + return UpdateVertexRequest_VertexID_DEFAULT + } +return p.VertexID +} + +func (p *UpdateVertexRequest) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *UpdateVertexRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateVertexRequest_Insertable_DEFAULT bool = false + +func (p *UpdateVertexRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateVertexRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateVertexRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateVertexRequest_Condition_DEFAULT []byte + +func (p *UpdateVertexRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateVertexRequest) IsSetVertexID() bool { + return p != nil && p.VertexID != nil +} + +func (p *UpdateVertexRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateVertexRequest_Insertable_DEFAULT +} + +func (p *UpdateVertexRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateVertexRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateVertexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTagID 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 + } + 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 + } + issetTagID = true + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetTagID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagID is not set")); + } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField3(iprot thrift.Protocol) error { + p.VertexID = nebula0.NewValue() + if err := p.VertexID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexID), err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem41 := NewUpdatedProp() + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField7(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem42 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem42 = v +} + p.ReturnProps = append(p.ReturnProps, _elem42) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_id: ", p), err) } + if err := p.VertexID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tag_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updated_props: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:insertable: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:return_props: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:condition: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var vertexIDVal string + if p.VertexID == nil { + vertexIDVal = "" + } else { + vertexIDVal = fmt.Sprintf("%v", p.VertexID) + } + tagIDVal := fmt.Sprintf("%v", p.TagID) + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + return fmt.Sprintf("UpdateVertexRequest({SpaceID:%s PartID:%s VertexID:%s TagID:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s})", spaceIDVal, partIDVal, vertexIDVal, tagIDVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - EdgeKey +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + EdgeKey *EdgeKey `thrift:"edge_key,3" db:"edge_key" json:"edge_key"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,4" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,5" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,6" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,7" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateEdgeRequest() *UpdateEdgeRequest { + return &UpdateEdgeRequest{ + EdgeKey: NewEdgeKey(), + } +} + + +func (p *UpdateEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateEdgeRequest_EdgeKey_DEFAULT *EdgeKey +func (p *UpdateEdgeRequest) GetEdgeKey() *EdgeKey { + if !p.IsSetEdgeKey() { + return UpdateEdgeRequest_EdgeKey_DEFAULT + } +return p.EdgeKey +} + +func (p *UpdateEdgeRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateEdgeRequest_Insertable_DEFAULT bool = false + +func (p *UpdateEdgeRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateEdgeRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateEdgeRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateEdgeRequest_Condition_DEFAULT []byte + +func (p *UpdateEdgeRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateEdgeRequest) IsSetEdgeKey() bool { + return p != nil && p.EdgeKey != nil +} + +func (p *UpdateEdgeRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateEdgeRequest_Insertable_DEFAULT +} + +func (p *UpdateEdgeRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateEdgeRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField3(iprot thrift.Protocol) error { + p.EdgeKey = NewEdgeKey() + if err := p.EdgeKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeKey), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem43 := NewUpdatedProp() + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem43) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField6(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem44 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem44 = v +} + p.ReturnProps = append(p.ReturnProps, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_key", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_key: ", p), err) } + if err := p.EdgeKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_key: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:updated_props: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:insertable: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + 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 6:return_props: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:condition: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var edgeKeyVal string + if p.EdgeKey == nil { + edgeKeyVal = "" + } else { + edgeKeyVal = fmt.Sprintf("%v", p.EdgeKey) + } + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + return fmt.Sprintf("UpdateEdgeRequest({SpaceID:%s PartID:%s EdgeKey:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s})", spaceIDVal, partIDVal, edgeKeyVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Name +type GetUUIDReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Name []byte `thrift:"name,3" db:"name" json:"name"` +} + +func NewGetUUIDReq() *GetUUIDReq { + return &GetUUIDReq{} +} + + +func (p *GetUUIDReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetUUIDReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetUUIDReq) GetName() []byte { + return p.Name +} +func (p *GetUUIDReq) 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 *GetUUIDReq) 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 *GetUUIDReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *GetUUIDReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDReq"); 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 *GetUUIDReq) 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 *GetUUIDReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *GetUUIDReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("GetUUIDReq({SpaceID:%s PartID:%s Name:%s})", spaceIDVal, partIDVal, nameVal) +} + +// Attributes: +// - Result_ +// - Id +type GetUUIDResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Id *nebula0.Value `thrift:"id,2" db:"id" json:"id"` +} + +func NewGetUUIDResp() *GetUUIDResp { + return &GetUUIDResp{ + Result_: NewResponseCommon(), + } +} + +var GetUUIDResp_Result__DEFAULT *ResponseCommon +func (p *GetUUIDResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetUUIDResp_Result__DEFAULT + } +return p.Result_ +} +var GetUUIDResp_Id_DEFAULT *nebula0.Value +func (p *GetUUIDResp) GetId() *nebula0.Value { + if !p.IsSetId() { + return GetUUIDResp_Id_DEFAULT + } +return p.Id +} +func (p *GetUUIDResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetUUIDResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *GetUUIDResp) 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 *GetUUIDResp) 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 *GetUUIDResp) ReadField2(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *GetUUIDResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDResp"); 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 *GetUUIDResp) 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 *GetUUIDResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *GetUUIDResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + return fmt.Sprintf("GetUUIDResp({Result_:%s Id:%s})", resultVal, idVal) +} + +// Attributes: +// - Result_ +// - Data +type LookupIndexResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Data *nebula0.DataSet `thrift:"data,2" db:"data" json:"data,omitempty"` +} + +func NewLookupIndexResp() *LookupIndexResp { + return &LookupIndexResp{ + Result_: NewResponseCommon(), + } +} + +var LookupIndexResp_Result__DEFAULT *ResponseCommon +func (p *LookupIndexResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return LookupIndexResp_Result__DEFAULT + } +return p.Result_ +} +var LookupIndexResp_Data_DEFAULT *nebula0.DataSet +func (p *LookupIndexResp) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return LookupIndexResp_Data_DEFAULT + } +return p.Data +} +func (p *LookupIndexResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *LookupIndexResp) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *LookupIndexResp) 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 *LookupIndexResp) 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 *LookupIndexResp) ReadField2(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *LookupIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexResp"); 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 *LookupIndexResp) 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 *LookupIndexResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + return fmt.Sprintf("LookupIndexResp({Result_:%s Data:%s})", resultVal, dataVal) +} + +// Attributes: +// - ColumnName +// - ScanType +// - BeginValue +// - EndValue +type IndexColumnHint struct { + ColumnName []byte `thrift:"column_name,1" db:"column_name" json:"column_name"` + ScanType ScanType `thrift:"scan_type,2" db:"scan_type" json:"scan_type"` + BeginValue *nebula0.Value `thrift:"begin_value,3" db:"begin_value" json:"begin_value"` + EndValue *nebula0.Value `thrift:"end_value,4" db:"end_value" json:"end_value"` +} + +func NewIndexColumnHint() *IndexColumnHint { + return &IndexColumnHint{} +} + + +func (p *IndexColumnHint) GetColumnName() []byte { + return p.ColumnName +} + +func (p *IndexColumnHint) GetScanType() ScanType { + return p.ScanType +} +var IndexColumnHint_BeginValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetBeginValue() *nebula0.Value { + if !p.IsSetBeginValue() { + return IndexColumnHint_BeginValue_DEFAULT + } +return p.BeginValue +} +var IndexColumnHint_EndValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetEndValue() *nebula0.Value { + if !p.IsSetEndValue() { + return IndexColumnHint_EndValue_DEFAULT + } +return p.EndValue +} +func (p *IndexColumnHint) IsSetBeginValue() bool { + return p != nil && p.BeginValue != nil +} + +func (p *IndexColumnHint) IsSetEndValue() bool { + return p != nil && p.EndValue != nil +} + +func (p *IndexColumnHint) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *IndexColumnHint) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ScanType(v) + p.ScanType = temp +} + return nil +} + +func (p *IndexColumnHint) ReadField3(iprot thrift.Protocol) error { + p.BeginValue = nebula0.NewValue() + if err := p.BeginValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BeginValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField4(iprot thrift.Protocol) error { + p.EndValue = nebula0.NewValue() + if err := p.EndValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndValue), err) + } + return nil +} + +func (p *IndexColumnHint) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexColumnHint"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexColumnHint) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:column_name: ", p), err) } + if err := oprot.WriteBinary(p.ColumnName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.column_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_name: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("scan_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:scan_type: ", p), err) } + if err := oprot.WriteI32(int32(p.ScanType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.scan_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:scan_type: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("begin_value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:begin_value: ", p), err) } + if err := p.BeginValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BeginValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:begin_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:end_value: ", p), err) } + if err := p.EndValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:end_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) String() string { + if p == nil { + return "" + } + + columnNameVal := fmt.Sprintf("%v", p.ColumnName) + scanTypeVal := fmt.Sprintf("%v", p.ScanType) + var beginValueVal string + if p.BeginValue == nil { + beginValueVal = "" + } else { + beginValueVal = fmt.Sprintf("%v", p.BeginValue) + } + var endValueVal string + if p.EndValue == nil { + endValueVal = "" + } else { + endValueVal = fmt.Sprintf("%v", p.EndValue) + } + return fmt.Sprintf("IndexColumnHint({ColumnName:%s ScanType:%s BeginValue:%s EndValue:%s})", columnNameVal, scanTypeVal, beginValueVal, endValueVal) +} + +// Attributes: +// - IndexID +// - Filter +// - ColumnHints +type IndexQueryContext struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + Filter []byte `thrift:"filter,2" db:"filter" json:"filter"` + ColumnHints []*IndexColumnHint `thrift:"column_hints,3" db:"column_hints" json:"column_hints"` +} + +func NewIndexQueryContext() *IndexQueryContext { + return &IndexQueryContext{} +} + + +func (p *IndexQueryContext) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexQueryContext) GetFilter() []byte { + return p.Filter +} + +func (p *IndexQueryContext) GetColumnHints() []*IndexColumnHint { + return p.ColumnHints +} +func (p *IndexQueryContext) 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 *IndexQueryContext) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexQueryContext) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *IndexQueryContext) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexColumnHint, 0, size) + p.ColumnHints = tSlice + for i := 0; i < size; i ++ { + _elem45 := NewIndexColumnHint() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.ColumnHints = append(p.ColumnHints, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexQueryContext) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexQueryContext"); 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 *IndexQueryContext) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:filter: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_hints", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:column_hints: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColumnHints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnHints { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:column_hints: ", p), err) } + return err +} + +func (p *IndexQueryContext) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + filterVal := fmt.Sprintf("%v", p.Filter) + columnHintsVal := fmt.Sprintf("%v", p.ColumnHints) + return fmt.Sprintf("IndexQueryContext({IndexID:%s Filter:%s ColumnHints:%s})", indexIDVal, filterVal, columnHintsVal) +} + +// Attributes: +// - Contexts +// - IsEdge +// - TagOrEdgeID +type IndexSpec struct { + Contexts []*IndexQueryContext `thrift:"contexts,1,required" db:"contexts" json:"contexts"` + IsEdge bool `thrift:"is_edge,2,required" db:"is_edge" json:"is_edge"` + TagOrEdgeID int32 `thrift:"tag_or_edge_id,3,required" db:"tag_or_edge_id" json:"tag_or_edge_id"` +} + +func NewIndexSpec() *IndexSpec { + return &IndexSpec{} +} + + +func (p *IndexSpec) GetContexts() []*IndexQueryContext { + return p.Contexts +} + +func (p *IndexSpec) GetIsEdge() bool { + return p.IsEdge +} + +func (p *IndexSpec) GetTagOrEdgeID() int32 { + return p.TagOrEdgeID +} +func (p *IndexSpec) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetContexts bool = false; + var issetIsEdge bool = false; + var issetTagOrEdgeID 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 + } + issetContexts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetIsEdge = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTagOrEdgeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetContexts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Contexts is not set")); + } + if !issetIsEdge{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsEdge is not set")); + } + if !issetTagOrEdgeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagOrEdgeID is not set")); + } + return nil +} + +func (p *IndexSpec) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexQueryContext, 0, size) + p.Contexts = tSlice + for i := 0; i < size; i ++ { + _elem46 := NewIndexQueryContext() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Contexts = append(p.Contexts, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsEdge = v +} + return nil +} + +func (p *IndexSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagOrEdgeID = v +} + return nil +} + +func (p *IndexSpec) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexSpec"); 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 *IndexSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("contexts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:contexts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Contexts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Contexts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:contexts: ", p), err) } + return err +} + +func (p *IndexSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_edge", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_edge: ", p), err) } + if err := oprot.WriteBool(bool(p.IsEdge)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_edge (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_edge: ", p), err) } + return err +} + +func (p *IndexSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_or_edge_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_or_edge_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagOrEdgeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_or_edge_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_or_edge_id: ", p), err) } + return err +} + +func (p *IndexSpec) String() string { + if p == nil { + return "" + } + + contextsVal := fmt.Sprintf("%v", p.Contexts) + isEdgeVal := fmt.Sprintf("%v", p.IsEdge) + tagOrEdgeIDVal := fmt.Sprintf("%v", p.TagOrEdgeID) + return fmt.Sprintf("IndexSpec({Contexts:%s IsEdge:%s TagOrEdgeID:%s})", contextsVal, isEdgeVal, tagOrEdgeIDVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - ReturnColumns +type LookupIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + ReturnColumns [][]byte `thrift:"return_columns,4" db:"return_columns" json:"return_columns,omitempty"` +} + +func NewLookupIndexRequest() *LookupIndexRequest { + return &LookupIndexRequest{ + Indices: NewIndexSpec(), + } +} + + +func (p *LookupIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupIndexRequest_Indices_DEFAULT *IndexSpec +func (p *LookupIndexRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupIndexRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupIndexRequest_ReturnColumns_DEFAULT [][]byte + +func (p *LookupIndexRequest) GetReturnColumns() [][]byte { + return p.ReturnColumns +} +func (p *LookupIndexRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupIndexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *LookupIndexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem47 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem47 = temp +} + p.Parts = append(p.Parts, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField4(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.ReturnColumns = tSlice + for i := 0; i < size; i ++ { +var _elem48 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem48 = v +} + p.ReturnColumns = append(p.ReturnColumns, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetReturnColumns() { + if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + 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 4:return_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + returnColumnsVal := fmt.Sprintf("%v", p.ReturnColumns) + return fmt.Sprintf("LookupIndexRequest({SpaceID:%s Parts:%s Indices:%s ReturnColumns:%s})", spaceIDVal, partsVal, indicesVal, returnColumnsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - TraverseSpec +type LookupAndTraverseRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewLookupAndTraverseRequest() *LookupAndTraverseRequest { + return &LookupAndTraverseRequest{ + Indices: NewIndexSpec(), + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *LookupAndTraverseRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupAndTraverseRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupAndTraverseRequest_Indices_DEFAULT *IndexSpec +func (p *LookupAndTraverseRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupAndTraverseRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupAndTraverseRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *LookupAndTraverseRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return LookupAndTraverseRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *LookupAndTraverseRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupAndTraverseRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *LookupAndTraverseRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem49 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem49 = temp +} + p.Parts = append(p.Parts, _elem49) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupAndTraverseRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + var traverseSpecVal string + if p.TraverseSpec == nil { + traverseSpecVal = "" + } else { + traverseSpecVal = fmt.Sprintf("%v", p.TraverseSpec) + } + return fmt.Sprintf("LookupAndTraverseRequest({SpaceID:%s Parts:%s Indices:%s TraverseSpec:%s})", spaceIDVal, partsVal, indicesVal, traverseSpecVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *VertexProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanVertexRequest() *ScanVertexRequest { + return &ScanVertexRequest{ + ReturnColumns: NewVertexProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanVertexRequest_Cursor_DEFAULT []byte + +func (p *ScanVertexRequest) GetCursor() []byte { + return p.Cursor +} +var ScanVertexRequest_ReturnColumns_DEFAULT *VertexProp +func (p *ScanVertexRequest) GetReturnColumns() *VertexProp { + if !p.IsSetReturnColumns() { + return ScanVertexRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanVertexRequest) GetLimit() int64 { + return p.Limit +} +var ScanVertexRequest_StartTime_DEFAULT int64 +func (p *ScanVertexRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanVertexRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanVertexRequest_EndTime_DEFAULT int64 +func (p *ScanVertexRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanVertexRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanVertexRequest_Filter_DEFAULT []byte + +func (p *ScanVertexRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanVertexRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanVertexRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanVertexRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanVertexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanVertexRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanVertexRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanVertexRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanVertexRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanVertexRequest) 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 *ScanVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanVertexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewVertexProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexRequest) 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 *ScanVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + return fmt.Sprintf("ScanVertexRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal) +} + +// Attributes: +// - Result_ +// - VertexData +// - HasNext +// - NextCursor +type ScanVertexResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + VertexData *nebula0.DataSet `thrift:"vertex_data,2" db:"vertex_data" json:"vertex_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanVertexResponse() *ScanVertexResponse { + return &ScanVertexResponse{ + Result_: NewResponseCommon(), + VertexData: nebula0.NewDataSet(), + } +} + +var ScanVertexResponse_Result__DEFAULT *ResponseCommon +func (p *ScanVertexResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanVertexResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanVertexResponse_VertexData_DEFAULT *nebula0.DataSet +func (p *ScanVertexResponse) GetVertexData() *nebula0.DataSet { + if !p.IsSetVertexData() { + return ScanVertexResponse_VertexData_DEFAULT + } +return p.VertexData +} + +func (p *ScanVertexResponse) GetHasNext() bool { + return p.HasNext +} +var ScanVertexResponse_NextCursor_DEFAULT []byte + +func (p *ScanVertexResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanVertexResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanVertexResponse) IsSetVertexData() bool { + return p != nil && p.VertexData != nil +} + +func (p *ScanVertexResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanVertexResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanVertexResponse) ReadField1(iprot thrift.Protocol) error { + p.Result_ = NewResponseCommon() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField2(iprot thrift.Protocol) error { + p.VertexData = nebula0.NewDataSet() + if err := p.VertexData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexData), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanVertexResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanVertexResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } + if err := p.Result_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertex_data: ", p), err) } + if err := p.VertexData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertex_data: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var vertexDataVal string + if p.VertexData == nil { + vertexDataVal = "" + } else { + vertexDataVal = fmt.Sprintf("%v", p.VertexData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanVertexResponse({Result_:%s VertexData:%s HasNext:%s NextCursor:%s})", resultVal, vertexDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *EdgeProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanEdgeRequest() *ScanEdgeRequest { + return &ScanEdgeRequest{ + ReturnColumns: NewEdgeProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanEdgeRequest_Cursor_DEFAULT []byte + +func (p *ScanEdgeRequest) GetCursor() []byte { + return p.Cursor +} +var ScanEdgeRequest_ReturnColumns_DEFAULT *EdgeProp +func (p *ScanEdgeRequest) GetReturnColumns() *EdgeProp { + if !p.IsSetReturnColumns() { + return ScanEdgeRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanEdgeRequest) GetLimit() int64 { + return p.Limit +} +var ScanEdgeRequest_StartTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanEdgeRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanEdgeRequest_EndTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanEdgeRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanEdgeRequest_Filter_DEFAULT []byte + +func (p *ScanEdgeRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanEdgeRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanEdgeRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanEdgeRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanEdgeRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanEdgeRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanEdgeRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanEdgeRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanEdgeRequest) 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 *ScanEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewEdgeProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeRequest) 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 *ScanEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + return fmt.Sprintf("ScanEdgeRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal) +} + +// Attributes: +// - Result_ +// - EdgeData +// - HasNext +// - NextCursor +type ScanEdgeResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + EdgeData *nebula0.DataSet `thrift:"edge_data,2" db:"edge_data" json:"edge_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanEdgeResponse() *ScanEdgeResponse { + return &ScanEdgeResponse{ + Result_: NewResponseCommon(), + EdgeData: nebula0.NewDataSet(), + } +} + +var ScanEdgeResponse_Result__DEFAULT *ResponseCommon +func (p *ScanEdgeResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanEdgeResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanEdgeResponse_EdgeData_DEFAULT *nebula0.DataSet +func (p *ScanEdgeResponse) GetEdgeData() *nebula0.DataSet { + if !p.IsSetEdgeData() { + return ScanEdgeResponse_EdgeData_DEFAULT + } +return p.EdgeData +} + +func (p *ScanEdgeResponse) GetHasNext() bool { + return p.HasNext +} +var ScanEdgeResponse_NextCursor_DEFAULT []byte + +func (p *ScanEdgeResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanEdgeResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanEdgeResponse) IsSetEdgeData() bool { + return p != nil && p.EdgeData != nil +} + +func (p *ScanEdgeResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) ReadField2(iprot thrift.Protocol) error { + p.EdgeData = nebula0.NewDataSet() + if err := p.EdgeData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeData), err) + } + return nil +} + +func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanEdgeResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeResponse"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_data: ", p), err) } + if err := p.EdgeData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_data: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var edgeDataVal string + if p.EdgeData == nil { + edgeDataVal = "" + } else { + edgeDataVal = fmt.Sprintf("%v", p.EdgeData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanEdgeResponse({Result_:%s EdgeData:%s HasNext:%s NextCursor:%s})", resultVal, edgeDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - TaskSpecficParas +type TaskPara struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts,omitempty"` + TaskSpecficParas [][]byte `thrift:"task_specfic_paras,3" db:"task_specfic_paras" json:"task_specfic_paras,omitempty"` +} + +func NewTaskPara() *TaskPara { + return &TaskPara{} +} + + +func (p *TaskPara) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var TaskPara_Parts_DEFAULT []nebula0.PartitionID + +func (p *TaskPara) GetParts() []nebula0.PartitionID { + return p.Parts +} +var TaskPara_TaskSpecficParas_DEFAULT [][]byte + +func (p *TaskPara) GetTaskSpecficParas() [][]byte { + return p.TaskSpecficParas +} +func (p *TaskPara) IsSetParts() bool { + return p != nil && p.Parts != nil +} + +func (p *TaskPara) IsSetTaskSpecficParas() bool { + return p != nil && p.TaskSpecficParas != nil +} + +func (p *TaskPara) 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 *TaskPara) 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 *TaskPara) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem50 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem50 = temp +} + p.Parts = append(p.Parts, _elem50) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) ReadField3(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.TaskSpecficParas = tSlice + for i := 0; i < size; i ++ { +var _elem51 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem51 = v +} + p.TaskSpecficParas = append(p.TaskSpecficParas, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskPara"); 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 *TaskPara) 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 *TaskPara) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetParts() { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + } + return err +} + +func (p *TaskPara) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskSpecficParas() { + if err := oprot.WriteFieldBegin("task_specfic_paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specfic_paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.TaskSpecficParas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskSpecficParas { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_specfic_paras: ", p), err) } + } + return err +} + +func (p *TaskPara) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + taskSpecficParasVal := fmt.Sprintf("%v", p.TaskSpecficParas) + return fmt.Sprintf("TaskPara({SpaceID:%s Parts:%s TaskSpecficParas:%s})", spaceIDVal, partsVal, taskSpecficParasVal) +} + +// Attributes: +// - Cmd +// - JobID +// - TaskID +// - Para +// - Concurrency +type AddAdminTaskRequest struct { + Cmd meta1.AdminCmd `thrift:"cmd,1" db:"cmd" json:"cmd"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Para *TaskPara `thrift:"para,4" db:"para" json:"para"` + Concurrency *int32 `thrift:"concurrency,5" db:"concurrency" json:"concurrency,omitempty"` +} + +func NewAddAdminTaskRequest() *AddAdminTaskRequest { + return &AddAdminTaskRequest{ + Para: NewTaskPara(), + } +} + + +func (p *AddAdminTaskRequest) GetCmd() meta1.AdminCmd { + return p.Cmd +} + +func (p *AddAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *AddAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +var AddAdminTaskRequest_Para_DEFAULT *TaskPara +func (p *AddAdminTaskRequest) GetPara() *TaskPara { + if !p.IsSetPara() { + return AddAdminTaskRequest_Para_DEFAULT + } +return p.Para +} +var AddAdminTaskRequest_Concurrency_DEFAULT int32 +func (p *AddAdminTaskRequest) GetConcurrency() int32 { + if !p.IsSetConcurrency() { + return AddAdminTaskRequest_Concurrency_DEFAULT + } +return *p.Concurrency +} +func (p *AddAdminTaskRequest) IsSetPara() bool { + return p != nil && p.Para != nil +} + +func (p *AddAdminTaskRequest) IsSetConcurrency() bool { + return p != nil && p.Concurrency != nil +} + +func (p *AddAdminTaskRequest) 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 + } + 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 *AddAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := meta1.AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField4(iprot thrift.Protocol) error { + p.Para = NewTaskPara() + if err := p.Para.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Para), err) + } + return nil +} + +func (p *AddAdminTaskRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Concurrency = &v +} + return nil +} + +func (p *AddAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddAdminTaskRequest"); 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 *AddAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("para", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:para: ", p), err) } + if err := p.Para.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Para), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:para: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetConcurrency() { + if err := oprot.WriteFieldBegin("concurrency", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:concurrency: ", p), err) } + if err := oprot.WriteI32(int32(*p.Concurrency)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.concurrency (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:concurrency: ", p), err) } + } + return err +} + +func (p *AddAdminTaskRequest) String() string { + if p == nil { + return "" + } + + cmdVal := fmt.Sprintf("%v", p.Cmd) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var paraVal string + if p.Para == nil { + paraVal = "" + } else { + paraVal = fmt.Sprintf("%v", p.Para) + } + var concurrencyVal string + if p.Concurrency == nil { + concurrencyVal = "" + } else { + concurrencyVal = fmt.Sprintf("%v", *p.Concurrency) + } + return fmt.Sprintf("AddAdminTaskRequest({Cmd:%s JobID:%s TaskID:%s Para:%s Concurrency:%s})", cmdVal, jobIDVal, taskIDVal, paraVal, concurrencyVal) +} + +// Attributes: +// - JobID +// - TaskID +type StopAdminTaskRequest struct { + JobID int32 `thrift:"job_id,1" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,2" db:"task_id" json:"task_id"` +} + +func NewStopAdminTaskRequest() *StopAdminTaskRequest { + return &StopAdminTaskRequest{} +} + + +func (p *StopAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *StopAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +func (p *StopAdminTaskRequest) 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 *StopAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *StopAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *StopAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StopAdminTaskRequest"); 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 *StopAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:task_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) String() string { + if p == nil { + return "" + } + + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + return fmt.Sprintf("StopAdminTaskRequest({JobID:%s TaskID:%s})", jobIDVal, taskIDVal) +} + +// Attributes: +// - Result_ +// - Statis +type AdminExecResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Statis *meta1.StatisItem `thrift:"statis,2" db:"statis" json:"statis,omitempty"` +} + +func NewAdminExecResp() *AdminExecResp { + return &AdminExecResp{ + Result_: NewResponseCommon(), + } +} + +var AdminExecResp_Result__DEFAULT *ResponseCommon +func (p *AdminExecResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return AdminExecResp_Result__DEFAULT + } +return p.Result_ +} +var AdminExecResp_Statis_DEFAULT *meta1.StatisItem +func (p *AdminExecResp) GetStatis() *meta1.StatisItem { + if !p.IsSetStatis() { + return AdminExecResp_Statis_DEFAULT + } +return p.Statis +} +func (p *AdminExecResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminExecResp) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *AdminExecResp) 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 *AdminExecResp) 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 *AdminExecResp) ReadField2(iprot thrift.Protocol) error { + p.Statis = meta1.NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *AdminExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminExecResp"); 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 *AdminExecResp) 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 *AdminExecResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statis: ", p), err) } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statis: ", p), err) } + } + return err +} + +func (p *AdminExecResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("AdminExecResp({Result_:%s Statis:%s})", resultVal, statisVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - NewLeader_ +type TransLeaderReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + NewLeader_ *nebula0.HostAddr `thrift:"new_leader,3" db:"new_leader" json:"new_leader"` +} + +func NewTransLeaderReq() *TransLeaderReq { + return &TransLeaderReq{ + NewLeader_: nebula0.NewHostAddr(), + } +} + + +func (p *TransLeaderReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *TransLeaderReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var TransLeaderReq_NewLeader__DEFAULT *nebula0.HostAddr +func (p *TransLeaderReq) GetNewLeader_() *nebula0.HostAddr { + if !p.IsSetNewLeader_() { + return TransLeaderReq_NewLeader__DEFAULT + } +return p.NewLeader_ +} +func (p *TransLeaderReq) IsSetNewLeader_() bool { + return p != nil && p.NewLeader_ != nil +} + +func (p *TransLeaderReq) 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 *TransLeaderReq) 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 *TransLeaderReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField3(iprot thrift.Protocol) error { + p.NewLeader_ = nebula0.NewHostAddr() + if err := p.NewLeader_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewLeader_), err) + } + return nil +} + +func (p *TransLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TransLeaderReq"); 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 *TransLeaderReq) 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 *TransLeaderReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_leader: ", p), err) } + if err := p.NewLeader_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewLeader_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_leader: ", p), err) } + return err +} + +func (p *TransLeaderReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var newLeaderVal string + if p.NewLeader_ == nil { + newLeaderVal = "" + } else { + newLeaderVal = fmt.Sprintf("%v", p.NewLeader_) + } + return fmt.Sprintf("TransLeaderReq({SpaceID:%s PartID:%s NewLeader_:%s})", spaceIDVal, partIDVal, newLeaderVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - AsLearner +// - Peers +type AddPartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + AsLearner bool `thrift:"as_learner,3" db:"as_learner" json:"as_learner"` + Peers []*nebula0.HostAddr `thrift:"peers,4" db:"peers" json:"peers"` +} + +func NewAddPartReq() *AddPartReq { + return &AddPartReq{} +} + + +func (p *AddPartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddPartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *AddPartReq) GetAsLearner() bool { + return p.AsLearner +} + +func (p *AddPartReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *AddPartReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddPartReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.AsLearner = v +} + return nil +} + +func (p *AddPartReq) ReadField4(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Peers = append(p.Peers, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddPartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddPartReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("as_learner", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:as_learner: ", p), err) } + if err := oprot.WriteBool(bool(p.AsLearner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.as_learner (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:as_learner: ", p), err) } + return err +} + +func (p *AddPartReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:peers: ", p), err) } + return err +} + +func (p *AddPartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + asLearnerVal := fmt.Sprintf("%v", p.AsLearner) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("AddPartReq({SpaceID:%s PartID:%s AsLearner:%s Peers:%s})", spaceIDVal, partIDVal, asLearnerVal, peersVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Learner +type AddLearnerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Learner *nebula0.HostAddr `thrift:"learner,3" db:"learner" json:"learner"` +} + +func NewAddLearnerReq() *AddLearnerReq { + return &AddLearnerReq{ + Learner: nebula0.NewHostAddr(), + } +} + + +func (p *AddLearnerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddLearnerReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var AddLearnerReq_Learner_DEFAULT *nebula0.HostAddr +func (p *AddLearnerReq) GetLearner() *nebula0.HostAddr { + if !p.IsSetLearner() { + return AddLearnerReq_Learner_DEFAULT + } +return p.Learner +} +func (p *AddLearnerReq) IsSetLearner() bool { + return p != nil && p.Learner != nil +} + +func (p *AddLearnerReq) 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 *AddLearnerReq) 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 *AddLearnerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField3(iprot thrift.Protocol) error { + p.Learner = nebula0.NewHostAddr() + if err := p.Learner.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Learner), err) + } + return nil +} + +func (p *AddLearnerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddLearnerReq"); 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 *AddLearnerReq) 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 *AddLearnerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("learner", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:learner: ", p), err) } + if err := p.Learner.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Learner), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:learner: ", p), err) } + return err +} + +func (p *AddLearnerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var learnerVal string + if p.Learner == nil { + learnerVal = "" + } else { + learnerVal = fmt.Sprintf("%v", p.Learner) + } + return fmt.Sprintf("AddLearnerReq({SpaceID:%s PartID:%s Learner:%s})", spaceIDVal, partIDVal, learnerVal) +} + +// Attributes: +// - SpaceID +// - PartID +type RemovePartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` +} + +func NewRemovePartReq() *RemovePartReq { + return &RemovePartReq{} +} + + +func (p *RemovePartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemovePartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +func (p *RemovePartReq) 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 *RemovePartReq) 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 *RemovePartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *RemovePartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemovePartReq"); 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 *RemovePartReq) 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 *RemovePartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *RemovePartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + return fmt.Sprintf("RemovePartReq({SpaceID:%s PartID:%s})", spaceIDVal, partIDVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peer +// - Add +type MemberChangeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peer *nebula0.HostAddr `thrift:"peer,3" db:"peer" json:"peer"` + Add bool `thrift:"add,4" db:"add" json:"add"` +} + +func NewMemberChangeReq() *MemberChangeReq { + return &MemberChangeReq{ + Peer: nebula0.NewHostAddr(), + } +} + + +func (p *MemberChangeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *MemberChangeReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var MemberChangeReq_Peer_DEFAULT *nebula0.HostAddr +func (p *MemberChangeReq) GetPeer() *nebula0.HostAddr { + if !p.IsSetPeer() { + return MemberChangeReq_Peer_DEFAULT + } +return p.Peer +} + +func (p *MemberChangeReq) GetAdd() bool { + return p.Add +} +func (p *MemberChangeReq) IsSetPeer() bool { + return p != nil && p.Peer != nil +} + +func (p *MemberChangeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField3(iprot thrift.Protocol) error { + p.Peer = nebula0.NewHostAddr() + if err := p.Peer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Peer), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Add = v +} + return nil +} + +func (p *MemberChangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MemberChangeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peer", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peer: ", p), err) } + if err := p.Peer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Peer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peer: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("add", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:add: ", p), err) } + if err := oprot.WriteBool(bool(p.Add)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.add (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:add: ", p), err) } + return err +} + +func (p *MemberChangeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var peerVal string + if p.Peer == nil { + peerVal = "" + } else { + peerVal = fmt.Sprintf("%v", p.Peer) + } + addVal := fmt.Sprintf("%v", p.Add) + return fmt.Sprintf("MemberChangeReq({SpaceID:%s PartID:%s Peer:%s Add:%s})", spaceIDVal, partIDVal, peerVal, addVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Target +type CatchUpDataReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Target *nebula0.HostAddr `thrift:"target,3" db:"target" json:"target"` +} + +func NewCatchUpDataReq() *CatchUpDataReq { + return &CatchUpDataReq{ + Target: nebula0.NewHostAddr(), + } +} + + +func (p *CatchUpDataReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CatchUpDataReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var CatchUpDataReq_Target_DEFAULT *nebula0.HostAddr +func (p *CatchUpDataReq) GetTarget() *nebula0.HostAddr { + if !p.IsSetTarget() { + return CatchUpDataReq_Target_DEFAULT + } +return p.Target +} +func (p *CatchUpDataReq) IsSetTarget() bool { + return p != nil && p.Target != nil +} + +func (p *CatchUpDataReq) 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 *CatchUpDataReq) 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 *CatchUpDataReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField3(iprot thrift.Protocol) error { + p.Target = nebula0.NewHostAddr() + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *CatchUpDataReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CatchUpDataReq"); 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 *CatchUpDataReq) 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 *CatchUpDataReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target: ", p), err) } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target: ", p), err) } + return err +} + +func (p *CatchUpDataReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var targetVal string + if p.Target == nil { + targetVal = "" + } else { + targetVal = fmt.Sprintf("%v", p.Target) + } + return fmt.Sprintf("CatchUpDataReq({SpaceID:%s PartID:%s Target:%s})", spaceIDVal, partIDVal, targetVal) +} + +type GetLeaderReq struct { +} + +func NewGetLeaderReq() *GetLeaderReq { + return &GetLeaderReq{} +} + +func (p *GetLeaderReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetLeaderReq({})") +} + +// Attributes: +// - SpaceID +// - Name +type CreateCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewCreateCPRequest() *CreateCPRequest { + return &CreateCPRequest{} +} + + +func (p *CreateCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateCPRequest) GetName() []byte { + return p.Name +} +func (p *CreateCPRequest) 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 *CreateCPRequest) 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 *CreateCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *CreateCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPRequest"); 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 *CreateCPRequest) 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 *CreateCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *CreateCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("CreateCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Name +type DropCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewDropCPRequest() *DropCPRequest { + return &DropCPRequest{} +} + + +func (p *DropCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropCPRequest) GetName() []byte { + return p.Name +} +func (p *DropCPRequest) 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 *DropCPRequest) 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 *DropCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *DropCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropCPRequest"); 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 *DropCPRequest) 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 *DropCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *DropCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Sign +type BlockingSignRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` +} + +func NewBlockingSignRequest() *BlockingSignRequest { + return &BlockingSignRequest{} +} + + +func (p *BlockingSignRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *BlockingSignRequest) GetSign() EngineSignType { + return p.Sign +} +func (p *BlockingSignRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSign 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 + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetSign = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetSign{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Sign is not set")); + } + return nil +} + +func (p *BlockingSignRequest) 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 *BlockingSignRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EngineSignType(v) + p.Sign = temp +} + return nil +} + +func (p *BlockingSignRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BlockingSignRequest"); 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 *BlockingSignRequest) 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 *BlockingSignRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sign", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sign: ", p), err) } + if err := oprot.WriteI32(int32(p.Sign)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sign (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sign: ", p), err) } + return err +} + +func (p *BlockingSignRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + signVal := fmt.Sprintf("%v", p.Sign) + return fmt.Sprintf("BlockingSignRequest({SpaceID:%s Sign:%s})", spaceIDVal, signVal) +} + +// Attributes: +// - Result_ +// - LeaderParts +type GetLeaderPartsResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + LeaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` +} + +func NewGetLeaderPartsResp() *GetLeaderPartsResp { + return &GetLeaderPartsResp{ + Result_: NewResponseCommon(), + } +} + +var GetLeaderPartsResp_Result__DEFAULT *ResponseCommon +func (p *GetLeaderPartsResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetLeaderPartsResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula0.GraphSpaceID][]nebula0.PartitionID { + return p.LeaderParts +} +func (p *GetLeaderPartsResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetLeaderPartsResp) 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key53 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key53 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val54 := tSlice + for i := 0; i < size; i ++ { +var _elem55 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem55 = temp +} + _val54 = append(_val54, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key53] = _val54 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetLeaderPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderPartsResp"); 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + 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.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader_parts: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + return fmt.Sprintf("GetLeaderPartsResp({Result_:%s LeaderParts:%s})", resultVal, leaderPartsVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peers +type CheckPeersReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peers []*nebula0.HostAddr `thrift:"peers,3" db:"peers" json:"peers"` +} + +func NewCheckPeersReq() *CheckPeersReq { + return &CheckPeersReq{} +} + + +func (p *CheckPeersReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CheckPeersReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *CheckPeersReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *CheckPeersReq) 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 *CheckPeersReq) 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 *CheckPeersReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem56 := nebula0.NewHostAddr() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Peers = append(p.Peers, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckPeersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckPeersReq"); 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 *CheckPeersReq) 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 *CheckPeersReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *CheckPeersReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("CheckPeersReq({SpaceID:%s PartID:%s Peers:%s})", spaceIDVal, partIDVal, peersVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - IndexID +type RebuildIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts"` + IndexID nebula0.IndexID `thrift:"index_id,3" db:"index_id" json:"index_id"` +} + +func NewRebuildIndexRequest() *RebuildIndexRequest { + return &RebuildIndexRequest{} +} + + +func (p *RebuildIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} + +func (p *RebuildIndexRequest) GetIndexID() nebula0.IndexID { + return p.IndexID +} +func (p *RebuildIndexRequest) 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem57 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem57 = temp +} + p.Parts = append(p.Parts, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *RebuildIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexRequest"); 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + indexIDVal := fmt.Sprintf("%v", p.IndexID) + return fmt.Sprintf("RebuildIndexRequest({SpaceID:%s Parts:%s IndexID:%s})", spaceIDVal, partsVal, indexIDVal) +} + +// Attributes: +// - Result_ +// - Info +type CreateCPResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewCreateCPResp() *CreateCPResp { + return &CreateCPResp{ + Result_: NewResponseCommon(), + } +} + +var CreateCPResp_Result__DEFAULT *ResponseCommon +func (p *CreateCPResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return CreateCPResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *CreateCPResp) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *CreateCPResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *CreateCPResp) 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 *CreateCPResp) 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 *CreateCPResp) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem58 := nebula0.NewCheckpointInfo() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Info = append(p.Info, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateCPResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPResp"); 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 *CreateCPResp) 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 *CreateCPResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) } + return err +} + +func (p *CreateCPResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("CreateCPResp({Result_:%s Info:%s})", resultVal, infoVal) +} + +// Attributes: +// - Result_ +// - Dir +type ListClusterInfoResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Result_: NewResponseCommon(), + Dir: nebula0.NewDirInfo(), + } +} + +var ListClusterInfoResp_Result__DEFAULT *ResponseCommon +func (p *ListClusterInfoResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ListClusterInfoResp_Result__DEFAULT + } +return p.Result_ +} +var ListClusterInfoResp_Dir_DEFAULT *nebula0.DirInfo +func (p *ListClusterInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return ListClusterInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *ListClusterInfoResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ListClusterInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("ListClusterInfoResp({Result_:%s Dir:%s})", resultVal, dirVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - SpaceID +// - Parts +// - ReturnPartly +type KVGetRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` + ReturnPartly bool `thrift:"return_partly,3" db:"return_partly" json:"return_partly"` +} + +func NewKVGetRequest() *KVGetRequest { + return &KVGetRequest{} +} + + +func (p *KVGetRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVGetRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} + +func (p *KVGetRequest) GetReturnPartly() bool { + return p.ReturnPartly +} +func (p *KVGetRequest) 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 *KVGetRequest) 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 *KVGetRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key59 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key59 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val60 := 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 +} + _val60 = append(_val60, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key59] = _val60 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReturnPartly = v +} + return nil +} + +func (p *KVGetRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetRequest"); 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 *KVGetRequest) 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 *KVGetRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_partly", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_partly: ", p), err) } + if err := oprot.WriteBool(bool(p.ReturnPartly)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_partly (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_partly: ", p), err) } + return err +} + +func (p *KVGetRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + returnPartlyVal := fmt.Sprintf("%v", p.ReturnPartly) + return fmt.Sprintf("KVGetRequest({SpaceID:%s Parts:%s ReturnPartly:%s})", spaceIDVal, partsVal, returnPartlyVal) +} + +// Attributes: +// - Result_ +// - KeyValues +type KVGetResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + KeyValues map[string][]byte `thrift:"key_values,2" db:"key_values" json:"key_values"` +} + +func NewKVGetResponse() *KVGetResponse { + return &KVGetResponse{ + Result_: NewResponseCommon(), + } +} + +var KVGetResponse_Result__DEFAULT *ResponseCommon +func (p *KVGetResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return KVGetResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *KVGetResponse) GetKeyValues() map[string][]byte { + return p.KeyValues +} +func (p *KVGetResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *KVGetResponse) 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 *KVGetResponse) 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 *KVGetResponse) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.KeyValues = tMap + for i := 0; i < size; i ++ { +var _key62 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key62 = v +} +var _val63 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val63 = v +} + p.KeyValues[_key62] = _val63 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetResponse"); 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 *KVGetResponse) 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 *KVGetResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key_values", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key_values: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.KeyValues)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KeyValues { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key_values: ", p), err) } + return err +} + +func (p *KVGetResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + keyValuesVal := fmt.Sprintf("%v", p.KeyValues) + return fmt.Sprintf("KVGetResponse({Result_:%s KeyValues:%s})", resultVal, keyValuesVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVPutRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.KeyValue `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVPutRequest() *KVPutRequest { + return &KVPutRequest{} +} + + +func (p *KVPutRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVPutRequest) GetParts() map[nebula0.PartitionID][]*nebula0.KeyValue { + return p.Parts +} +func (p *KVPutRequest) 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 *KVPutRequest) 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 *KVPutRequest) 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.KeyValue, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key64 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key64 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + _val65 := tSlice + for i := 0; i < size; i ++ { + _elem66 := nebula0.NewKeyValue() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + _val65 = append(_val65, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key64] = _val65 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVPutRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVPutRequest"); 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 *KVPutRequest) 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 *KVPutRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *KVPutRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVPutRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVRemoveRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVRemoveRequest() *KVRemoveRequest { + return &KVRemoveRequest{} +} + + +func (p *KVRemoveRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVRemoveRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} +func (p *KVRemoveRequest) 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key67 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key67 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val68 := tSlice + for i := 0; i < size; i ++ { +var _elem69 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem69 = v +} + _val68 = append(_val68, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key67] = _val68 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVRemoveRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVRemoveRequest"); 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVRemoveRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVRemoveRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - TxnID +// - SpaceID +// - PartID +// - Position +// - Data +type InternalTxnRequest struct { + TxnID int64 `thrift:"txn_id,1" db:"txn_id" json:"txn_id"` + SpaceID int32 `thrift:"space_id,2" db:"space_id" json:"space_id"` + PartID int32 `thrift:"part_id,3" db:"part_id" json:"part_id"` + Position int32 `thrift:"position,4" db:"position" json:"position"` + Data [][][]byte `thrift:"data,5" db:"data" json:"data"` +} + +func NewInternalTxnRequest() *InternalTxnRequest { + return &InternalTxnRequest{} +} + + +func (p *InternalTxnRequest) GetTxnID() int64 { + return p.TxnID +} + +func (p *InternalTxnRequest) GetSpaceID() int32 { + return p.SpaceID +} + +func (p *InternalTxnRequest) GetPartID() int32 { + return p.PartID +} + +func (p *InternalTxnRequest) GetPosition() int32 { + return p.Position +} + +func (p *InternalTxnRequest) GetData() [][][]byte { + return p.Data +} +func (p *InternalTxnRequest) 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 + } + 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 *InternalTxnRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TxnID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.SpaceID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.PartID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Position = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField5(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.Data = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _elem70 := tSlice + for i := 0; i < size; i ++ { +var _elem71 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem71 = v +} + _elem70 = append(_elem70, _elem71) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Data = append(p.Data, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *InternalTxnRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("InternalTxnRequest"); 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 *InternalTxnRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("txn_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:txn_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TxnID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.txn_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:txn_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("position", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:position: ", p), err) } + if err := oprot.WriteI32(int32(p.Position)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.position (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:position: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.LIST, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:data: ", p), err) } + return err +} + +func (p *InternalTxnRequest) String() string { + if p == nil { + return "" + } + + txnIDVal := fmt.Sprintf("%v", p.TxnID) + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + positionVal := fmt.Sprintf("%v", p.Position) + dataVal := fmt.Sprintf("%v", p.Data) + return fmt.Sprintf("InternalTxnRequest({TxnID:%s SpaceID:%s PartID:%s Position:%s Data:%s})", txnIDVal, spaceIDVal, partIDVal, positionVal, dataVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Key +type GetValueRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Key []byte `thrift:"key,3" db:"key" json:"key"` +} + +func NewGetValueRequest() *GetValueRequest { + return &GetValueRequest{} +} + + +func (p *GetValueRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetValueRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetValueRequest) GetKey() []byte { + return p.Key +} +func (p *GetValueRequest) 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 *GetValueRequest) 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 *GetValueRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetValueRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *GetValueRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueRequest"); 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 *GetValueRequest) 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 *GetValueRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetValueRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:key: ", p), err) } + return err +} + +func (p *GetValueRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("GetValueRequest({SpaceID:%s PartID:%s Key:%s})", spaceIDVal, partIDVal, keyVal) +} + +// Attributes: +// - Result_ +// - Value +type GetValueResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewGetValueResponse() *GetValueResponse { + return &GetValueResponse{ + Result_: NewResponseCommon(), + } +} + +var GetValueResponse_Result__DEFAULT *ResponseCommon +func (p *GetValueResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetValueResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetValueResponse) GetValue() []byte { + return p.Value +} +func (p *GetValueResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetValueResponse) 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 *GetValueResponse) 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 *GetValueResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *GetValueResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueResponse"); 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 *GetValueResponse) 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 *GetValueResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *GetValueResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("GetValueResponse({Result_:%s Value:%s})", resultVal, valueVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_0/ttypes.go b/ccore/nebula/internal/thrift/v2_5_0/ttypes.go new file mode 100644 index 0000000..1c2e221 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_0/ttypes.go @@ -0,0 +1,4579 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var GoUnusedProtection__ int; + +type NullType int64 +const ( + NullType___NULL__ NullType = 0 + NullType_NaN NullType = 1 + NullType_BAD_DATA NullType = 2 + NullType_BAD_TYPE NullType = 3 + NullType_ERR_OVERFLOW NullType = 4 + NullType_UNKNOWN_PROP NullType = 5 + NullType_DIV_BY_ZERO NullType = 6 + NullType_OUT_OF_RANGE NullType = 7 +) + +var NullTypeToName = map[NullType]string { + NullType___NULL__: "__NULL__", + NullType_NaN: "NaN", + NullType_BAD_DATA: "BAD_DATA", + NullType_BAD_TYPE: "BAD_TYPE", + NullType_ERR_OVERFLOW: "ERR_OVERFLOW", + NullType_UNKNOWN_PROP: "UNKNOWN_PROP", + NullType_DIV_BY_ZERO: "DIV_BY_ZERO", + NullType_OUT_OF_RANGE: "OUT_OF_RANGE", +} + +var NullTypeToValue = map[string]NullType { + "__NULL__": NullType___NULL__, + "NaN": NullType_NaN, + "BAD_DATA": NullType_BAD_DATA, + "BAD_TYPE": NullType_BAD_TYPE, + "ERR_OVERFLOW": NullType_ERR_OVERFLOW, + "UNKNOWN_PROP": NullType_UNKNOWN_PROP, + "DIV_BY_ZERO": NullType_DIV_BY_ZERO, + "OUT_OF_RANGE": NullType_OUT_OF_RANGE, +} + +var NullTypeNames = []string { + "__NULL__", + "NaN", + "BAD_DATA", + "BAD_TYPE", + "ERR_OVERFLOW", + "UNKNOWN_PROP", + "DIV_BY_ZERO", + "OUT_OF_RANGE", +} + +var NullTypeValues = []NullType { + NullType___NULL__, + NullType_NaN, + NullType_BAD_DATA, + NullType_BAD_TYPE, + NullType_ERR_OVERFLOW, + NullType_UNKNOWN_PROP, + NullType_DIV_BY_ZERO, + NullType_OUT_OF_RANGE, +} + +func (p NullType) String() string { + if v, ok := NullTypeToName[p]; ok { + return v + } + return "" +} + +func NullTypeFromString(s string) (NullType, error) { + if v, ok := NullTypeToValue[s]; ok { + return v, nil + } + return NullType(0), fmt.Errorf("not a valid NullType string") +} + +func NullTypePtr(v NullType) *NullType { return &v } + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -4 + ErrorCode_E_SPACE_NOT_FOUND ErrorCode = -5 + ErrorCode_E_TAG_NOT_FOUND ErrorCode = -6 + ErrorCode_E_EDGE_NOT_FOUND ErrorCode = -7 + ErrorCode_E_INDEX_NOT_FOUND ErrorCode = -8 + ErrorCode_E_EDGE_PROP_NOT_FOUND ErrorCode = -9 + ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -10 + ErrorCode_E_ROLE_NOT_FOUND ErrorCode = -11 + ErrorCode_E_CONFIG_NOT_FOUND ErrorCode = -12 + ErrorCode_E_GROUP_NOT_FOUND ErrorCode = -13 + ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 + ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 + ErrorCode_E_BACKUP_FAILED ErrorCode = -24 + ErrorCode_E_BACKUP_EMPTY_TABLE ErrorCode = -25 + ErrorCode_E_BACKUP_TABLE_FAILED ErrorCode = -26 + ErrorCode_E_PARTIAL_RESULT ErrorCode = -27 + ErrorCode_E_REBUILD_INDEX_FAILED ErrorCode = -28 + ErrorCode_E_INVALID_PASSWORD ErrorCode = -29 + ErrorCode_E_FAILED_GET_ABS_PATH ErrorCode = -30 + ErrorCode_E_BAD_USERNAME_PASSWORD ErrorCode = -1001 + ErrorCode_E_SESSION_INVALID ErrorCode = -1002 + ErrorCode_E_SESSION_TIMEOUT ErrorCode = -1003 + ErrorCode_E_SYNTAX_ERROR ErrorCode = -1004 + ErrorCode_E_EXECUTION_ERROR ErrorCode = -1005 + ErrorCode_E_STATEMENT_EMPTY ErrorCode = -1006 + ErrorCode_E_BAD_PERMISSION ErrorCode = -1008 + ErrorCode_E_SEMANTIC_ERROR ErrorCode = -1009 + ErrorCode_E_TOO_MANY_CONNECTIONS ErrorCode = -1010 + ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = -1011 + ErrorCode_E_NO_HOSTS ErrorCode = -2001 + ErrorCode_E_EXISTED ErrorCode = -2002 + ErrorCode_E_INVALID_HOST ErrorCode = -2003 + ErrorCode_E_UNSUPPORTED ErrorCode = -2004 + ErrorCode_E_NOT_DROP ErrorCode = -2005 + ErrorCode_E_BALANCER_RUNNING ErrorCode = -2006 + ErrorCode_E_CONFIG_IMMUTABLE ErrorCode = -2007 + ErrorCode_E_CONFLICT ErrorCode = -2008 + ErrorCode_E_INVALID_PARM ErrorCode = -2009 + ErrorCode_E_WRONGCLUSTER ErrorCode = -2010 + ErrorCode_E_STORE_FAILURE ErrorCode = -2021 + ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 + ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 + ErrorCode_E_BALANCED ErrorCode = -2024 + ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -2025 + ErrorCode_E_NO_VALID_HOST ErrorCode = -2026 + ErrorCode_E_CORRUPTTED_BALANCE_PLAN ErrorCode = -2027 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -2028 + ErrorCode_E_IMPROPER_ROLE ErrorCode = -2030 + ErrorCode_E_INVALID_PARTITION_NUM ErrorCode = -2031 + ErrorCode_E_INVALID_REPLICA_FACTOR ErrorCode = -2032 + ErrorCode_E_INVALID_CHARSET ErrorCode = -2033 + ErrorCode_E_INVALID_COLLATE ErrorCode = -2034 + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH ErrorCode = -2035 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -2040 + ErrorCode_E_BLOCK_WRITE_FAILURE ErrorCode = -2041 + ErrorCode_E_REBUILD_INDEX_FAILURE ErrorCode = -2042 + ErrorCode_E_INDEX_WITH_TTL ErrorCode = -2043 + ErrorCode_E_ADD_JOB_FAILURE ErrorCode = -2044 + ErrorCode_E_STOP_JOB_FAILURE ErrorCode = -2045 + ErrorCode_E_SAVE_JOB_FAILURE ErrorCode = -2046 + ErrorCode_E_BALANCER_FAILURE ErrorCode = -2047 + ErrorCode_E_JOB_NOT_FINISHED ErrorCode = -2048 + ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -2049 + ErrorCode_E_INVALID_JOB ErrorCode = -2065 + ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 + ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 + ErrorCode_E_RESTORE_FAILURE ErrorCode = -2068 + ErrorCode_E_SESSION_NOT_FOUND ErrorCode = -2069 + ErrorCode_E_LIST_CLUSTER_FAILURE ErrorCode = -2070 + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE ErrorCode = -2071 + ErrorCode_E_GET_META_DIR_FAILURE ErrorCode = -2072 + ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 + ErrorCode_E_CONSENSUS_ERROR ErrorCode = -3001 + ErrorCode_E_KEY_HAS_EXISTS ErrorCode = -3002 + ErrorCode_E_DATA_TYPE_MISMATCH ErrorCode = -3003 + ErrorCode_E_INVALID_FIELD_VALUE ErrorCode = -3004 + ErrorCode_E_INVALID_OPERATION ErrorCode = -3005 + ErrorCode_E_NOT_NULLABLE ErrorCode = -3006 + ErrorCode_E_FIELD_UNSET ErrorCode = -3007 + ErrorCode_E_OUT_OF_RANGE ErrorCode = -3008 + ErrorCode_E_ATOMIC_OP_FAILED ErrorCode = -3009 + ErrorCode_E_DATA_CONFLICT_ERROR ErrorCode = -3010 + ErrorCode_E_WRITE_STALLED ErrorCode = -3011 + ErrorCode_E_IMPROPER_DATA_TYPE ErrorCode = -3021 + ErrorCode_E_INVALID_SPACEVIDLEN ErrorCode = -3022 + ErrorCode_E_INVALID_FILTER ErrorCode = -3031 + ErrorCode_E_INVALID_UPDATER ErrorCode = -3032 + ErrorCode_E_INVALID_STORE ErrorCode = -3033 + ErrorCode_E_INVALID_PEER ErrorCode = -3034 + ErrorCode_E_RETRY_EXHAUSTED ErrorCode = -3035 + ErrorCode_E_TRANSFER_LEADER_FAILED ErrorCode = -3036 + ErrorCode_E_INVALID_STAT_TYPE ErrorCode = -3037 + ErrorCode_E_INVALID_VID ErrorCode = -3038 + ErrorCode_E_NO_TRANSFORMED ErrorCode = -3039 + ErrorCode_E_LOAD_META_FAILED ErrorCode = -3040 + ErrorCode_E_FAILED_TO_CHECKPOINT ErrorCode = -3041 + ErrorCode_E_CHECKPOINT_BLOCKED ErrorCode = -3042 + ErrorCode_E_FILTER_OUT ErrorCode = -3043 + ErrorCode_E_INVALID_DATA ErrorCode = -3044 + ErrorCode_E_MUTATE_EDGE_CONFLICT ErrorCode = -3045 + ErrorCode_E_MUTATE_TAG_CONFLICT ErrorCode = -3046 + ErrorCode_E_OUTDATED_LOCK ErrorCode = -3047 + ErrorCode_E_INVALID_TASK_PARA ErrorCode = -3051 + ErrorCode_E_USER_CANCEL ErrorCode = -3052 + ErrorCode_E_TASK_EXECUTION_FAILED ErrorCode = -3053 + ErrorCode_E_UNKNOWN ErrorCode = -8000 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAIL_TO_CONNECT: "E_FAIL_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_LEADER_CHANGED: "E_LEADER_CHANGED", + ErrorCode_E_SPACE_NOT_FOUND: "E_SPACE_NOT_FOUND", + ErrorCode_E_TAG_NOT_FOUND: "E_TAG_NOT_FOUND", + ErrorCode_E_EDGE_NOT_FOUND: "E_EDGE_NOT_FOUND", + ErrorCode_E_INDEX_NOT_FOUND: "E_INDEX_NOT_FOUND", + ErrorCode_E_EDGE_PROP_NOT_FOUND: "E_EDGE_PROP_NOT_FOUND", + ErrorCode_E_TAG_PROP_NOT_FOUND: "E_TAG_PROP_NOT_FOUND", + ErrorCode_E_ROLE_NOT_FOUND: "E_ROLE_NOT_FOUND", + ErrorCode_E_CONFIG_NOT_FOUND: "E_CONFIG_NOT_FOUND", + ErrorCode_E_GROUP_NOT_FOUND: "E_GROUP_NOT_FOUND", + ErrorCode_E_ZONE_NOT_FOUND: "E_ZONE_NOT_FOUND", + ErrorCode_E_LISTENER_NOT_FOUND: "E_LISTENER_NOT_FOUND", + ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", + ErrorCode_E_KEY_NOT_FOUND: "E_KEY_NOT_FOUND", + ErrorCode_E_USER_NOT_FOUND: "E_USER_NOT_FOUND", + ErrorCode_E_BACKUP_FAILED: "E_BACKUP_FAILED", + ErrorCode_E_BACKUP_EMPTY_TABLE: "E_BACKUP_EMPTY_TABLE", + ErrorCode_E_BACKUP_TABLE_FAILED: "E_BACKUP_TABLE_FAILED", + ErrorCode_E_PARTIAL_RESULT: "E_PARTIAL_RESULT", + ErrorCode_E_REBUILD_INDEX_FAILED: "E_REBUILD_INDEX_FAILED", + ErrorCode_E_INVALID_PASSWORD: "E_INVALID_PASSWORD", + ErrorCode_E_FAILED_GET_ABS_PATH: "E_FAILED_GET_ABS_PATH", + ErrorCode_E_BAD_USERNAME_PASSWORD: "E_BAD_USERNAME_PASSWORD", + ErrorCode_E_SESSION_INVALID: "E_SESSION_INVALID", + ErrorCode_E_SESSION_TIMEOUT: "E_SESSION_TIMEOUT", + ErrorCode_E_SYNTAX_ERROR: "E_SYNTAX_ERROR", + ErrorCode_E_EXECUTION_ERROR: "E_EXECUTION_ERROR", + ErrorCode_E_STATEMENT_EMPTY: "E_STATEMENT_EMPTY", + ErrorCode_E_BAD_PERMISSION: "E_BAD_PERMISSION", + ErrorCode_E_SEMANTIC_ERROR: "E_SEMANTIC_ERROR", + ErrorCode_E_TOO_MANY_CONNECTIONS: "E_TOO_MANY_CONNECTIONS", + ErrorCode_E_PARTIAL_SUCCEEDED: "E_PARTIAL_SUCCEEDED", + ErrorCode_E_NO_HOSTS: "E_NO_HOSTS", + ErrorCode_E_EXISTED: "E_EXISTED", + ErrorCode_E_INVALID_HOST: "E_INVALID_HOST", + ErrorCode_E_UNSUPPORTED: "E_UNSUPPORTED", + ErrorCode_E_NOT_DROP: "E_NOT_DROP", + ErrorCode_E_BALANCER_RUNNING: "E_BALANCER_RUNNING", + ErrorCode_E_CONFIG_IMMUTABLE: "E_CONFIG_IMMUTABLE", + ErrorCode_E_CONFLICT: "E_CONFLICT", + ErrorCode_E_INVALID_PARM: "E_INVALID_PARM", + ErrorCode_E_WRONGCLUSTER: "E_WRONGCLUSTER", + 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", + ErrorCode_E_BALANCED: "E_BALANCED", + ErrorCode_E_NO_RUNNING_BALANCE_PLAN: "E_NO_RUNNING_BALANCE_PLAN", + ErrorCode_E_NO_VALID_HOST: "E_NO_VALID_HOST", + ErrorCode_E_CORRUPTTED_BALANCE_PLAN: "E_CORRUPTTED_BALANCE_PLAN", + ErrorCode_E_NO_INVALID_BALANCE_PLAN: "E_NO_INVALID_BALANCE_PLAN", + ErrorCode_E_IMPROPER_ROLE: "E_IMPROPER_ROLE", + ErrorCode_E_INVALID_PARTITION_NUM: "E_INVALID_PARTITION_NUM", + ErrorCode_E_INVALID_REPLICA_FACTOR: "E_INVALID_REPLICA_FACTOR", + ErrorCode_E_INVALID_CHARSET: "E_INVALID_CHARSET", + ErrorCode_E_INVALID_COLLATE: "E_INVALID_COLLATE", + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH: "E_CHARSET_COLLATE_NOT_MATCH", + ErrorCode_E_SNAPSHOT_FAILURE: "E_SNAPSHOT_FAILURE", + ErrorCode_E_BLOCK_WRITE_FAILURE: "E_BLOCK_WRITE_FAILURE", + ErrorCode_E_REBUILD_INDEX_FAILURE: "E_REBUILD_INDEX_FAILURE", + ErrorCode_E_INDEX_WITH_TTL: "E_INDEX_WITH_TTL", + ErrorCode_E_ADD_JOB_FAILURE: "E_ADD_JOB_FAILURE", + ErrorCode_E_STOP_JOB_FAILURE: "E_STOP_JOB_FAILURE", + ErrorCode_E_SAVE_JOB_FAILURE: "E_SAVE_JOB_FAILURE", + ErrorCode_E_BALANCER_FAILURE: "E_BALANCER_FAILURE", + ErrorCode_E_JOB_NOT_FINISHED: "E_JOB_NOT_FINISHED", + ErrorCode_E_TASK_REPORT_OUT_DATE: "E_TASK_REPORT_OUT_DATE", + 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", + ErrorCode_E_RESTORE_FAILURE: "E_RESTORE_FAILURE", + ErrorCode_E_SESSION_NOT_FOUND: "E_SESSION_NOT_FOUND", + ErrorCode_E_LIST_CLUSTER_FAILURE: "E_LIST_CLUSTER_FAILURE", + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE: "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + ErrorCode_E_GET_META_DIR_FAILURE: "E_GET_META_DIR_FAILURE", + ErrorCode_E_QUERY_NOT_FOUND: "E_QUERY_NOT_FOUND", + ErrorCode_E_CONSENSUS_ERROR: "E_CONSENSUS_ERROR", + ErrorCode_E_KEY_HAS_EXISTS: "E_KEY_HAS_EXISTS", + ErrorCode_E_DATA_TYPE_MISMATCH: "E_DATA_TYPE_MISMATCH", + ErrorCode_E_INVALID_FIELD_VALUE: "E_INVALID_FIELD_VALUE", + ErrorCode_E_INVALID_OPERATION: "E_INVALID_OPERATION", + ErrorCode_E_NOT_NULLABLE: "E_NOT_NULLABLE", + ErrorCode_E_FIELD_UNSET: "E_FIELD_UNSET", + ErrorCode_E_OUT_OF_RANGE: "E_OUT_OF_RANGE", + ErrorCode_E_ATOMIC_OP_FAILED: "E_ATOMIC_OP_FAILED", + ErrorCode_E_DATA_CONFLICT_ERROR: "E_DATA_CONFLICT_ERROR", + ErrorCode_E_WRITE_STALLED: "E_WRITE_STALLED", + ErrorCode_E_IMPROPER_DATA_TYPE: "E_IMPROPER_DATA_TYPE", + ErrorCode_E_INVALID_SPACEVIDLEN: "E_INVALID_SPACEVIDLEN", + ErrorCode_E_INVALID_FILTER: "E_INVALID_FILTER", + ErrorCode_E_INVALID_UPDATER: "E_INVALID_UPDATER", + ErrorCode_E_INVALID_STORE: "E_INVALID_STORE", + ErrorCode_E_INVALID_PEER: "E_INVALID_PEER", + ErrorCode_E_RETRY_EXHAUSTED: "E_RETRY_EXHAUSTED", + ErrorCode_E_TRANSFER_LEADER_FAILED: "E_TRANSFER_LEADER_FAILED", + ErrorCode_E_INVALID_STAT_TYPE: "E_INVALID_STAT_TYPE", + ErrorCode_E_INVALID_VID: "E_INVALID_VID", + ErrorCode_E_NO_TRANSFORMED: "E_NO_TRANSFORMED", + ErrorCode_E_LOAD_META_FAILED: "E_LOAD_META_FAILED", + ErrorCode_E_FAILED_TO_CHECKPOINT: "E_FAILED_TO_CHECKPOINT", + ErrorCode_E_CHECKPOINT_BLOCKED: "E_CHECKPOINT_BLOCKED", + ErrorCode_E_FILTER_OUT: "E_FILTER_OUT", + ErrorCode_E_INVALID_DATA: "E_INVALID_DATA", + ErrorCode_E_MUTATE_EDGE_CONFLICT: "E_MUTATE_EDGE_CONFLICT", + ErrorCode_E_MUTATE_TAG_CONFLICT: "E_MUTATE_TAG_CONFLICT", + ErrorCode_E_OUTDATED_LOCK: "E_OUTDATED_LOCK", + ErrorCode_E_INVALID_TASK_PARA: "E_INVALID_TASK_PARA", + ErrorCode_E_USER_CANCEL: "E_USER_CANCEL", + ErrorCode_E_TASK_EXECUTION_FAILED: "E_TASK_EXECUTION_FAILED", + ErrorCode_E_UNKNOWN: "E_UNKNOWN", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAIL_TO_CONNECT": ErrorCode_E_FAIL_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_LEADER_CHANGED": ErrorCode_E_LEADER_CHANGED, + "E_SPACE_NOT_FOUND": ErrorCode_E_SPACE_NOT_FOUND, + "E_TAG_NOT_FOUND": ErrorCode_E_TAG_NOT_FOUND, + "E_EDGE_NOT_FOUND": ErrorCode_E_EDGE_NOT_FOUND, + "E_INDEX_NOT_FOUND": ErrorCode_E_INDEX_NOT_FOUND, + "E_EDGE_PROP_NOT_FOUND": ErrorCode_E_EDGE_PROP_NOT_FOUND, + "E_TAG_PROP_NOT_FOUND": ErrorCode_E_TAG_PROP_NOT_FOUND, + "E_ROLE_NOT_FOUND": ErrorCode_E_ROLE_NOT_FOUND, + "E_CONFIG_NOT_FOUND": ErrorCode_E_CONFIG_NOT_FOUND, + "E_GROUP_NOT_FOUND": ErrorCode_E_GROUP_NOT_FOUND, + "E_ZONE_NOT_FOUND": ErrorCode_E_ZONE_NOT_FOUND, + "E_LISTENER_NOT_FOUND": ErrorCode_E_LISTENER_NOT_FOUND, + "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, + "E_KEY_NOT_FOUND": ErrorCode_E_KEY_NOT_FOUND, + "E_USER_NOT_FOUND": ErrorCode_E_USER_NOT_FOUND, + "E_BACKUP_FAILED": ErrorCode_E_BACKUP_FAILED, + "E_BACKUP_EMPTY_TABLE": ErrorCode_E_BACKUP_EMPTY_TABLE, + "E_BACKUP_TABLE_FAILED": ErrorCode_E_BACKUP_TABLE_FAILED, + "E_PARTIAL_RESULT": ErrorCode_E_PARTIAL_RESULT, + "E_REBUILD_INDEX_FAILED": ErrorCode_E_REBUILD_INDEX_FAILED, + "E_INVALID_PASSWORD": ErrorCode_E_INVALID_PASSWORD, + "E_FAILED_GET_ABS_PATH": ErrorCode_E_FAILED_GET_ABS_PATH, + "E_BAD_USERNAME_PASSWORD": ErrorCode_E_BAD_USERNAME_PASSWORD, + "E_SESSION_INVALID": ErrorCode_E_SESSION_INVALID, + "E_SESSION_TIMEOUT": ErrorCode_E_SESSION_TIMEOUT, + "E_SYNTAX_ERROR": ErrorCode_E_SYNTAX_ERROR, + "E_EXECUTION_ERROR": ErrorCode_E_EXECUTION_ERROR, + "E_STATEMENT_EMPTY": ErrorCode_E_STATEMENT_EMPTY, + "E_BAD_PERMISSION": ErrorCode_E_BAD_PERMISSION, + "E_SEMANTIC_ERROR": ErrorCode_E_SEMANTIC_ERROR, + "E_TOO_MANY_CONNECTIONS": ErrorCode_E_TOO_MANY_CONNECTIONS, + "E_PARTIAL_SUCCEEDED": ErrorCode_E_PARTIAL_SUCCEEDED, + "E_NO_HOSTS": ErrorCode_E_NO_HOSTS, + "E_EXISTED": ErrorCode_E_EXISTED, + "E_INVALID_HOST": ErrorCode_E_INVALID_HOST, + "E_UNSUPPORTED": ErrorCode_E_UNSUPPORTED, + "E_NOT_DROP": ErrorCode_E_NOT_DROP, + "E_BALANCER_RUNNING": ErrorCode_E_BALANCER_RUNNING, + "E_CONFIG_IMMUTABLE": ErrorCode_E_CONFIG_IMMUTABLE, + "E_CONFLICT": ErrorCode_E_CONFLICT, + "E_INVALID_PARM": ErrorCode_E_INVALID_PARM, + "E_WRONGCLUSTER": ErrorCode_E_WRONGCLUSTER, + "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, + "E_BALANCED": ErrorCode_E_BALANCED, + "E_NO_RUNNING_BALANCE_PLAN": ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + "E_NO_VALID_HOST": ErrorCode_E_NO_VALID_HOST, + "E_CORRUPTTED_BALANCE_PLAN": ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + "E_NO_INVALID_BALANCE_PLAN": ErrorCode_E_NO_INVALID_BALANCE_PLAN, + "E_IMPROPER_ROLE": ErrorCode_E_IMPROPER_ROLE, + "E_INVALID_PARTITION_NUM": ErrorCode_E_INVALID_PARTITION_NUM, + "E_INVALID_REPLICA_FACTOR": ErrorCode_E_INVALID_REPLICA_FACTOR, + "E_INVALID_CHARSET": ErrorCode_E_INVALID_CHARSET, + "E_INVALID_COLLATE": ErrorCode_E_INVALID_COLLATE, + "E_CHARSET_COLLATE_NOT_MATCH": ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + "E_SNAPSHOT_FAILURE": ErrorCode_E_SNAPSHOT_FAILURE, + "E_BLOCK_WRITE_FAILURE": ErrorCode_E_BLOCK_WRITE_FAILURE, + "E_REBUILD_INDEX_FAILURE": ErrorCode_E_REBUILD_INDEX_FAILURE, + "E_INDEX_WITH_TTL": ErrorCode_E_INDEX_WITH_TTL, + "E_ADD_JOB_FAILURE": ErrorCode_E_ADD_JOB_FAILURE, + "E_STOP_JOB_FAILURE": ErrorCode_E_STOP_JOB_FAILURE, + "E_SAVE_JOB_FAILURE": ErrorCode_E_SAVE_JOB_FAILURE, + "E_BALANCER_FAILURE": ErrorCode_E_BALANCER_FAILURE, + "E_JOB_NOT_FINISHED": ErrorCode_E_JOB_NOT_FINISHED, + "E_TASK_REPORT_OUT_DATE": ErrorCode_E_TASK_REPORT_OUT_DATE, + "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, + "E_RESTORE_FAILURE": ErrorCode_E_RESTORE_FAILURE, + "E_SESSION_NOT_FOUND": ErrorCode_E_SESSION_NOT_FOUND, + "E_LIST_CLUSTER_FAILURE": ErrorCode_E_LIST_CLUSTER_FAILURE, + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE": ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + "E_GET_META_DIR_FAILURE": ErrorCode_E_GET_META_DIR_FAILURE, + "E_QUERY_NOT_FOUND": ErrorCode_E_QUERY_NOT_FOUND, + "E_CONSENSUS_ERROR": ErrorCode_E_CONSENSUS_ERROR, + "E_KEY_HAS_EXISTS": ErrorCode_E_KEY_HAS_EXISTS, + "E_DATA_TYPE_MISMATCH": ErrorCode_E_DATA_TYPE_MISMATCH, + "E_INVALID_FIELD_VALUE": ErrorCode_E_INVALID_FIELD_VALUE, + "E_INVALID_OPERATION": ErrorCode_E_INVALID_OPERATION, + "E_NOT_NULLABLE": ErrorCode_E_NOT_NULLABLE, + "E_FIELD_UNSET": ErrorCode_E_FIELD_UNSET, + "E_OUT_OF_RANGE": ErrorCode_E_OUT_OF_RANGE, + "E_ATOMIC_OP_FAILED": ErrorCode_E_ATOMIC_OP_FAILED, + "E_DATA_CONFLICT_ERROR": ErrorCode_E_DATA_CONFLICT_ERROR, + "E_WRITE_STALLED": ErrorCode_E_WRITE_STALLED, + "E_IMPROPER_DATA_TYPE": ErrorCode_E_IMPROPER_DATA_TYPE, + "E_INVALID_SPACEVIDLEN": ErrorCode_E_INVALID_SPACEVIDLEN, + "E_INVALID_FILTER": ErrorCode_E_INVALID_FILTER, + "E_INVALID_UPDATER": ErrorCode_E_INVALID_UPDATER, + "E_INVALID_STORE": ErrorCode_E_INVALID_STORE, + "E_INVALID_PEER": ErrorCode_E_INVALID_PEER, + "E_RETRY_EXHAUSTED": ErrorCode_E_RETRY_EXHAUSTED, + "E_TRANSFER_LEADER_FAILED": ErrorCode_E_TRANSFER_LEADER_FAILED, + "E_INVALID_STAT_TYPE": ErrorCode_E_INVALID_STAT_TYPE, + "E_INVALID_VID": ErrorCode_E_INVALID_VID, + "E_NO_TRANSFORMED": ErrorCode_E_NO_TRANSFORMED, + "E_LOAD_META_FAILED": ErrorCode_E_LOAD_META_FAILED, + "E_FAILED_TO_CHECKPOINT": ErrorCode_E_FAILED_TO_CHECKPOINT, + "E_CHECKPOINT_BLOCKED": ErrorCode_E_CHECKPOINT_BLOCKED, + "E_FILTER_OUT": ErrorCode_E_FILTER_OUT, + "E_INVALID_DATA": ErrorCode_E_INVALID_DATA, + "E_MUTATE_EDGE_CONFLICT": ErrorCode_E_MUTATE_EDGE_CONFLICT, + "E_MUTATE_TAG_CONFLICT": ErrorCode_E_MUTATE_TAG_CONFLICT, + "E_OUTDATED_LOCK": ErrorCode_E_OUTDATED_LOCK, + "E_INVALID_TASK_PARA": ErrorCode_E_INVALID_TASK_PARA, + "E_USER_CANCEL": ErrorCode_E_USER_CANCEL, + "E_TASK_EXECUTION_FAILED": ErrorCode_E_TASK_EXECUTION_FAILED, + "E_UNKNOWN": ErrorCode_E_UNKNOWN, +} + +var ErrorCodeNames = []string { + "SUCCEEDED", + "E_DISCONNECTED", + "E_FAIL_TO_CONNECT", + "E_RPC_FAILURE", + "E_LEADER_CHANGED", + "E_SPACE_NOT_FOUND", + "E_TAG_NOT_FOUND", + "E_EDGE_NOT_FOUND", + "E_INDEX_NOT_FOUND", + "E_EDGE_PROP_NOT_FOUND", + "E_TAG_PROP_NOT_FOUND", + "E_ROLE_NOT_FOUND", + "E_CONFIG_NOT_FOUND", + "E_GROUP_NOT_FOUND", + "E_ZONE_NOT_FOUND", + "E_LISTENER_NOT_FOUND", + "E_PART_NOT_FOUND", + "E_KEY_NOT_FOUND", + "E_USER_NOT_FOUND", + "E_BACKUP_FAILED", + "E_BACKUP_EMPTY_TABLE", + "E_BACKUP_TABLE_FAILED", + "E_PARTIAL_RESULT", + "E_REBUILD_INDEX_FAILED", + "E_INVALID_PASSWORD", + "E_FAILED_GET_ABS_PATH", + "E_BAD_USERNAME_PASSWORD", + "E_SESSION_INVALID", + "E_SESSION_TIMEOUT", + "E_SYNTAX_ERROR", + "E_EXECUTION_ERROR", + "E_STATEMENT_EMPTY", + "E_BAD_PERMISSION", + "E_SEMANTIC_ERROR", + "E_TOO_MANY_CONNECTIONS", + "E_PARTIAL_SUCCEEDED", + "E_NO_HOSTS", + "E_EXISTED", + "E_INVALID_HOST", + "E_UNSUPPORTED", + "E_NOT_DROP", + "E_BALANCER_RUNNING", + "E_CONFIG_IMMUTABLE", + "E_CONFLICT", + "E_INVALID_PARM", + "E_WRONGCLUSTER", + "E_STORE_FAILURE", + "E_STORE_SEGMENT_ILLEGAL", + "E_BAD_BALANCE_PLAN", + "E_BALANCED", + "E_NO_RUNNING_BALANCE_PLAN", + "E_NO_VALID_HOST", + "E_CORRUPTTED_BALANCE_PLAN", + "E_NO_INVALID_BALANCE_PLAN", + "E_IMPROPER_ROLE", + "E_INVALID_PARTITION_NUM", + "E_INVALID_REPLICA_FACTOR", + "E_INVALID_CHARSET", + "E_INVALID_COLLATE", + "E_CHARSET_COLLATE_NOT_MATCH", + "E_SNAPSHOT_FAILURE", + "E_BLOCK_WRITE_FAILURE", + "E_REBUILD_INDEX_FAILURE", + "E_INDEX_WITH_TTL", + "E_ADD_JOB_FAILURE", + "E_STOP_JOB_FAILURE", + "E_SAVE_JOB_FAILURE", + "E_BALANCER_FAILURE", + "E_JOB_NOT_FINISHED", + "E_TASK_REPORT_OUT_DATE", + "E_INVALID_JOB", + "E_BACKUP_BUILDING_INDEX", + "E_BACKUP_SPACE_NOT_FOUND", + "E_RESTORE_FAILURE", + "E_SESSION_NOT_FOUND", + "E_LIST_CLUSTER_FAILURE", + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + "E_GET_META_DIR_FAILURE", + "E_QUERY_NOT_FOUND", + "E_CONSENSUS_ERROR", + "E_KEY_HAS_EXISTS", + "E_DATA_TYPE_MISMATCH", + "E_INVALID_FIELD_VALUE", + "E_INVALID_OPERATION", + "E_NOT_NULLABLE", + "E_FIELD_UNSET", + "E_OUT_OF_RANGE", + "E_ATOMIC_OP_FAILED", + "E_DATA_CONFLICT_ERROR", + "E_WRITE_STALLED", + "E_IMPROPER_DATA_TYPE", + "E_INVALID_SPACEVIDLEN", + "E_INVALID_FILTER", + "E_INVALID_UPDATER", + "E_INVALID_STORE", + "E_INVALID_PEER", + "E_RETRY_EXHAUSTED", + "E_TRANSFER_LEADER_FAILED", + "E_INVALID_STAT_TYPE", + "E_INVALID_VID", + "E_NO_TRANSFORMED", + "E_LOAD_META_FAILED", + "E_FAILED_TO_CHECKPOINT", + "E_CHECKPOINT_BLOCKED", + "E_FILTER_OUT", + "E_INVALID_DATA", + "E_MUTATE_EDGE_CONFLICT", + "E_MUTATE_TAG_CONFLICT", + "E_OUTDATED_LOCK", + "E_INVALID_TASK_PARA", + "E_USER_CANCEL", + "E_TASK_EXECUTION_FAILED", + "E_UNKNOWN", +} + +var ErrorCodeValues = []ErrorCode { + ErrorCode_SUCCEEDED, + ErrorCode_E_DISCONNECTED, + ErrorCode_E_FAIL_TO_CONNECT, + ErrorCode_E_RPC_FAILURE, + ErrorCode_E_LEADER_CHANGED, + ErrorCode_E_SPACE_NOT_FOUND, + ErrorCode_E_TAG_NOT_FOUND, + ErrorCode_E_EDGE_NOT_FOUND, + ErrorCode_E_INDEX_NOT_FOUND, + ErrorCode_E_EDGE_PROP_NOT_FOUND, + ErrorCode_E_TAG_PROP_NOT_FOUND, + ErrorCode_E_ROLE_NOT_FOUND, + ErrorCode_E_CONFIG_NOT_FOUND, + ErrorCode_E_GROUP_NOT_FOUND, + ErrorCode_E_ZONE_NOT_FOUND, + ErrorCode_E_LISTENER_NOT_FOUND, + ErrorCode_E_PART_NOT_FOUND, + ErrorCode_E_KEY_NOT_FOUND, + ErrorCode_E_USER_NOT_FOUND, + ErrorCode_E_BACKUP_FAILED, + ErrorCode_E_BACKUP_EMPTY_TABLE, + ErrorCode_E_BACKUP_TABLE_FAILED, + ErrorCode_E_PARTIAL_RESULT, + ErrorCode_E_REBUILD_INDEX_FAILED, + ErrorCode_E_INVALID_PASSWORD, + ErrorCode_E_FAILED_GET_ABS_PATH, + ErrorCode_E_BAD_USERNAME_PASSWORD, + ErrorCode_E_SESSION_INVALID, + ErrorCode_E_SESSION_TIMEOUT, + ErrorCode_E_SYNTAX_ERROR, + ErrorCode_E_EXECUTION_ERROR, + ErrorCode_E_STATEMENT_EMPTY, + ErrorCode_E_BAD_PERMISSION, + ErrorCode_E_SEMANTIC_ERROR, + ErrorCode_E_TOO_MANY_CONNECTIONS, + ErrorCode_E_PARTIAL_SUCCEEDED, + ErrorCode_E_NO_HOSTS, + ErrorCode_E_EXISTED, + ErrorCode_E_INVALID_HOST, + ErrorCode_E_UNSUPPORTED, + ErrorCode_E_NOT_DROP, + ErrorCode_E_BALANCER_RUNNING, + ErrorCode_E_CONFIG_IMMUTABLE, + ErrorCode_E_CONFLICT, + ErrorCode_E_INVALID_PARM, + ErrorCode_E_WRONGCLUSTER, + ErrorCode_E_STORE_FAILURE, + ErrorCode_E_STORE_SEGMENT_ILLEGAL, + ErrorCode_E_BAD_BALANCE_PLAN, + ErrorCode_E_BALANCED, + ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + ErrorCode_E_NO_VALID_HOST, + ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + ErrorCode_E_NO_INVALID_BALANCE_PLAN, + ErrorCode_E_IMPROPER_ROLE, + ErrorCode_E_INVALID_PARTITION_NUM, + ErrorCode_E_INVALID_REPLICA_FACTOR, + ErrorCode_E_INVALID_CHARSET, + ErrorCode_E_INVALID_COLLATE, + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + ErrorCode_E_SNAPSHOT_FAILURE, + ErrorCode_E_BLOCK_WRITE_FAILURE, + ErrorCode_E_REBUILD_INDEX_FAILURE, + ErrorCode_E_INDEX_WITH_TTL, + ErrorCode_E_ADD_JOB_FAILURE, + ErrorCode_E_STOP_JOB_FAILURE, + ErrorCode_E_SAVE_JOB_FAILURE, + ErrorCode_E_BALANCER_FAILURE, + ErrorCode_E_JOB_NOT_FINISHED, + ErrorCode_E_TASK_REPORT_OUT_DATE, + ErrorCode_E_INVALID_JOB, + ErrorCode_E_BACKUP_BUILDING_INDEX, + ErrorCode_E_BACKUP_SPACE_NOT_FOUND, + ErrorCode_E_RESTORE_FAILURE, + ErrorCode_E_SESSION_NOT_FOUND, + ErrorCode_E_LIST_CLUSTER_FAILURE, + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + ErrorCode_E_GET_META_DIR_FAILURE, + ErrorCode_E_QUERY_NOT_FOUND, + ErrorCode_E_CONSENSUS_ERROR, + ErrorCode_E_KEY_HAS_EXISTS, + ErrorCode_E_DATA_TYPE_MISMATCH, + ErrorCode_E_INVALID_FIELD_VALUE, + ErrorCode_E_INVALID_OPERATION, + ErrorCode_E_NOT_NULLABLE, + ErrorCode_E_FIELD_UNSET, + ErrorCode_E_OUT_OF_RANGE, + ErrorCode_E_ATOMIC_OP_FAILED, + ErrorCode_E_DATA_CONFLICT_ERROR, + ErrorCode_E_WRITE_STALLED, + ErrorCode_E_IMPROPER_DATA_TYPE, + ErrorCode_E_INVALID_SPACEVIDLEN, + ErrorCode_E_INVALID_FILTER, + ErrorCode_E_INVALID_UPDATER, + ErrorCode_E_INVALID_STORE, + ErrorCode_E_INVALID_PEER, + ErrorCode_E_RETRY_EXHAUSTED, + ErrorCode_E_TRANSFER_LEADER_FAILED, + ErrorCode_E_INVALID_STAT_TYPE, + ErrorCode_E_INVALID_VID, + ErrorCode_E_NO_TRANSFORMED, + ErrorCode_E_LOAD_META_FAILED, + ErrorCode_E_FAILED_TO_CHECKPOINT, + ErrorCode_E_CHECKPOINT_BLOCKED, + ErrorCode_E_FILTER_OUT, + ErrorCode_E_INVALID_DATA, + ErrorCode_E_MUTATE_EDGE_CONFLICT, + ErrorCode_E_MUTATE_TAG_CONFLICT, + ErrorCode_E_OUTDATED_LOCK, + ErrorCode_E_INVALID_TASK_PARA, + ErrorCode_E_USER_CANCEL, + ErrorCode_E_TASK_EXECUTION_FAILED, + ErrorCode_E_UNKNOWN, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +type GraphSpaceID = int32 + +func GraphSpaceIDPtr(v GraphSpaceID) *GraphSpaceID { return &v } + +type PartitionID = int32 + +func PartitionIDPtr(v PartitionID) *PartitionID { return &v } + +type TagID = int32 + +func TagIDPtr(v TagID) *TagID { return &v } + +type EdgeType = int32 + +func EdgeTypePtr(v EdgeType) *EdgeType { return &v } + +type EdgeRanking = int64 + +func EdgeRankingPtr(v EdgeRanking) *EdgeRanking { return &v } + +type LogID = int64 + +func LogIDPtr(v LogID) *LogID { return &v } + +type TermID = int64 + +func TermIDPtr(v TermID) *TermID { return &v } + +type Timestamp = int64 + +func TimestampPtr(v Timestamp) *Timestamp { return &v } + +type IndexID = int32 + +func IndexIDPtr(v IndexID) *IndexID { return &v } + +type Port = int32 + +func PortPtr(v Port) *Port { return &v } + +type SessionID = int64 + +func SessionIDPtr(v SessionID) *SessionID { return &v } + +type ExecutionPlanID = int64 + +func ExecutionPlanIDPtr(v ExecutionPlanID) *ExecutionPlanID { return &v } + +// Attributes: +// - Year +// - Month +// - Day +type Date struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` +} + +func NewDate() *Date { + return &Date{} +} + + +func (p *Date) GetYear() int16 { + return p.Year +} + +func (p *Date) GetMonth() int8 { + return p.Month +} + +func (p *Date) GetDay() int8 { + return p.Day +} +func (p *Date) 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 *Date) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *Date) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *Date) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *Date) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Date"); 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 *Date) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *Date) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *Date) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *Date) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + return fmt.Sprintf("Date({Year:%s Month:%s Day:%s})", yearVal, monthVal, dayVal) +} + +// Attributes: +// - Hour +// - Minute +// - Sec +// - Microsec +type Time struct { + Hour int8 `thrift:"hour,1" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,2" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,3" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,4" db:"microsec" json:"microsec"` +} + +func NewTime() *Time { + return &Time{} +} + + +func (p *Time) GetHour() int8 { + return p.Hour +} + +func (p *Time) GetMinute() int8 { + return p.Minute +} + +func (p *Time) GetSec() int8 { + return p.Sec +} + +func (p *Time) GetMicrosec() int32 { + return p.Microsec +} +func (p *Time) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Time) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *Time) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *Time) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *Time) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *Time) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Time"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Time) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hour: ", p), err) } + return err +} + +func (p *Time) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:minute: ", p), err) } + return err +} + +func (p *Time) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sec: ", p), err) } + return err +} + +func (p *Time) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:microsec: ", p), err) } + return err +} + +func (p *Time) String() string { + if p == nil { + return "" + } + + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("Time({Hour:%s Minute:%s Sec:%s Microsec:%s})", hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - Year +// - Month +// - Day +// - Hour +// - Minute +// - Sec +// - Microsec +type DateTime struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` + Hour int8 `thrift:"hour,4" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,5" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,6" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,7" db:"microsec" json:"microsec"` +} + +func NewDateTime() *DateTime { + return &DateTime{} +} + + +func (p *DateTime) GetYear() int16 { + return p.Year +} + +func (p *DateTime) GetMonth() int8 { + return p.Month +} + +func (p *DateTime) GetDay() int8 { + return p.Day +} + +func (p *DateTime) GetHour() int8 { + return p.Hour +} + +func (p *DateTime) GetMinute() int8 { + return p.Minute +} + +func (p *DateTime) GetSec() int8 { + return p.Sec +} + +func (p *DateTime) GetMicrosec() int32 { + return p.Microsec +} +func (p *DateTime) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DateTime) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *DateTime) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *DateTime) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *DateTime) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *DateTime) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *DateTime) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *DateTime) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *DateTime) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DateTime"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DateTime) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *DateTime) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *DateTime) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *DateTime) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hour: ", p), err) } + return err +} + +func (p *DateTime) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minute: ", p), err) } + return err +} + +func (p *DateTime) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sec: ", p), err) } + return err +} + +func (p *DateTime) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:microsec: ", p), err) } + return err +} + +func (p *DateTime) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("DateTime({Year:%s Month:%s Day:%s Hour:%s Minute:%s Sec:%s Microsec:%s})", yearVal, monthVal, dayVal, hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - NVal +// - BVal +// - IVal +// - FVal +// - SVal +// - DVal +// - TVal +// - DtVal +// - VVal +// - EVal +// - PVal +// - LVal +// - MVal +// - UVal +// - GVal +type Value struct { + NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` + BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` + IVal *int64 `thrift:"iVal,3" db:"iVal" json:"iVal,omitempty"` + FVal *float64 `thrift:"fVal,4" db:"fVal" json:"fVal,omitempty"` + SVal []byte `thrift:"sVal,5" db:"sVal" json:"sVal,omitempty"` + DVal *Date `thrift:"dVal,6" db:"dVal" json:"dVal,omitempty"` + TVal *Time `thrift:"tVal,7" db:"tVal" json:"tVal,omitempty"` + DtVal *DateTime `thrift:"dtVal,8" db:"dtVal" json:"dtVal,omitempty"` + VVal *Vertex `thrift:"vVal,9" db:"vVal" json:"vVal,omitempty"` + EVal *Edge `thrift:"eVal,10" db:"eVal" json:"eVal,omitempty"` + PVal *Path `thrift:"pVal,11" db:"pVal" json:"pVal,omitempty"` + LVal *NList `thrift:"lVal,12" db:"lVal" json:"lVal,omitempty"` + MVal *NMap `thrift:"mVal,13" db:"mVal" json:"mVal,omitempty"` + UVal *NSet `thrift:"uVal,14" db:"uVal" json:"uVal,omitempty"` + GVal *DataSet `thrift:"gVal,15" db:"gVal" json:"gVal,omitempty"` +} + +func NewValue() *Value { + return &Value{} +} + +var Value_NVal_DEFAULT NullType +func (p *Value) GetNVal() NullType { + if !p.IsSetNVal() { + return Value_NVal_DEFAULT + } +return *p.NVal +} +var Value_BVal_DEFAULT bool +func (p *Value) GetBVal() bool { + if !p.IsSetBVal() { + return Value_BVal_DEFAULT + } +return *p.BVal +} +var Value_IVal_DEFAULT int64 +func (p *Value) GetIVal() int64 { + if !p.IsSetIVal() { + return Value_IVal_DEFAULT + } +return *p.IVal +} +var Value_FVal_DEFAULT float64 +func (p *Value) GetFVal() float64 { + if !p.IsSetFVal() { + return Value_FVal_DEFAULT + } +return *p.FVal +} +var Value_SVal_DEFAULT []byte + +func (p *Value) GetSVal() []byte { + return p.SVal +} +var Value_DVal_DEFAULT *Date +func (p *Value) GetDVal() *Date { + if !p.IsSetDVal() { + return Value_DVal_DEFAULT + } +return p.DVal +} +var Value_TVal_DEFAULT *Time +func (p *Value) GetTVal() *Time { + if !p.IsSetTVal() { + return Value_TVal_DEFAULT + } +return p.TVal +} +var Value_DtVal_DEFAULT *DateTime +func (p *Value) GetDtVal() *DateTime { + if !p.IsSetDtVal() { + return Value_DtVal_DEFAULT + } +return p.DtVal +} +var Value_VVal_DEFAULT *Vertex +func (p *Value) GetVVal() *Vertex { + if !p.IsSetVVal() { + return Value_VVal_DEFAULT + } +return p.VVal +} +var Value_EVal_DEFAULT *Edge +func (p *Value) GetEVal() *Edge { + if !p.IsSetEVal() { + return Value_EVal_DEFAULT + } +return p.EVal +} +var Value_PVal_DEFAULT *Path +func (p *Value) GetPVal() *Path { + if !p.IsSetPVal() { + return Value_PVal_DEFAULT + } +return p.PVal +} +var Value_LVal_DEFAULT *NList +func (p *Value) GetLVal() *NList { + if !p.IsSetLVal() { + return Value_LVal_DEFAULT + } +return p.LVal +} +var Value_MVal_DEFAULT *NMap +func (p *Value) GetMVal() *NMap { + if !p.IsSetMVal() { + return Value_MVal_DEFAULT + } +return p.MVal +} +var Value_UVal_DEFAULT *NSet +func (p *Value) GetUVal() *NSet { + if !p.IsSetUVal() { + return Value_UVal_DEFAULT + } +return p.UVal +} +var Value_GVal_DEFAULT *DataSet +func (p *Value) GetGVal() *DataSet { + if !p.IsSetGVal() { + return Value_GVal_DEFAULT + } +return p.GVal +} +func (p *Value) CountSetFieldsValue() int { + count := 0 + if (p.IsSetNVal()) { + count++ + } + if (p.IsSetBVal()) { + count++ + } + if (p.IsSetIVal()) { + count++ + } + if (p.IsSetFVal()) { + count++ + } + if (p.IsSetSVal()) { + count++ + } + if (p.IsSetDVal()) { + count++ + } + if (p.IsSetTVal()) { + count++ + } + if (p.IsSetDtVal()) { + count++ + } + if (p.IsSetVVal()) { + count++ + } + if (p.IsSetEVal()) { + count++ + } + if (p.IsSetPVal()) { + count++ + } + if (p.IsSetLVal()) { + count++ + } + if (p.IsSetMVal()) { + count++ + } + if (p.IsSetUVal()) { + count++ + } + if (p.IsSetGVal()) { + count++ + } + return count + +} + +func (p *Value) IsSetNVal() bool { + return p != nil && p.NVal != nil +} + +func (p *Value) IsSetBVal() bool { + return p != nil && p.BVal != nil +} + +func (p *Value) IsSetIVal() bool { + return p != nil && p.IVal != nil +} + +func (p *Value) IsSetFVal() bool { + return p != nil && p.FVal != nil +} + +func (p *Value) IsSetSVal() bool { + return p != nil && p.SVal != nil +} + +func (p *Value) IsSetDVal() bool { + return p != nil && p.DVal != nil +} + +func (p *Value) IsSetTVal() bool { + return p != nil && p.TVal != nil +} + +func (p *Value) IsSetDtVal() bool { + return p != nil && p.DtVal != nil +} + +func (p *Value) IsSetVVal() bool { + return p != nil && p.VVal != nil +} + +func (p *Value) IsSetEVal() bool { + return p != nil && p.EVal != nil +} + +func (p *Value) IsSetPVal() bool { + return p != nil && p.PVal != nil +} + +func (p *Value) IsSetLVal() bool { + return p != nil && p.LVal != nil +} + +func (p *Value) IsSetMVal() bool { + return p != nil && p.MVal != nil +} + +func (p *Value) IsSetUVal() bool { + return p != nil && p.UVal != nil +} + +func (p *Value) IsSetGVal() bool { + return p != nil && p.GVal != nil +} + +func (p *Value) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(iprot); err != nil { + return err + } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } + case 14: + if err := p.ReadField14(iprot); err != nil { + return err + } + case 15: + if err := p.ReadField15(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 *Value) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := NullType(v) + p.NVal = &temp +} + return nil +} + +func (p *Value) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BVal = &v +} + return nil +} + +func (p *Value) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IVal = &v +} + return nil +} + +func (p *Value) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FVal = &v +} + return nil +} + +func (p *Value) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SVal = v +} + return nil +} + +func (p *Value) ReadField6(iprot thrift.Protocol) error { + p.DVal = NewDate() + if err := p.DVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DVal), err) + } + return nil +} + +func (p *Value) ReadField7(iprot thrift.Protocol) error { + p.TVal = NewTime() + if err := p.TVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TVal), err) + } + return nil +} + +func (p *Value) ReadField8(iprot thrift.Protocol) error { + p.DtVal = NewDateTime() + if err := p.DtVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DtVal), err) + } + return nil +} + +func (p *Value) ReadField9(iprot thrift.Protocol) error { + p.VVal = NewVertex() + if err := p.VVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VVal), err) + } + return nil +} + +func (p *Value) ReadField10(iprot thrift.Protocol) error { + p.EVal = NewEdge() + if err := p.EVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EVal), err) + } + return nil +} + +func (p *Value) ReadField11(iprot thrift.Protocol) error { + p.PVal = NewPath() + if err := p.PVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PVal), err) + } + return nil +} + +func (p *Value) ReadField12(iprot thrift.Protocol) error { + p.LVal = NewNList() + if err := p.LVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LVal), err) + } + return nil +} + +func (p *Value) ReadField13(iprot thrift.Protocol) error { + p.MVal = NewNMap() + if err := p.MVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MVal), err) + } + return nil +} + +func (p *Value) ReadField14(iprot thrift.Protocol) error { + p.UVal = NewNSet() + if err := p.UVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UVal), err) + } + return nil +} + +func (p *Value) ReadField15(iprot thrift.Protocol) error { + p.GVal = NewDataSet() + if err := p.GVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GVal), err) + } + return nil +} + +func (p *Value) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsValue(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("Value"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } + if err := p.writeField14(oprot); err != nil { return err } + if err := p.writeField15(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Value) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetNVal() { + if err := oprot.WriteFieldBegin("nVal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nVal: ", p), err) } + if err := oprot.WriteI32(int32(*p.NVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nVal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nVal: ", p), err) } + } + return err +} + +func (p *Value) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetBVal() { + if err := oprot.WriteFieldBegin("bVal", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bVal: ", p), err) } + if err := oprot.WriteBool(bool(*p.BVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bVal (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bVal: ", p), err) } + } + return err +} + +func (p *Value) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetIVal() { + if err := oprot.WriteFieldBegin("iVal", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:iVal: ", p), err) } + if err := oprot.WriteI64(int64(*p.IVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.iVal (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:iVal: ", p), err) } + } + return err +} + +func (p *Value) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetFVal() { + if err := oprot.WriteFieldBegin("fVal", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fVal: ", p), err) } + if err := oprot.WriteDouble(float64(*p.FVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fVal (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fVal: ", p), err) } + } + return err +} + +func (p *Value) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetSVal() { + if err := oprot.WriteFieldBegin("sVal", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sVal: ", p), err) } + if err := oprot.WriteBinary(p.SVal); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sVal (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sVal: ", p), err) } + } + return err +} + +func (p *Value) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetDVal() { + if err := oprot.WriteFieldBegin("dVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dVal: ", p), err) } + if err := p.DVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dVal: ", p), err) } + } + return err +} + +func (p *Value) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetTVal() { + if err := oprot.WriteFieldBegin("tVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tVal: ", p), err) } + if err := p.TVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tVal: ", p), err) } + } + return err +} + +func (p *Value) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetDtVal() { + if err := oprot.WriteFieldBegin("dtVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:dtVal: ", p), err) } + if err := p.DtVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DtVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:dtVal: ", p), err) } + } + return err +} + +func (p *Value) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetVVal() { + if err := oprot.WriteFieldBegin("vVal", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:vVal: ", p), err) } + if err := p.VVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:vVal: ", p), err) } + } + return err +} + +func (p *Value) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetEVal() { + if err := oprot.WriteFieldBegin("eVal", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:eVal: ", p), err) } + if err := p.EVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:eVal: ", p), err) } + } + return err +} + +func (p *Value) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetPVal() { + if err := oprot.WriteFieldBegin("pVal", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:pVal: ", p), err) } + if err := p.PVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:pVal: ", p), err) } + } + return err +} + +func (p *Value) writeField12(oprot thrift.Protocol) (err error) { + if p.IsSetLVal() { + if err := oprot.WriteFieldBegin("lVal", thrift.STRUCT, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:lVal: ", p), err) } + if err := p.LVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:lVal: ", p), err) } + } + return err +} + +func (p *Value) writeField13(oprot thrift.Protocol) (err error) { + if p.IsSetMVal() { + if err := oprot.WriteFieldBegin("mVal", thrift.STRUCT, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:mVal: ", p), err) } + if err := p.MVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:mVal: ", p), err) } + } + return err +} + +func (p *Value) writeField14(oprot thrift.Protocol) (err error) { + if p.IsSetUVal() { + if err := oprot.WriteFieldBegin("uVal", thrift.STRUCT, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:uVal: ", p), err) } + if err := p.UVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:uVal: ", p), err) } + } + return err +} + +func (p *Value) writeField15(oprot thrift.Protocol) (err error) { + if p.IsSetGVal() { + if err := oprot.WriteFieldBegin("gVal", thrift.STRUCT, 15); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:gVal: ", p), err) } + if err := p.GVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:gVal: ", p), err) } + } + return err +} + +func (p *Value) String() string { + if p == nil { + return "" + } + + var nValVal string + if p.NVal == nil { + nValVal = "" + } else { + nValVal = fmt.Sprintf("%v", *p.NVal) + } + var bValVal string + if p.BVal == nil { + bValVal = "" + } else { + bValVal = fmt.Sprintf("%v", *p.BVal) + } + var iValVal string + if p.IVal == nil { + iValVal = "" + } else { + iValVal = fmt.Sprintf("%v", *p.IVal) + } + var fValVal string + if p.FVal == nil { + fValVal = "" + } else { + fValVal = fmt.Sprintf("%v", *p.FVal) + } + sValVal := fmt.Sprintf("%v", p.SVal) + var dValVal string + if p.DVal == nil { + dValVal = "" + } else { + dValVal = fmt.Sprintf("%v", p.DVal) + } + var tValVal string + if p.TVal == nil { + tValVal = "" + } else { + tValVal = fmt.Sprintf("%v", p.TVal) + } + var dtValVal string + if p.DtVal == nil { + dtValVal = "" + } else { + dtValVal = fmt.Sprintf("%v", p.DtVal) + } + var vValVal string + if p.VVal == nil { + vValVal = "" + } else { + vValVal = fmt.Sprintf("%v", p.VVal) + } + var eValVal string + if p.EVal == nil { + eValVal = "" + } else { + eValVal = fmt.Sprintf("%v", p.EVal) + } + var pValVal string + if p.PVal == nil { + pValVal = "" + } else { + pValVal = fmt.Sprintf("%v", p.PVal) + } + var lValVal string + if p.LVal == nil { + lValVal = "" + } else { + lValVal = fmt.Sprintf("%v", p.LVal) + } + var mValVal string + if p.MVal == nil { + mValVal = "" + } else { + mValVal = fmt.Sprintf("%v", p.MVal) + } + var uValVal string + if p.UVal == nil { + uValVal = "" + } else { + uValVal = fmt.Sprintf("%v", p.UVal) + } + var gValVal string + if p.GVal == nil { + gValVal = "" + } else { + gValVal = fmt.Sprintf("%v", p.GVal) + } + return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal) +} + +// Attributes: +// - Values +type NList struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNList() *NList { + return &NList{} +} + + +func (p *NList) GetValues() []*Value { + return p.Values +} +func (p *NList) 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 *NList) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem0 := NewValue() + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Values = append(p.Values, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NList) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NList"); 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 *NList) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NList) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NList({Values:%s})", valuesVal) +} + +// Attributes: +// - Kvs +type NMap struct { + Kvs map[string]*Value `thrift:"kvs,1" db:"kvs" json:"kvs"` +} + +func NewNMap() *NMap { + return &NMap{} +} + + +func (p *NMap) GetKvs() map[string]*Value { + return p.Kvs +} +func (p *NMap) 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 *NMap) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Kvs = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} + _val2 := NewValue() + if err := _val2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val2), err) + } + p.Kvs[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *NMap) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NMap"); 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 *NMap) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kvs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Kvs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kvs: ", p), err) } + return err +} + +func (p *NMap) String() string { + if p == nil { + return "" + } + + kvsVal := fmt.Sprintf("%v", p.Kvs) + return fmt.Sprintf("NMap({Kvs:%s})", kvsVal) +} + +// Attributes: +// - Values +type NSet struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNSet() *NSet { + return &NSet{} +} + + +func (p *NSet) GetValues() []*Value { + return p.Values +} +func (p *NSet) 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 *NSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*Value, 0, size) + p.Values = tSet + for i := 0; i < size; i ++ { + _elem3 := NewValue() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Values = append(p.Values, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *NSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NSet"); 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 *NSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.SET, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[*Value]bool, len(p.Values)) + for _, v := range p.Values { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NSet) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NSet({Values:%s})", valuesVal) +} + +// Attributes: +// - Values +type Row struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewRow() *Row { + return &Row{} +} + + +func (p *Row) GetValues() []*Value { + return p.Values +} +func (p *Row) 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 *Row) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewValue() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Values = append(p.Values, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Row) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Row"); 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 *Row) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *Row) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("Row({Values:%s})", valuesVal) +} + +// Attributes: +// - ColumnNames +// - Rows +type DataSet struct { + ColumnNames [][]byte `thrift:"column_names,1" db:"column_names" json:"column_names"` + Rows []*Row `thrift:"rows,2" db:"rows" json:"rows"` +} + +func NewDataSet() *DataSet { + return &DataSet{} +} + + +func (p *DataSet) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *DataSet) GetRows() []*Row { + return p.Rows +} +func (p *DataSet) 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 *DataSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ColumnNames = tSlice + for i := 0; i < size; i ++ { +var _elem5 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.ColumnNames = append(p.ColumnNames, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Row, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewRow() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.Rows = append(p.Rows, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DataSet"); 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 *DataSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:column_names: ", p), err) } + return err +} + +func (p *DataSet) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + 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:rows: ", p), err) } + return err +} + +func (p *DataSet) String() string { + if p == nil { + return "" + } + + columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) + rowsVal := fmt.Sprintf("%v", p.Rows) + return fmt.Sprintf("DataSet({ColumnNames:%s Rows:%s})", columnNamesVal, rowsVal) +} + +// Attributes: +// - Name +// - Props +type Tag struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Props map[string]*Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewTag() *Tag { + return &Tag{} +} + + +func (p *Tag) GetName() []byte { + return p.Name +} + +func (p *Tag) GetProps() map[string]*Value { + return p.Props +} +func (p *Tag) 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 *Tag) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Tag) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} + _val8 := NewValue() + if err := _val8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val8), err) + } + p.Props[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Tag) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Tag"); 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 *Tag) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Tag) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Tag({Name:%s Props:%s})", nameVal, propsVal) +} + +// Attributes: +// - Vid +// - Tags +type Vertex struct { + Vid *Value `thrift:"vid,1" db:"vid" json:"vid"` + Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewVertex() *Vertex { + return &Vertex{} +} + +var Vertex_Vid_DEFAULT *Value +func (p *Vertex) GetVid() *Value { + if !p.IsSetVid() { + return Vertex_Vid_DEFAULT + } +return p.Vid +} + +func (p *Vertex) GetTags() []*Tag { + return p.Tags +} +func (p *Vertex) IsSetVid() bool { + return p != nil && p.Vid != nil +} + +func (p *Vertex) 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 *Vertex) ReadField1(iprot thrift.Protocol) error { + p.Vid = NewValue() + if err := p.Vid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vid), err) + } + return nil +} + +func (p *Vertex) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewTag() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Tags = append(p.Tags, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Vertex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Vertex"); 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 *Vertex) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:vid: ", p), err) } + if err := p.Vid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:vid: ", p), err) } + return err +} + +func (p *Vertex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *Vertex) String() string { + if p == nil { + return "" + } + + var vidVal string + if p.Vid == nil { + vidVal = "" + } else { + vidVal = fmt.Sprintf("%v", p.Vid) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("Vertex({Vid:%s Tags:%s})", vidVal, tagsVal) +} + +// Attributes: +// - Src +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Edge struct { + Src *Value `thrift:"src,1" db:"src" json:"src"` + Dst *Value `thrift:"dst,2" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,3" db:"type" json:"type"` + Name []byte `thrift:"name,4" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,5" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,6" db:"props" json:"props"` +} + +func NewEdge() *Edge { + return &Edge{} +} + +var Edge_Src_DEFAULT *Value +func (p *Edge) GetSrc() *Value { + if !p.IsSetSrc() { + return Edge_Src_DEFAULT + } +return p.Src +} +var Edge_Dst_DEFAULT *Value +func (p *Edge) GetDst() *Value { + if !p.IsSetDst() { + return Edge_Dst_DEFAULT + } +return p.Dst +} + +func (p *Edge) GetType() EdgeType { + return p.Type +} + +func (p *Edge) GetName() []byte { + return p.Name +} + +func (p *Edge) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Edge) GetProps() map[string]*Value { + return p.Props +} +func (p *Edge) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Edge) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Edge) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Edge) ReadField1(iprot thrift.Protocol) error { + p.Src = NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Edge) ReadField2(iprot thrift.Protocol) error { + p.Dst = NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Edge) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Edge) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Edge) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Edge) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} + _val11 := NewValue() + if err := _val11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val11), err) + } + p.Props[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Edge) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Edge"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Edge) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Edge) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dst: ", p), err) } + return err +} + +func (p *Edge) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *Edge) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:name: ", p), err) } + return err +} + +func (p *Edge) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ranking: ", p), err) } + return err +} + +func (p *Edge) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) } + return err +} + +func (p *Edge) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Edge({Src:%s Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", srcVal, dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Step struct { + Dst *Vertex `thrift:"dst,1" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,2" db:"type" json:"type"` + Name []byte `thrift:"name,3" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,4" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,5" db:"props" json:"props"` +} + +func NewStep() *Step { + return &Step{ + Dst: NewVertex(), + } +} + +var Step_Dst_DEFAULT *Vertex +func (p *Step) GetDst() *Vertex { + if !p.IsSetDst() { + return Step_Dst_DEFAULT + } +return p.Dst +} + +func (p *Step) GetType() EdgeType { + return p.Type +} + +func (p *Step) GetName() []byte { + return p.Name +} + +func (p *Step) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Step) GetProps() map[string]*Value { + return p.Props +} +func (p *Step) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Step) 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 + } + 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 *Step) ReadField1(iprot thrift.Protocol) error { + p.Dst = NewVertex() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Step) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Step) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Step) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Step) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key12 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key12 = v +} + _val13 := NewValue() + if err := _val13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val13), err) + } + p.Props[_key12] = _val13 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Step) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Step"); 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 *Step) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dst: ", p), err) } + return err +} + +func (p *Step) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *Step) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *Step) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ranking: ", p), err) } + return err +} + +func (p *Step) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:props: ", p), err) } + return err +} + +func (p *Step) String() string { + if p == nil { + return "" + } + + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Step({Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Src +// - Steps +type Path struct { + Src *Vertex `thrift:"src,1" db:"src" json:"src"` + Steps []*Step `thrift:"steps,2" db:"steps" json:"steps"` +} + +func NewPath() *Path { + return &Path{ + Src: NewVertex(), + } +} + +var Path_Src_DEFAULT *Vertex +func (p *Path) GetSrc() *Vertex { + if !p.IsSetSrc() { + return Path_Src_DEFAULT + } +return p.Src +} + +func (p *Path) GetSteps() []*Step { + return p.Steps +} +func (p *Path) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Path) 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 *Path) ReadField1(iprot thrift.Protocol) error { + p.Src = NewVertex() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Path) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Step, 0, size) + p.Steps = tSlice + for i := 0; i < size; i ++ { + _elem14 := NewStep() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + p.Steps = append(p.Steps, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Path) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Path"); 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 *Path) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Path) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("steps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:steps: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Steps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Steps { + 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:steps: ", p), err) } + return err +} + +func (p *Path) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + stepsVal := fmt.Sprintf("%v", p.Steps) + return fmt.Sprintf("Path({Src:%s Steps:%s})", srcVal, stepsVal) +} + +// Attributes: +// - Host +// - Port +type HostAddr struct { + Host string `thrift:"host,1" db:"host" json:"host"` + Port Port `thrift:"port,2" db:"port" json:"port"` +} + +func NewHostAddr() *HostAddr { + return &HostAddr{} +} + + +func (p *HostAddr) GetHost() string { + return p.Host +} + +func (p *HostAddr) GetPort() Port { + return p.Port +} +func (p *HostAddr) 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 *HostAddr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *HostAddr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := Port(v) + p.Port = temp +} + return nil +} + +func (p *HostAddr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostAddr"); 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 *HostAddr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteString(string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostAddr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } + if err := oprot.WriteI32(int32(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } + return err +} + +func (p *HostAddr) String() string { + if p == nil { + return "" + } + + hostVal := fmt.Sprintf("%v", p.Host) + portVal := fmt.Sprintf("%v", p.Port) + return fmt.Sprintf("HostAddr({Host:%s Port:%s})", hostVal, portVal) +} + +// Attributes: +// - Key +// - Value +type KeyValue struct { + Key []byte `thrift:"key,1" db:"key" json:"key"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewKeyValue() *KeyValue { + return &KeyValue{} +} + + +func (p *KeyValue) GetKey() []byte { + return p.Key +} + +func (p *KeyValue) GetValue() []byte { + return p.Value +} +func (p *KeyValue) 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 *KeyValue) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *KeyValue) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *KeyValue) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KeyValue"); 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 *KeyValue) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *KeyValue) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("KeyValue({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - LogID +// - TermID +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"` +} + +func NewLogInfo() *LogInfo { + return &LogInfo{} +} + + +func (p *LogInfo) GetLogID() LogID { + return p.LogID +} + +func (p *LogInfo) GetTermID() TermID { + return p.TermID +} +func (p *LogInfo) 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 *LogInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := LogID(v) + p.LogID = temp +} + return nil +} + +func (p *LogInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TermID(v) + p.TermID = temp +} + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("log_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:log_id: ", p), err) } + if err := oprot.WriteI64(int64(p.LogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TermID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_id: ", p), err) } + return err +} + +func (p *LogInfo) String() string { + if p == nil { + return "" + } + + logIDVal := fmt.Sprintf("%v", p.LogID) + termIDVal := fmt.Sprintf("%v", p.TermID) + return fmt.Sprintf("LogInfo({LogID:%s TermID:%s})", logIDVal, termIDVal) +} + +// Attributes: +// - Root +// - Data +type DirInfo struct { + Root []byte `thrift:"root,1" db:"root" json:"root"` + Data [][]byte `thrift:"data,2" db:"data" json:"data"` +} + +func NewDirInfo() *DirInfo { + return &DirInfo{} +} + + +func (p *DirInfo) GetRoot() []byte { + return p.Root +} + +func (p *DirInfo) GetData() [][]byte { + return p.Data +} +func (p *DirInfo) 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 *DirInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Root = v +} + return nil +} + +func (p *DirInfo) 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.Data = tSlice + for i := 0; i < size; i ++ { +var _elem15 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem15 = v +} + p.Data = append(p.Data, _elem15) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DirInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DirInfo"); 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 *DirInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("root", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:root: ", p), err) } + if err := oprot.WriteBinary(p.Root); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.root (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:root: ", p), err) } + return err +} + +func (p *DirInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + 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:data: ", p), err) } + return err +} + +func (p *DirInfo) String() string { + if p == nil { + return "" + } + + rootVal := fmt.Sprintf("%v", p.Root) + dataVal := fmt.Sprintf("%v", p.Data) + return fmt.Sprintf("DirInfo({Root:%s Data:%s})", rootVal, dataVal) +} + +// Attributes: +// - Host +// - Dir +type NodeInfo struct { + Host *HostAddr `thrift:"host,1" db:"host" json:"host"` + Dir *DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewNodeInfo() *NodeInfo { + return &NodeInfo{ + Host: NewHostAddr(), + Dir: NewDirInfo(), + } +} + +var NodeInfo_Host_DEFAULT *HostAddr +func (p *NodeInfo) GetHost() *HostAddr { + if !p.IsSetHost() { + return NodeInfo_Host_DEFAULT + } +return p.Host +} +var NodeInfo_Dir_DEFAULT *DirInfo +func (p *NodeInfo) GetDir() *DirInfo { + if !p.IsSetDir() { + return NodeInfo_Dir_DEFAULT + } +return p.Dir +} +func (p *NodeInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *NodeInfo) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *NodeInfo) 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 *NodeInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *NodeInfo) ReadField2(iprot thrift.Protocol) error { + p.Dir = NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *NodeInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NodeInfo"); 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 *NodeInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *NodeInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *NodeInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("NodeInfo({Host:%s Dir:%s})", hostVal, dirVal) +} + +// Attributes: +// - Info +type PartitionBackupInfo struct { + Info map[PartitionID]*LogInfo `thrift:"info,1" db:"info" json:"info"` +} + +func NewPartitionBackupInfo() *PartitionBackupInfo { + return &PartitionBackupInfo{} +} + + +func (p *PartitionBackupInfo) GetInfo() map[PartitionID]*LogInfo { + return p.Info +} +func (p *PartitionBackupInfo) 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 *PartitionBackupInfo) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[PartitionID]*LogInfo, size) + p.Info = tMap + for i := 0; i < size; i ++ { +var _key16 PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := PartitionID(v) + _key16 = temp +} + _val17 := NewLogInfo() + if err := _val17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val17), err) + } + p.Info[_key16] = _val17 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PartitionBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionBackupInfo"); 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 *PartitionBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Info { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) } + return err +} + +func (p *PartitionBackupInfo) String() string { + if p == nil { + return "" + } + + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("PartitionBackupInfo({Info:%s})", infoVal) +} + +// Attributes: +// - PartitionInfo +// - Path +type CheckpointInfo struct { + PartitionInfo *PartitionBackupInfo `thrift:"partition_info,1" db:"partition_info" json:"partition_info"` + Path []byte `thrift:"path,2" db:"path" json:"path"` +} + +func NewCheckpointInfo() *CheckpointInfo { + return &CheckpointInfo{ + PartitionInfo: NewPartitionBackupInfo(), + } +} + +var CheckpointInfo_PartitionInfo_DEFAULT *PartitionBackupInfo +func (p *CheckpointInfo) GetPartitionInfo() *PartitionBackupInfo { + if !p.IsSetPartitionInfo() { + return CheckpointInfo_PartitionInfo_DEFAULT + } +return p.PartitionInfo +} + +func (p *CheckpointInfo) GetPath() []byte { + return p.Path +} +func (p *CheckpointInfo) IsSetPartitionInfo() bool { + return p != nil && p.PartitionInfo != nil +} + +func (p *CheckpointInfo) 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 *CheckpointInfo) ReadField1(iprot thrift.Protocol) error { + p.PartitionInfo = NewPartitionBackupInfo() + if err := p.PartitionInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionInfo), err) + } + return nil +} + +func (p *CheckpointInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Path = v +} + return nil +} + +func (p *CheckpointInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckpointInfo"); 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 *CheckpointInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_info", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:partition_info: ", p), err) } + if err := p.PartitionInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:partition_info: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) } + if err := oprot.WriteBinary(p.Path); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.path (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) } + return err +} + +func (p *CheckpointInfo) String() string { + if p == nil { + return "" + } + + var partitionInfoVal string + if p.PartitionInfo == nil { + partitionInfoVal = "" + } else { + partitionInfoVal = fmt.Sprintf("%v", p.PartitionInfo) + } + pathVal := fmt.Sprintf("%v", p.Path) + return fmt.Sprintf("CheckpointInfo({PartitionInfo:%s Path:%s})", partitionInfoVal, pathVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/constants.go b/ccore/nebula/internal/thrift/v2_5_1/constants.go new file mode 100644 index 0000000..2030b74 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/constants.go @@ -0,0 +1,25 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/graph/constants.go b/ccore/nebula/internal/thrift/v2_5_1/graph/constants.go new file mode 100644 index 0000000..34d5435 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/graph/constants.go @@ -0,0 +1,28 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/graph/graph_service-remote/graph_service-remote.go b/ccore/nebula/internal/thrift/v2_5_1/graph/graph_service-remote/graph_service-remote.go new file mode 100755 index 0000000..4c0d72f --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/graph/graph_service-remote/graph_service-remote.go @@ -0,0 +1,186 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/graph" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AuthResponse authenticate(string username, string password)") + fmt.Fprintln(os.Stderr, " void signout(i64 sessionId)") + fmt.Fprintln(os.Stderr, " ExecutionResponse execute(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " string executeJson(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := graph.NewGraphServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "authenticate": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Authenticate requires 2 args") + flag.Usage() + } + argvalue0 := []byte(flag.Arg(1)) + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Authenticate(value0, value1)) + fmt.Print("\n") + break + case "signout": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Signout requires 1 args") + flag.Usage() + } + argvalue0, err13 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err13 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Signout(value0)) + fmt.Print("\n") + break + case "execute": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Execute requires 2 args") + flag.Usage() + } + argvalue0, err14 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err14 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Execute(value0, value1)) + fmt.Print("\n") + break + case "executeJson": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "ExecuteJson requires 2 args") + flag.Usage() + } + argvalue0, err16 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err16 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.ExecuteJson(value0, value1)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/graph/graphservice.go b/ccore/nebula/internal/thrift/v2_5_1/graph/graphservice.go new file mode 100644 index 0000000..b322fe7 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/graph/graphservice.go @@ -0,0 +1,1328 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type GraphService interface { + // Parameters: + // - Username + // - Password + Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(ctx context.Context, sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) +} + +type GraphServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Username + // - Password + Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) +} + +type GraphServiceClient struct { + GraphServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceClientProtocol(prot thrift.Protocol) *GraphServiceClient { + return NewGraphServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceClient) Signout(sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceThreadsafeClient struct { + GraphServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphServiceThreadsafeClient { + return NewGraphServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceThreadsafeClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceThreadsafeClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceThreadsafeClient) Signout(sessionId int64) (err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceThreadsafeClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceThreadsafeClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphServiceChannelClient(channel thrift.RequestChannel) *GraphServiceChannelClient { + return &GraphServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceChannelClient) Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + var result GraphServiceAuthenticateResult + err = p.RequestChannel.Call(ctx, "authenticate", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceChannelClient) Signout(ctx context.Context, sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.RequestChannel.Oneway(ctx, "signout", &args) + if err != nil { return } + + return nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteResult + err = p.RequestChannel.Call(ctx, "execute", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteJsonResult + err = p.RequestChannel.Call(ctx, "executeJson", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphService +} + +func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { + self9 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self9.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} + self9.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} + self9.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} + self9.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} + return self9 +} + +type graphServiceProcessorAuthenticate struct { + handler GraphService +} + +func (p *graphServiceProcessorAuthenticate) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceAuthenticateArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorAuthenticate) 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("authenticate", 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 *graphServiceProcessorAuthenticate) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceAuthenticateArgs) + var result GraphServiceAuthenticateResult + if retval, err := p.handler.Authenticate(ctx, args.Username, args.Password); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing authenticate: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorSignout struct { + handler GraphService +} + +func (p *graphServiceProcessorSignout) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceSignoutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorSignout) 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("signout", 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 *graphServiceProcessorSignout) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceSignoutArgs) + if err := p.handler.Signout(ctx, args.SessionId); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signout: " + err.Error()) + return x, x + } + } + return nil, nil +} + +type graphServiceProcessorExecute struct { + handler GraphService +} + +func (p *graphServiceProcessorExecute) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecute) 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("execute", 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 *graphServiceProcessorExecute) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteArgs) + var result GraphServiceExecuteResult + if retval, err := p.handler.Execute(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing execute: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorExecuteJson struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJson) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteJsonArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecuteJson) 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("executeJson", 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 *graphServiceProcessorExecuteJson) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteJsonArgs) + var result GraphServiceExecuteJsonResult + if retval, err := p.handler.ExecuteJson(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJson: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Username +// - Password +type GraphServiceAuthenticateArgs struct { + thrift.IRequest + Username []byte `thrift:"username,1" db:"username" json:"username"` + Password []byte `thrift:"password,2" db:"password" json:"password"` +} + +func NewGraphServiceAuthenticateArgs() *GraphServiceAuthenticateArgs { + return &GraphServiceAuthenticateArgs{} +} + + +func (p *GraphServiceAuthenticateArgs) GetUsername() []byte { + return p.Username +} + +func (p *GraphServiceAuthenticateArgs) GetPassword() []byte { + return p.Password +} +func (p *GraphServiceAuthenticateArgs) 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 *GraphServiceAuthenticateArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Username = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Password = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 := 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 *GraphServiceAuthenticateArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("username", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:username: ", p), err) } + if err := oprot.WriteBinary(p.Username); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:username: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("password", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:password: ", p), err) } + if err := oprot.WriteBinary(p.Password); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:password: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) String() string { + if p == nil { + return "" + } + + usernameVal := fmt.Sprintf("%v", p.Username) + passwordVal := fmt.Sprintf("%v", p.Password) + return fmt.Sprintf("GraphServiceAuthenticateArgs({Username:%s Password:%s})", usernameVal, passwordVal) +} + +// Attributes: +// - Success +type GraphServiceAuthenticateResult struct { + thrift.IResponse + Success *AuthResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceAuthenticateResult() *GraphServiceAuthenticateResult { + return &GraphServiceAuthenticateResult{} +} + +var GraphServiceAuthenticateResult_Success_DEFAULT *AuthResponse +func (p *GraphServiceAuthenticateResult) GetSuccess() *AuthResponse { + if !p.IsSetSuccess() { + return GraphServiceAuthenticateResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceAuthenticateResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAuthResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceAuthenticateResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +type GraphServiceSignoutArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` +} + +func NewGraphServiceSignoutArgs() *GraphServiceSignoutArgs { + return &GraphServiceSignoutArgs{} +} + + +func (p *GraphServiceSignoutArgs) GetSessionId() int64 { + return p.SessionId +} +func (p *GraphServiceSignoutArgs) 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 *GraphServiceSignoutArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceSignoutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signout_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 *GraphServiceSignoutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceSignoutArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + return fmt.Sprintf("GraphServiceSignoutArgs({SessionId:%s})", sessionIdVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteArgs() *GraphServiceExecuteArgs { + return &GraphServiceExecuteArgs{} +} + + +func (p *GraphServiceExecuteArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteArgs) 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 *GraphServiceExecuteArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 := 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 *GraphServiceExecuteArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteResult struct { + thrift.IResponse + Success *ExecutionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteResult() *GraphServiceExecuteResult { + return &GraphServiceExecuteResult{} +} + +var GraphServiceExecuteResult_Success_DEFAULT *ExecutionResponse +func (p *GraphServiceExecuteResult) GetSuccess() *ExecutionResponse { + if !p.IsSetSuccess() { + return GraphServiceExecuteResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceExecuteResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecutionResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceExecuteResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteJsonArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteJsonArgs() *GraphServiceExecuteJsonArgs { + return &GraphServiceExecuteJsonArgs{} +} + + +func (p *GraphServiceExecuteJsonArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteJsonArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteJsonArgs) 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 *GraphServiceExecuteJsonArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 := 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 *GraphServiceExecuteJsonArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteJsonArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteJsonResult struct { + thrift.IResponse + Success []byte `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteJsonResult() *GraphServiceExecuteJsonResult { + return &GraphServiceExecuteJsonResult{} +} + +var GraphServiceExecuteJsonResult_Success_DEFAULT []byte + +func (p *GraphServiceExecuteJsonResult) GetSuccess() []byte { + return p.Success +} +func (p *GraphServiceExecuteJsonResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteJsonResult) 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 *GraphServiceExecuteJsonResult) ReadField0(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 *GraphServiceExecuteJsonResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteJsonResult) String() string { + if p == nil { + return "" + } + + successVal := fmt.Sprintf("%v", p.Success) + return fmt.Sprintf("GraphServiceExecuteJsonResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_1/graph/ttypes.go b/ccore/nebula/internal/thrift/v2_5_1/graph/ttypes.go new file mode 100644 index 0000000..747b582 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/graph/ttypes.go @@ -0,0 +1,1724 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +// Attributes: +// - Rows +// - ExecDurationInUs +// - TotalDurationInUs +// - OtherStats +type ProfilingStats struct { + Rows int64 `thrift:"rows,1,required" db:"rows" json:"rows"` + ExecDurationInUs int64 `thrift:"exec_duration_in_us,2,required" db:"exec_duration_in_us" json:"exec_duration_in_us"` + TotalDurationInUs int64 `thrift:"total_duration_in_us,3,required" db:"total_duration_in_us" json:"total_duration_in_us"` + OtherStats map[string][]byte `thrift:"other_stats,4" db:"other_stats" json:"other_stats,omitempty"` +} + +func NewProfilingStats() *ProfilingStats { + return &ProfilingStats{} +} + + +func (p *ProfilingStats) GetRows() int64 { + return p.Rows +} + +func (p *ProfilingStats) GetExecDurationInUs() int64 { + return p.ExecDurationInUs +} + +func (p *ProfilingStats) GetTotalDurationInUs() int64 { + return p.TotalDurationInUs +} +var ProfilingStats_OtherStats_DEFAULT map[string][]byte + +func (p *ProfilingStats) GetOtherStats() map[string][]byte { + return p.OtherStats +} +func (p *ProfilingStats) IsSetOtherStats() bool { + return p != nil && p.OtherStats != nil +} + +func (p *ProfilingStats) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRows bool = false; + var issetExecDurationInUs bool = false; + var issetTotalDurationInUs 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 + } + issetRows = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetExecDurationInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTotalDurationInUs = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRows{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetExecDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExecDurationInUs is not set")); + } + if !issetTotalDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TotalDurationInUs is not set")); + } + return nil +} + +func (p *ProfilingStats) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Rows = v +} + return nil +} + +func (p *ProfilingStats) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExecDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TotalDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.OtherStats = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.OtherStats[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ProfilingStats) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ProfilingStats"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ProfilingStats) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:rows: ", p), err) } + if err := oprot.WriteI64(int64(p.Rows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:rows: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("exec_duration_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:exec_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.ExecDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.exec_duration_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:exec_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("total_duration_in_us", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:total_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.TotalDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_duration_in_us (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:total_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetOtherStats() { + if err := oprot.WriteFieldBegin("other_stats", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:other_stats: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.OtherStats)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.OtherStats { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:other_stats: ", p), err) } + } + return err +} + +func (p *ProfilingStats) String() string { + if p == nil { + return "" + } + + rowsVal := fmt.Sprintf("%v", p.Rows) + execDurationInUsVal := fmt.Sprintf("%v", p.ExecDurationInUs) + totalDurationInUsVal := fmt.Sprintf("%v", p.TotalDurationInUs) + otherStatsVal := fmt.Sprintf("%v", p.OtherStats) + return fmt.Sprintf("ProfilingStats({Rows:%s ExecDurationInUs:%s TotalDurationInUs:%s OtherStats:%s})", rowsVal, execDurationInUsVal, totalDurationInUsVal, otherStatsVal) +} + +// Attributes: +// - IsDoBranch +// - ConditionNodeID +type PlanNodeBranchInfo struct { + IsDoBranch bool `thrift:"is_do_branch,1,required" db:"is_do_branch" json:"is_do_branch"` + ConditionNodeID int64 `thrift:"condition_node_id,2,required" db:"condition_node_id" json:"condition_node_id"` +} + +func NewPlanNodeBranchInfo() *PlanNodeBranchInfo { + return &PlanNodeBranchInfo{} +} + + +func (p *PlanNodeBranchInfo) GetIsDoBranch() bool { + return p.IsDoBranch +} + +func (p *PlanNodeBranchInfo) GetConditionNodeID() int64 { + return p.ConditionNodeID +} +func (p *PlanNodeBranchInfo) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetIsDoBranch bool = false; + var issetConditionNodeID 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 + } + issetIsDoBranch = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetConditionNodeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetIsDoBranch{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsDoBranch is not set")); + } + if !issetConditionNodeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ConditionNodeID is not set")); + } + return nil +} + +func (p *PlanNodeBranchInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.IsDoBranch = v +} + return nil +} + +func (p *PlanNodeBranchInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ConditionNodeID = v +} + return nil +} + +func (p *PlanNodeBranchInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeBranchInfo"); 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 *PlanNodeBranchInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_do_branch", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:is_do_branch: ", p), err) } + if err := oprot.WriteBool(bool(p.IsDoBranch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_do_branch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:is_do_branch: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("condition_node_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:condition_node_id: ", p), err) } + if err := oprot.WriteI64(int64(p.ConditionNodeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition_node_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:condition_node_id: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) String() string { + if p == nil { + return "" + } + + isDoBranchVal := fmt.Sprintf("%v", p.IsDoBranch) + conditionNodeIDVal := fmt.Sprintf("%v", p.ConditionNodeID) + return fmt.Sprintf("PlanNodeBranchInfo({IsDoBranch:%s ConditionNodeID:%s})", isDoBranchVal, conditionNodeIDVal) +} + +// Attributes: +// - Key +// - Value +type Pair struct { + Key []byte `thrift:"key,1,required" db:"key" json:"key"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewPair() *Pair { + return &Pair{} +} + + +func (p *Pair) GetKey() []byte { + return p.Key +} + +func (p *Pair) GetValue() []byte { + return p.Value +} +func (p *Pair) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKey bool = false; + var issetValue 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 + } + issetKey = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetKey{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *Pair) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *Pair) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *Pair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Pair"); 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 *Pair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *Pair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *Pair) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("Pair({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - Name +// - Id +// - OutputVar +// - Description +// - Profiles +// - BranchInfo +// - Dependencies +type PlanNodeDescription struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Id int64 `thrift:"id,2,required" db:"id" json:"id"` + OutputVar []byte `thrift:"output_var,3,required" db:"output_var" json:"output_var"` + Description []*Pair `thrift:"description,4" db:"description" json:"description,omitempty"` + Profiles []*ProfilingStats `thrift:"profiles,5" db:"profiles" json:"profiles,omitempty"` + BranchInfo *PlanNodeBranchInfo `thrift:"branch_info,6" db:"branch_info" json:"branch_info,omitempty"` + Dependencies []int64 `thrift:"dependencies,7" db:"dependencies" json:"dependencies,omitempty"` +} + +func NewPlanNodeDescription() *PlanNodeDescription { + return &PlanNodeDescription{} +} + + +func (p *PlanNodeDescription) GetName() []byte { + return p.Name +} + +func (p *PlanNodeDescription) GetId() int64 { + return p.Id +} + +func (p *PlanNodeDescription) GetOutputVar() []byte { + return p.OutputVar +} +var PlanNodeDescription_Description_DEFAULT []*Pair + +func (p *PlanNodeDescription) GetDescription() []*Pair { + return p.Description +} +var PlanNodeDescription_Profiles_DEFAULT []*ProfilingStats + +func (p *PlanNodeDescription) GetProfiles() []*ProfilingStats { + return p.Profiles +} +var PlanNodeDescription_BranchInfo_DEFAULT *PlanNodeBranchInfo +func (p *PlanNodeDescription) GetBranchInfo() *PlanNodeBranchInfo { + if !p.IsSetBranchInfo() { + return PlanNodeDescription_BranchInfo_DEFAULT + } +return p.BranchInfo +} +var PlanNodeDescription_Dependencies_DEFAULT []int64 + +func (p *PlanNodeDescription) GetDependencies() []int64 { + return p.Dependencies +} +func (p *PlanNodeDescription) IsSetDescription() bool { + return p != nil && p.Description != nil +} + +func (p *PlanNodeDescription) IsSetProfiles() bool { + return p != nil && p.Profiles != nil +} + +func (p *PlanNodeDescription) IsSetBranchInfo() bool { + return p != nil && p.BranchInfo != nil +} + +func (p *PlanNodeDescription) IsSetDependencies() bool { + return p != nil && p.Dependencies != nil +} + +func (p *PlanNodeDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetId bool = false; + var issetOutputVar 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetId = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetOutputVar = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetId{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Id is not set")); + } + if !issetOutputVar{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OutputVar is not set")); + } + return nil +} + +func (p *PlanNodeDescription) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OutputVar = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Pair, 0, size) + p.Description = tSlice + for i := 0; i < size; i ++ { + _elem3 := NewPair() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Description = append(p.Description, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ProfilingStats, 0, size) + p.Profiles = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewProfilingStats() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Profiles = append(p.Profiles, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField6(iprot thrift.Protocol) error { + p.BranchInfo = NewPlanNodeBranchInfo() + if err := p.BranchInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BranchInfo), err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Dependencies = tSlice + for i := 0; i < size; i ++ { +var _elem5 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Dependencies = append(p.Dependencies, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeDescription"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeDescription) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("output_var", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:output_var: ", p), err) } + if err := oprot.WriteBinary(p.OutputVar); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.output_var (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:output_var: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetDescription() { + if err := oprot.WriteFieldBegin("description", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:description: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Description)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Description { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:description: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetProfiles() { + if err := oprot.WriteFieldBegin("profiles", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:profiles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Profiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Profiles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:profiles: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetBranchInfo() { + if err := oprot.WriteFieldBegin("branch_info", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:branch_info: ", p), err) } + if err := p.BranchInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BranchInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:branch_info: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetDependencies() { + if err := oprot.WriteFieldBegin("dependencies", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dependencies: ", p), err) } + if err := oprot.WriteListBegin(thrift.I64, len(p.Dependencies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dependencies { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dependencies: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + idVal := fmt.Sprintf("%v", p.Id) + outputVarVal := fmt.Sprintf("%v", p.OutputVar) + descriptionVal := fmt.Sprintf("%v", p.Description) + profilesVal := fmt.Sprintf("%v", p.Profiles) + var branchInfoVal string + if p.BranchInfo == nil { + branchInfoVal = "" + } else { + branchInfoVal = fmt.Sprintf("%v", p.BranchInfo) + } + dependenciesVal := fmt.Sprintf("%v", p.Dependencies) + return fmt.Sprintf("PlanNodeDescription({Name:%s Id:%s OutputVar:%s Description:%s Profiles:%s BranchInfo:%s Dependencies:%s})", nameVal, idVal, outputVarVal, descriptionVal, profilesVal, branchInfoVal, dependenciesVal) +} + +// Attributes: +// - PlanNodeDescs +// - NodeIndexMap +// - Format +// - OptimizeTimeInUs +type PlanDescription struct { + PlanNodeDescs []*PlanNodeDescription `thrift:"plan_node_descs,1,required" db:"plan_node_descs" json:"plan_node_descs"` + NodeIndexMap map[int64]int64 `thrift:"node_index_map,2,required" db:"node_index_map" json:"node_index_map"` + Format []byte `thrift:"format,3,required" db:"format" json:"format"` + OptimizeTimeInUs int32 `thrift:"optimize_time_in_us,4,required" db:"optimize_time_in_us" json:"optimize_time_in_us"` +} + +func NewPlanDescription() *PlanDescription { + return &PlanDescription{} +} + + +func (p *PlanDescription) GetPlanNodeDescs() []*PlanNodeDescription { + return p.PlanNodeDescs +} + +func (p *PlanDescription) GetNodeIndexMap() map[int64]int64 { + return p.NodeIndexMap +} + +func (p *PlanDescription) GetFormat() []byte { + return p.Format +} + +func (p *PlanDescription) GetOptimizeTimeInUs() int32 { + return p.OptimizeTimeInUs +} +func (p *PlanDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPlanNodeDescs bool = false; + var issetNodeIndexMap bool = false; + var issetFormat bool = false; + var issetOptimizeTimeInUs 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 + } + issetPlanNodeDescs = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetNodeIndexMap = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetFormat = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetOptimizeTimeInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPlanNodeDescs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PlanNodeDescs is not set")); + } + if !issetNodeIndexMap{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NodeIndexMap is not set")); + } + if !issetFormat{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Format is not set")); + } + if !issetOptimizeTimeInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OptimizeTimeInUs is not set")); + } + return nil +} + +func (p *PlanDescription) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PlanNodeDescription, 0, size) + p.PlanNodeDescs = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewPlanNodeDescription() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.PlanNodeDescs = append(p.PlanNodeDescs, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int64]int64, size) + p.NodeIndexMap = tMap + for i := 0; i < size; i ++ { +var _key7 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} +var _val8 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val8 = v +} + p.NodeIndexMap[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Format = v +} + return nil +} + +func (p *PlanDescription) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OptimizeTimeInUs = v +} + return nil +} + +func (p *PlanDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanDescription"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanDescription) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("plan_node_descs", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:plan_node_descs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PlanNodeDescs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PlanNodeDescs { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:plan_node_descs: ", p), err) } + return err +} + +func (p *PlanDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node_index_map", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node_index_map: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.NodeIndexMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NodeIndexMap { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node_index_map: ", p), err) } + return err +} + +func (p *PlanDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("format", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:format: ", p), err) } + if err := oprot.WriteBinary(p.Format); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.format (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:format: ", p), err) } + return err +} + +func (p *PlanDescription) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("optimize_time_in_us", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:optimize_time_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.OptimizeTimeInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.optimize_time_in_us (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:optimize_time_in_us: ", p), err) } + return err +} + +func (p *PlanDescription) String() string { + if p == nil { + return "" + } + + planNodeDescsVal := fmt.Sprintf("%v", p.PlanNodeDescs) + nodeIndexMapVal := fmt.Sprintf("%v", p.NodeIndexMap) + formatVal := fmt.Sprintf("%v", p.Format) + optimizeTimeInUsVal := fmt.Sprintf("%v", p.OptimizeTimeInUs) + return fmt.Sprintf("PlanDescription({PlanNodeDescs:%s NodeIndexMap:%s Format:%s OptimizeTimeInUs:%s})", planNodeDescsVal, nodeIndexMapVal, formatVal, optimizeTimeInUsVal) +} + +// Attributes: +// - ErrorCode +// - LatencyInUs +// - Data +// - SpaceName +// - ErrorMsg +// - PlanDesc +// - Comment +type ExecutionResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + Data *nebula0.DataSet `thrift:"data,3" db:"data" json:"data,omitempty"` + SpaceName []byte `thrift:"space_name,4" db:"space_name" json:"space_name,omitempty"` + ErrorMsg []byte `thrift:"error_msg,5" db:"error_msg" json:"error_msg,omitempty"` + PlanDesc *PlanDescription `thrift:"plan_desc,6" db:"plan_desc" json:"plan_desc,omitempty"` + Comment []byte `thrift:"comment,7" db:"comment" json:"comment,omitempty"` +} + +func NewExecutionResponse() *ExecutionResponse { + return &ExecutionResponse{} +} + + +func (p *ExecutionResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} + +func (p *ExecutionResponse) GetLatencyInUs() int32 { + return p.LatencyInUs +} +var ExecutionResponse_Data_DEFAULT *nebula0.DataSet +func (p *ExecutionResponse) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return ExecutionResponse_Data_DEFAULT + } +return p.Data +} +var ExecutionResponse_SpaceName_DEFAULT []byte + +func (p *ExecutionResponse) GetSpaceName() []byte { + return p.SpaceName +} +var ExecutionResponse_ErrorMsg_DEFAULT []byte + +func (p *ExecutionResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var ExecutionResponse_PlanDesc_DEFAULT *PlanDescription +func (p *ExecutionResponse) GetPlanDesc() *PlanDescription { + if !p.IsSetPlanDesc() { + return ExecutionResponse_PlanDesc_DEFAULT + } +return p.PlanDesc +} +var ExecutionResponse_Comment_DEFAULT []byte + +func (p *ExecutionResponse) GetComment() []byte { + return p.Comment +} +func (p *ExecutionResponse) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *ExecutionResponse) IsSetSpaceName() bool { + return p != nil && p.SpaceName != nil +} + +func (p *ExecutionResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *ExecutionResponse) IsSetPlanDesc() bool { + return p != nil && p.PlanDesc != nil +} + +func (p *ExecutionResponse) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ExecutionResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + var issetLatencyInUs 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 + } + issetErrorCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ExecutionResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *ExecutionResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ExecutionResponse) ReadField3(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ExecutionResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *ExecutionResponse) ReadField6(iprot thrift.Protocol) error { + p.PlanDesc = NewPlanDescription() + if err := p.PlanDesc.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PlanDesc), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ExecutionResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecutionResponse"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecutionResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceName() { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_name: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_msg: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetPlanDesc() { + if err := oprot.WriteFieldBegin("plan_desc", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:plan_desc: ", p), err) } + if err := p.PlanDesc.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PlanDesc), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:plan_desc: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:comment: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var planDescVal string + if p.PlanDesc == nil { + planDescVal = "" + } else { + planDescVal = fmt.Sprintf("%v", p.PlanDesc) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ExecutionResponse({ErrorCode:%s LatencyInUs:%s Data:%s SpaceName:%s ErrorMsg:%s PlanDesc:%s Comment:%s})", errorCodeVal, latencyInUsVal, dataVal, spaceNameVal, errorMsgVal, planDescVal, commentVal) +} + +// Attributes: +// - ErrorCode +// - ErrorMsg +// - SessionID +// - TimeZoneOffsetSeconds +// - TimeZoneName +type AuthResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + ErrorMsg []byte `thrift:"error_msg,2" db:"error_msg" json:"error_msg,omitempty"` + SessionID *int64 `thrift:"session_id,3" db:"session_id" json:"session_id,omitempty"` + TimeZoneOffsetSeconds *int32 `thrift:"time_zone_offset_seconds,4" db:"time_zone_offset_seconds" json:"time_zone_offset_seconds,omitempty"` + TimeZoneName []byte `thrift:"time_zone_name,5" db:"time_zone_name" json:"time_zone_name,omitempty"` +} + +func NewAuthResponse() *AuthResponse { + return &AuthResponse{} +} + + +func (p *AuthResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} +var AuthResponse_ErrorMsg_DEFAULT []byte + +func (p *AuthResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var AuthResponse_SessionID_DEFAULT int64 +func (p *AuthResponse) GetSessionID() int64 { + if !p.IsSetSessionID() { + return AuthResponse_SessionID_DEFAULT + } +return *p.SessionID +} +var AuthResponse_TimeZoneOffsetSeconds_DEFAULT int32 +func (p *AuthResponse) GetTimeZoneOffsetSeconds() int32 { + if !p.IsSetTimeZoneOffsetSeconds() { + return AuthResponse_TimeZoneOffsetSeconds_DEFAULT + } +return *p.TimeZoneOffsetSeconds +} +var AuthResponse_TimeZoneName_DEFAULT []byte + +func (p *AuthResponse) GetTimeZoneName() []byte { + return p.TimeZoneName +} +func (p *AuthResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *AuthResponse) IsSetSessionID() bool { + return p != nil && p.SessionID != nil +} + +func (p *AuthResponse) IsSetTimeZoneOffsetSeconds() bool { + return p != nil && p.TimeZoneOffsetSeconds != nil +} + +func (p *AuthResponse) IsSetTimeZoneName() bool { + return p != nil && p.TimeZoneName != nil +} + +func (p *AuthResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode 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 + } + issetErrorCode = true + 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 + } + 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) + } + if !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *AuthResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *AuthResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *AuthResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SessionID = &v +} + return nil +} + +func (p *AuthResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TimeZoneOffsetSeconds = &v +} + return nil +} + +func (p *AuthResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.TimeZoneName = v +} + return nil +} + +func (p *AuthResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AuthResponse"); 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 *AuthResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *AuthResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session_id: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneOffsetSeconds() { + if err := oprot.WriteFieldBegin("time_zone_offset_seconds", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:time_zone_offset_seconds: ", p), err) } + if err := oprot.WriteI32(int32(*p.TimeZoneOffsetSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_offset_seconds (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:time_zone_offset_seconds: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneName() { + if err := oprot.WriteFieldBegin("time_zone_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:time_zone_name: ", p), err) } + if err := oprot.WriteBinary(p.TimeZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:time_zone_name: ", p), err) } + } + return err +} + +func (p *AuthResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var sessionIDVal string + if p.SessionID == nil { + sessionIDVal = "" + } else { + sessionIDVal = fmt.Sprintf("%v", *p.SessionID) + } + var timeZoneOffsetSecondsVal string + if p.TimeZoneOffsetSeconds == nil { + timeZoneOffsetSecondsVal = "" + } else { + timeZoneOffsetSecondsVal = fmt.Sprintf("%v", *p.TimeZoneOffsetSeconds) + } + timeZoneNameVal := fmt.Sprintf("%v", p.TimeZoneName) + return fmt.Sprintf("AuthResponse({ErrorCode:%s ErrorMsg:%s SessionID:%s TimeZoneOffsetSeconds:%s TimeZoneName:%s})", errorCodeVal, errorMsgVal, sessionIDVal, timeZoneOffsetSecondsVal, timeZoneNameVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/meta/constants.go b/ccore/nebula/internal/thrift/v2_5_1/meta/constants.go new file mode 100644 index 0000000..fbd3c9a --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/meta/constants.go @@ -0,0 +1,29 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var const_lit_vid_type_type_length int16 = 8 + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/meta/meta_service-remote/meta_service-remote.go b/ccore/nebula/internal/thrift/v2_5_1/meta/meta_service-remote/meta_service-remote.go new file mode 100755 index 0000000..23e540b --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/meta/meta_service-remote/meta_service-remote.go @@ -0,0 +1,2412 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResp createSpace(CreateSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSpace(DropSpaceReq req)") + fmt.Fprintln(os.Stderr, " GetSpaceResp getSpace(GetSpaceReq req)") + fmt.Fprintln(os.Stderr, " ListSpacesResp listSpaces(ListSpacesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTag(CreateTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterTag(AlterTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTag(DropTagReq req)") + fmt.Fprintln(os.Stderr, " GetTagResp getTag(GetTagReq req)") + fmt.Fprintln(os.Stderr, " ListTagsResp listTags(ListTagsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdge(CreateEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterEdge(AlterEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdge(DropEdgeReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeResp getEdge(GetEdgeReq req)") + fmt.Fprintln(os.Stderr, " ListEdgesResp listEdges(ListEdgesReq req)") + fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") + fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") + fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp multiPut(MultiPutReq req)") + fmt.Fprintln(os.Stderr, " GetResp get(GetReq req)") + fmt.Fprintln(os.Stderr, " MultiGetResp multiGet(MultiGetReq req)") + fmt.Fprintln(os.Stderr, " ExecResp remove(RemoveReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeRange(RemoveRangeReq req)") + fmt.Fprintln(os.Stderr, " ScanResp scan(ScanReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTagIndex(CreateTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTagIndex(DropTagIndexReq req)") + fmt.Fprintln(os.Stderr, " GetTagIndexResp getTagIndex(GetTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ListTagIndexesResp listTagIndexes(ListTagIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildTagIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listTagIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdgeIndex(CreateEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdgeIndex(DropEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeIndexResp getEdgeIndex(GetEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ListEdgeIndexesResp listEdgeIndexes(ListEdgeIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildEdgeIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listEdgeIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createUser(CreateUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropUser(DropUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterUser(AlterUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp grantRole(GrantRoleReq req)") + fmt.Fprintln(os.Stderr, " ExecResp revokeRole(RevokeRoleReq req)") + fmt.Fprintln(os.Stderr, " ListUsersResp listUsers(ListUsersReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp listRoles(ListRolesReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp getUserRoles(GetUserRolesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp changePassword(ChangePasswordReq req)") + fmt.Fprintln(os.Stderr, " HBResp heartBeat(HBReq req)") + fmt.Fprintln(os.Stderr, " BalanceResp balance(BalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp leaderBalance(LeaderBalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp regConfig(RegConfigReq req)") + fmt.Fprintln(os.Stderr, " GetConfigResp getConfig(GetConfigReq req)") + fmt.Fprintln(os.Stderr, " ExecResp setConfig(SetConfigReq req)") + fmt.Fprintln(os.Stderr, " ListConfigsResp listConfigs(ListConfigsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createSnapshot(CreateSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSnapshot(DropSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ListSnapshotsResp listSnapshots(ListSnapshotsReq req)") + fmt.Fprintln(os.Stderr, " AdminJobResp runAdminJob(AdminJobReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZone(AddZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostIntoZone(AddHostIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHostFromZone(DropHostFromZoneReq req)") + fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") + fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addGroup(AddGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropGroup(DropGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZoneIntoGroup(AddZoneIntoGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZoneFromGroup(DropZoneFromGroupReq req)") + fmt.Fprintln(os.Stderr, " GetGroupResp getGroup(GetGroupReq req)") + fmt.Fprintln(os.Stderr, " ListGroupsResp listGroups(ListGroupsReq req)") + fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp restoreMeta(RestoreMetaReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addListener(AddListenerReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeListener(RemoveListenerReq req)") + fmt.Fprintln(os.Stderr, " ListListenerResp listListener(ListListenerReq req)") + fmt.Fprintln(os.Stderr, " GetStatisResp getStatis(GetStatisReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signInFTService(SignInFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signOutFTService(SignOutFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ListFTClientsResp listFTClients(ListFTClientsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createFTIndex(CreateFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropFTIndex(DropFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ListFTIndexesResp listFTIndexes(ListFTIndexesReq req)") + fmt.Fprintln(os.Stderr, " CreateSessionResp createSession(CreateSessionReq req)") + fmt.Fprintln(os.Stderr, " UpdateSessionsResp updateSessions(UpdateSessionsReq req)") + fmt.Fprintln(os.Stderr, " ListSessionsResp listSessions(ListSessionsReq req)") + fmt.Fprintln(os.Stderr, " GetSessionResp getSession(GetSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeSession(RemoveSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp killQuery(KillQueryReq req)") + fmt.Fprintln(os.Stderr, " ExecResp reportTaskFinish(ReportTaskReq req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listCluster(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr, " GetMetaDirInfoResp getMetaDirInfo(GetMetaDirInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := meta.NewMetaServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "createSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") + flag.Usage() + } + arg99 := flag.Arg(1) + mbTrans100 := thrift.NewMemoryBufferLen(len(arg99)) + defer mbTrans100.Close() + _, err101 := mbTrans100.WriteString(arg99) + if err101 != nil { + Usage() + return + } + factory102 := thrift.NewSimpleJSONProtocolFactory() + jsProt103 := factory102.GetProtocol(mbTrans100) + argvalue0 := meta.NewCreateSpaceReq() + err104 := argvalue0.Read(jsProt103) + if err104 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpace(value0)) + fmt.Print("\n") + break + case "dropSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") + flag.Usage() + } + arg105 := flag.Arg(1) + mbTrans106 := thrift.NewMemoryBufferLen(len(arg105)) + defer mbTrans106.Close() + _, err107 := mbTrans106.WriteString(arg105) + if err107 != nil { + Usage() + return + } + factory108 := thrift.NewSimpleJSONProtocolFactory() + jsProt109 := factory108.GetProtocol(mbTrans106) + argvalue0 := meta.NewDropSpaceReq() + err110 := argvalue0.Read(jsProt109) + if err110 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSpace(value0)) + fmt.Print("\n") + break + case "getSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") + flag.Usage() + } + arg111 := flag.Arg(1) + mbTrans112 := thrift.NewMemoryBufferLen(len(arg111)) + defer mbTrans112.Close() + _, err113 := mbTrans112.WriteString(arg111) + if err113 != nil { + Usage() + return + } + factory114 := thrift.NewSimpleJSONProtocolFactory() + jsProt115 := factory114.GetProtocol(mbTrans112) + argvalue0 := meta.NewGetSpaceReq() + err116 := argvalue0.Read(jsProt115) + if err116 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSpace(value0)) + fmt.Print("\n") + break + case "listSpaces": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") + flag.Usage() + } + arg117 := flag.Arg(1) + mbTrans118 := thrift.NewMemoryBufferLen(len(arg117)) + defer mbTrans118.Close() + _, err119 := mbTrans118.WriteString(arg117) + if err119 != nil { + Usage() + return + } + factory120 := thrift.NewSimpleJSONProtocolFactory() + jsProt121 := factory120.GetProtocol(mbTrans118) + argvalue0 := meta.NewListSpacesReq() + err122 := argvalue0.Read(jsProt121) + if err122 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSpaces(value0)) + fmt.Print("\n") + break + case "createTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") + flag.Usage() + } + arg123 := flag.Arg(1) + mbTrans124 := thrift.NewMemoryBufferLen(len(arg123)) + defer mbTrans124.Close() + _, err125 := mbTrans124.WriteString(arg123) + if err125 != nil { + Usage() + return + } + factory126 := thrift.NewSimpleJSONProtocolFactory() + jsProt127 := factory126.GetProtocol(mbTrans124) + argvalue0 := meta.NewCreateTagReq() + err128 := argvalue0.Read(jsProt127) + if err128 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTag(value0)) + fmt.Print("\n") + break + case "alterTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") + flag.Usage() + } + arg129 := flag.Arg(1) + mbTrans130 := thrift.NewMemoryBufferLen(len(arg129)) + defer mbTrans130.Close() + _, err131 := mbTrans130.WriteString(arg129) + if err131 != nil { + Usage() + return + } + factory132 := thrift.NewSimpleJSONProtocolFactory() + jsProt133 := factory132.GetProtocol(mbTrans130) + argvalue0 := meta.NewAlterTagReq() + err134 := argvalue0.Read(jsProt133) + if err134 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterTag(value0)) + fmt.Print("\n") + break + case "dropTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTag requires 1 args") + flag.Usage() + } + arg135 := flag.Arg(1) + mbTrans136 := thrift.NewMemoryBufferLen(len(arg135)) + defer mbTrans136.Close() + _, err137 := mbTrans136.WriteString(arg135) + if err137 != nil { + Usage() + return + } + factory138 := thrift.NewSimpleJSONProtocolFactory() + jsProt139 := factory138.GetProtocol(mbTrans136) + argvalue0 := meta.NewDropTagReq() + err140 := argvalue0.Read(jsProt139) + if err140 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTag(value0)) + fmt.Print("\n") + break + case "getTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTag requires 1 args") + flag.Usage() + } + arg141 := flag.Arg(1) + mbTrans142 := thrift.NewMemoryBufferLen(len(arg141)) + defer mbTrans142.Close() + _, err143 := mbTrans142.WriteString(arg141) + if err143 != nil { + Usage() + return + } + factory144 := thrift.NewSimpleJSONProtocolFactory() + jsProt145 := factory144.GetProtocol(mbTrans142) + argvalue0 := meta.NewGetTagReq() + err146 := argvalue0.Read(jsProt145) + if err146 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTag(value0)) + fmt.Print("\n") + break + case "listTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTags requires 1 args") + flag.Usage() + } + arg147 := flag.Arg(1) + mbTrans148 := thrift.NewMemoryBufferLen(len(arg147)) + defer mbTrans148.Close() + _, err149 := mbTrans148.WriteString(arg147) + if err149 != nil { + Usage() + return + } + factory150 := thrift.NewSimpleJSONProtocolFactory() + jsProt151 := factory150.GetProtocol(mbTrans148) + argvalue0 := meta.NewListTagsReq() + err152 := argvalue0.Read(jsProt151) + if err152 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTags(value0)) + fmt.Print("\n") + break + case "createEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") + flag.Usage() + } + arg153 := flag.Arg(1) + mbTrans154 := thrift.NewMemoryBufferLen(len(arg153)) + defer mbTrans154.Close() + _, err155 := mbTrans154.WriteString(arg153) + if err155 != nil { + Usage() + return + } + factory156 := thrift.NewSimpleJSONProtocolFactory() + jsProt157 := factory156.GetProtocol(mbTrans154) + argvalue0 := meta.NewCreateEdgeReq() + err158 := argvalue0.Read(jsProt157) + if err158 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdge(value0)) + fmt.Print("\n") + break + case "alterEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") + flag.Usage() + } + arg159 := flag.Arg(1) + mbTrans160 := thrift.NewMemoryBufferLen(len(arg159)) + defer mbTrans160.Close() + _, err161 := mbTrans160.WriteString(arg159) + if err161 != nil { + Usage() + return + } + factory162 := thrift.NewSimpleJSONProtocolFactory() + jsProt163 := factory162.GetProtocol(mbTrans160) + argvalue0 := meta.NewAlterEdgeReq() + err164 := argvalue0.Read(jsProt163) + if err164 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterEdge(value0)) + fmt.Print("\n") + break + case "dropEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") + flag.Usage() + } + arg165 := flag.Arg(1) + mbTrans166 := thrift.NewMemoryBufferLen(len(arg165)) + defer mbTrans166.Close() + _, err167 := mbTrans166.WriteString(arg165) + if err167 != nil { + Usage() + return + } + factory168 := thrift.NewSimpleJSONProtocolFactory() + jsProt169 := factory168.GetProtocol(mbTrans166) + argvalue0 := meta.NewDropEdgeReq() + err170 := argvalue0.Read(jsProt169) + if err170 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdge(value0)) + fmt.Print("\n") + break + case "getEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") + flag.Usage() + } + arg171 := flag.Arg(1) + mbTrans172 := thrift.NewMemoryBufferLen(len(arg171)) + defer mbTrans172.Close() + _, err173 := mbTrans172.WriteString(arg171) + if err173 != nil { + Usage() + return + } + factory174 := thrift.NewSimpleJSONProtocolFactory() + jsProt175 := factory174.GetProtocol(mbTrans172) + argvalue0 := meta.NewGetEdgeReq() + err176 := argvalue0.Read(jsProt175) + if err176 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdge(value0)) + fmt.Print("\n") + break + case "listEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") + flag.Usage() + } + arg177 := flag.Arg(1) + mbTrans178 := thrift.NewMemoryBufferLen(len(arg177)) + defer mbTrans178.Close() + _, err179 := mbTrans178.WriteString(arg177) + if err179 != nil { + Usage() + return + } + factory180 := thrift.NewSimpleJSONProtocolFactory() + jsProt181 := factory180.GetProtocol(mbTrans178) + argvalue0 := meta.NewListEdgesReq() + err182 := argvalue0.Read(jsProt181) + if err182 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdges(value0)) + fmt.Print("\n") + break + case "listHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") + flag.Usage() + } + arg183 := flag.Arg(1) + mbTrans184 := thrift.NewMemoryBufferLen(len(arg183)) + defer mbTrans184.Close() + _, err185 := mbTrans184.WriteString(arg183) + if err185 != nil { + Usage() + return + } + factory186 := thrift.NewSimpleJSONProtocolFactory() + jsProt187 := factory186.GetProtocol(mbTrans184) + argvalue0 := meta.NewListHostsReq() + err188 := argvalue0.Read(jsProt187) + if err188 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListHosts(value0)) + fmt.Print("\n") + break + case "getPartsAlloc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") + flag.Usage() + } + arg189 := flag.Arg(1) + mbTrans190 := thrift.NewMemoryBufferLen(len(arg189)) + defer mbTrans190.Close() + _, err191 := mbTrans190.WriteString(arg189) + if err191 != nil { + Usage() + return + } + factory192 := thrift.NewSimpleJSONProtocolFactory() + jsProt193 := factory192.GetProtocol(mbTrans190) + argvalue0 := meta.NewGetPartsAllocReq() + err194 := argvalue0.Read(jsProt193) + if err194 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPartsAlloc(value0)) + fmt.Print("\n") + break + case "listParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListParts requires 1 args") + flag.Usage() + } + arg195 := flag.Arg(1) + mbTrans196 := thrift.NewMemoryBufferLen(len(arg195)) + defer mbTrans196.Close() + _, err197 := mbTrans196.WriteString(arg195) + if err197 != nil { + Usage() + return + } + factory198 := thrift.NewSimpleJSONProtocolFactory() + jsProt199 := factory198.GetProtocol(mbTrans196) + argvalue0 := meta.NewListPartsReq() + err200 := argvalue0.Read(jsProt199) + if err200 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListParts(value0)) + fmt.Print("\n") + break + case "multiPut": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") + flag.Usage() + } + arg201 := flag.Arg(1) + mbTrans202 := thrift.NewMemoryBufferLen(len(arg201)) + defer mbTrans202.Close() + _, err203 := mbTrans202.WriteString(arg201) + if err203 != nil { + Usage() + return + } + factory204 := thrift.NewSimpleJSONProtocolFactory() + jsProt205 := factory204.GetProtocol(mbTrans202) + argvalue0 := meta.NewMultiPutReq() + err206 := argvalue0.Read(jsProt205) + if err206 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiPut(value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg207 := flag.Arg(1) + mbTrans208 := thrift.NewMemoryBufferLen(len(arg207)) + defer mbTrans208.Close() + _, err209 := mbTrans208.WriteString(arg207) + if err209 != nil { + Usage() + return + } + factory210 := thrift.NewSimpleJSONProtocolFactory() + jsProt211 := factory210.GetProtocol(mbTrans208) + argvalue0 := meta.NewGetReq() + err212 := argvalue0.Read(jsProt211) + if err212 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "multiGet": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") + flag.Usage() + } + arg213 := flag.Arg(1) + mbTrans214 := thrift.NewMemoryBufferLen(len(arg213)) + defer mbTrans214.Close() + _, err215 := mbTrans214.WriteString(arg213) + if err215 != nil { + Usage() + return + } + factory216 := thrift.NewSimpleJSONProtocolFactory() + jsProt217 := factory216.GetProtocol(mbTrans214) + argvalue0 := meta.NewMultiGetReq() + err218 := argvalue0.Read(jsProt217) + if err218 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiGet(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg219 := flag.Arg(1) + mbTrans220 := thrift.NewMemoryBufferLen(len(arg219)) + defer mbTrans220.Close() + _, err221 := mbTrans220.WriteString(arg219) + if err221 != nil { + Usage() + return + } + factory222 := thrift.NewSimpleJSONProtocolFactory() + jsProt223 := factory222.GetProtocol(mbTrans220) + argvalue0 := meta.NewRemoveReq() + err224 := argvalue0.Read(jsProt223) + if err224 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "removeRange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveRange requires 1 args") + flag.Usage() + } + arg225 := flag.Arg(1) + mbTrans226 := thrift.NewMemoryBufferLen(len(arg225)) + defer mbTrans226.Close() + _, err227 := mbTrans226.WriteString(arg225) + if err227 != nil { + Usage() + return + } + factory228 := thrift.NewSimpleJSONProtocolFactory() + jsProt229 := factory228.GetProtocol(mbTrans226) + argvalue0 := meta.NewRemoveRangeReq() + err230 := argvalue0.Read(jsProt229) + if err230 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveRange(value0)) + fmt.Print("\n") + break + case "scan": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Scan requires 1 args") + flag.Usage() + } + arg231 := flag.Arg(1) + mbTrans232 := thrift.NewMemoryBufferLen(len(arg231)) + defer mbTrans232.Close() + _, err233 := mbTrans232.WriteString(arg231) + if err233 != nil { + Usage() + return + } + factory234 := thrift.NewSimpleJSONProtocolFactory() + jsProt235 := factory234.GetProtocol(mbTrans232) + argvalue0 := meta.NewScanReq() + err236 := argvalue0.Read(jsProt235) + if err236 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Scan(value0)) + fmt.Print("\n") + break + case "createTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") + flag.Usage() + } + arg237 := flag.Arg(1) + mbTrans238 := thrift.NewMemoryBufferLen(len(arg237)) + defer mbTrans238.Close() + _, err239 := mbTrans238.WriteString(arg237) + if err239 != nil { + Usage() + return + } + factory240 := thrift.NewSimpleJSONProtocolFactory() + jsProt241 := factory240.GetProtocol(mbTrans238) + argvalue0 := meta.NewCreateTagIndexReq() + err242 := argvalue0.Read(jsProt241) + if err242 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTagIndex(value0)) + fmt.Print("\n") + break + case "dropTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") + flag.Usage() + } + arg243 := flag.Arg(1) + mbTrans244 := thrift.NewMemoryBufferLen(len(arg243)) + defer mbTrans244.Close() + _, err245 := mbTrans244.WriteString(arg243) + if err245 != nil { + Usage() + return + } + factory246 := thrift.NewSimpleJSONProtocolFactory() + jsProt247 := factory246.GetProtocol(mbTrans244) + argvalue0 := meta.NewDropTagIndexReq() + err248 := argvalue0.Read(jsProt247) + if err248 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTagIndex(value0)) + fmt.Print("\n") + break + case "getTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") + flag.Usage() + } + arg249 := flag.Arg(1) + mbTrans250 := thrift.NewMemoryBufferLen(len(arg249)) + defer mbTrans250.Close() + _, err251 := mbTrans250.WriteString(arg249) + if err251 != nil { + Usage() + return + } + factory252 := thrift.NewSimpleJSONProtocolFactory() + jsProt253 := factory252.GetProtocol(mbTrans250) + argvalue0 := meta.NewGetTagIndexReq() + err254 := argvalue0.Read(jsProt253) + if err254 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") + flag.Usage() + } + arg255 := flag.Arg(1) + mbTrans256 := thrift.NewMemoryBufferLen(len(arg255)) + defer mbTrans256.Close() + _, err257 := mbTrans256.WriteString(arg255) + if err257 != nil { + Usage() + return + } + factory258 := thrift.NewSimpleJSONProtocolFactory() + jsProt259 := factory258.GetProtocol(mbTrans256) + argvalue0 := meta.NewListTagIndexesReq() + err260 := argvalue0.Read(jsProt259) + if err260 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexes(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg261 := flag.Arg(1) + mbTrans262 := thrift.NewMemoryBufferLen(len(arg261)) + defer mbTrans262.Close() + _, err263 := mbTrans262.WriteString(arg261) + if err263 != nil { + Usage() + return + } + factory264 := thrift.NewSimpleJSONProtocolFactory() + jsProt265 := factory264.GetProtocol(mbTrans262) + argvalue0 := meta.NewRebuildIndexReq() + err266 := argvalue0.Read(jsProt265) + if err266 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") + flag.Usage() + } + arg267 := flag.Arg(1) + mbTrans268 := thrift.NewMemoryBufferLen(len(arg267)) + defer mbTrans268.Close() + _, err269 := mbTrans268.WriteString(arg267) + if err269 != nil { + Usage() + return + } + factory270 := thrift.NewSimpleJSONProtocolFactory() + jsProt271 := factory270.GetProtocol(mbTrans268) + argvalue0 := meta.NewListIndexStatusReq() + err272 := argvalue0.Read(jsProt271) + if err272 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexStatus(value0)) + fmt.Print("\n") + break + case "createEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") + flag.Usage() + } + arg273 := flag.Arg(1) + mbTrans274 := thrift.NewMemoryBufferLen(len(arg273)) + defer mbTrans274.Close() + _, err275 := mbTrans274.WriteString(arg273) + if err275 != nil { + Usage() + return + } + factory276 := thrift.NewSimpleJSONProtocolFactory() + jsProt277 := factory276.GetProtocol(mbTrans274) + argvalue0 := meta.NewCreateEdgeIndexReq() + err278 := argvalue0.Read(jsProt277) + if err278 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdgeIndex(value0)) + fmt.Print("\n") + break + case "dropEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") + flag.Usage() + } + arg279 := flag.Arg(1) + mbTrans280 := thrift.NewMemoryBufferLen(len(arg279)) + defer mbTrans280.Close() + _, err281 := mbTrans280.WriteString(arg279) + if err281 != nil { + Usage() + return + } + factory282 := thrift.NewSimpleJSONProtocolFactory() + jsProt283 := factory282.GetProtocol(mbTrans280) + argvalue0 := meta.NewDropEdgeIndexReq() + err284 := argvalue0.Read(jsProt283) + if err284 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdgeIndex(value0)) + fmt.Print("\n") + break + case "getEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") + flag.Usage() + } + arg285 := flag.Arg(1) + mbTrans286 := thrift.NewMemoryBufferLen(len(arg285)) + defer mbTrans286.Close() + _, err287 := mbTrans286.WriteString(arg285) + if err287 != nil { + Usage() + return + } + factory288 := thrift.NewSimpleJSONProtocolFactory() + jsProt289 := factory288.GetProtocol(mbTrans286) + argvalue0 := meta.NewGetEdgeIndexReq() + err290 := argvalue0.Read(jsProt289) + if err290 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") + flag.Usage() + } + arg291 := flag.Arg(1) + mbTrans292 := thrift.NewMemoryBufferLen(len(arg291)) + defer mbTrans292.Close() + _, err293 := mbTrans292.WriteString(arg291) + if err293 != nil { + Usage() + return + } + factory294 := thrift.NewSimpleJSONProtocolFactory() + jsProt295 := factory294.GetProtocol(mbTrans292) + argvalue0 := meta.NewListEdgeIndexesReq() + err296 := argvalue0.Read(jsProt295) + if err296 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexes(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg297 := flag.Arg(1) + mbTrans298 := thrift.NewMemoryBufferLen(len(arg297)) + defer mbTrans298.Close() + _, err299 := mbTrans298.WriteString(arg297) + if err299 != nil { + Usage() + return + } + factory300 := thrift.NewSimpleJSONProtocolFactory() + jsProt301 := factory300.GetProtocol(mbTrans298) + argvalue0 := meta.NewRebuildIndexReq() + err302 := argvalue0.Read(jsProt301) + if err302 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") + flag.Usage() + } + arg303 := flag.Arg(1) + mbTrans304 := thrift.NewMemoryBufferLen(len(arg303)) + defer mbTrans304.Close() + _, err305 := mbTrans304.WriteString(arg303) + if err305 != nil { + Usage() + return + } + factory306 := thrift.NewSimpleJSONProtocolFactory() + jsProt307 := factory306.GetProtocol(mbTrans304) + argvalue0 := meta.NewListIndexStatusReq() + err308 := argvalue0.Read(jsProt307) + if err308 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexStatus(value0)) + fmt.Print("\n") + break + case "createUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") + flag.Usage() + } + arg309 := flag.Arg(1) + mbTrans310 := thrift.NewMemoryBufferLen(len(arg309)) + defer mbTrans310.Close() + _, err311 := mbTrans310.WriteString(arg309) + if err311 != nil { + Usage() + return + } + factory312 := thrift.NewSimpleJSONProtocolFactory() + jsProt313 := factory312.GetProtocol(mbTrans310) + argvalue0 := meta.NewCreateUserReq() + err314 := argvalue0.Read(jsProt313) + if err314 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateUser(value0)) + fmt.Print("\n") + break + case "dropUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropUser requires 1 args") + flag.Usage() + } + arg315 := flag.Arg(1) + mbTrans316 := thrift.NewMemoryBufferLen(len(arg315)) + defer mbTrans316.Close() + _, err317 := mbTrans316.WriteString(arg315) + if err317 != nil { + Usage() + return + } + factory318 := thrift.NewSimpleJSONProtocolFactory() + jsProt319 := factory318.GetProtocol(mbTrans316) + argvalue0 := meta.NewDropUserReq() + err320 := argvalue0.Read(jsProt319) + if err320 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropUser(value0)) + fmt.Print("\n") + break + case "alterUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") + flag.Usage() + } + arg321 := flag.Arg(1) + mbTrans322 := thrift.NewMemoryBufferLen(len(arg321)) + defer mbTrans322.Close() + _, err323 := mbTrans322.WriteString(arg321) + if err323 != nil { + Usage() + return + } + factory324 := thrift.NewSimpleJSONProtocolFactory() + jsProt325 := factory324.GetProtocol(mbTrans322) + argvalue0 := meta.NewAlterUserReq() + err326 := argvalue0.Read(jsProt325) + if err326 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterUser(value0)) + fmt.Print("\n") + break + case "grantRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") + flag.Usage() + } + arg327 := flag.Arg(1) + mbTrans328 := thrift.NewMemoryBufferLen(len(arg327)) + defer mbTrans328.Close() + _, err329 := mbTrans328.WriteString(arg327) + if err329 != nil { + Usage() + return + } + factory330 := thrift.NewSimpleJSONProtocolFactory() + jsProt331 := factory330.GetProtocol(mbTrans328) + argvalue0 := meta.NewGrantRoleReq() + err332 := argvalue0.Read(jsProt331) + if err332 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GrantRole(value0)) + fmt.Print("\n") + break + case "revokeRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") + flag.Usage() + } + arg333 := flag.Arg(1) + mbTrans334 := thrift.NewMemoryBufferLen(len(arg333)) + defer mbTrans334.Close() + _, err335 := mbTrans334.WriteString(arg333) + if err335 != nil { + Usage() + return + } + factory336 := thrift.NewSimpleJSONProtocolFactory() + jsProt337 := factory336.GetProtocol(mbTrans334) + argvalue0 := meta.NewRevokeRoleReq() + err338 := argvalue0.Read(jsProt337) + if err338 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RevokeRole(value0)) + fmt.Print("\n") + break + case "listUsers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") + flag.Usage() + } + arg339 := flag.Arg(1) + mbTrans340 := thrift.NewMemoryBufferLen(len(arg339)) + defer mbTrans340.Close() + _, err341 := mbTrans340.WriteString(arg339) + if err341 != nil { + Usage() + return + } + factory342 := thrift.NewSimpleJSONProtocolFactory() + jsProt343 := factory342.GetProtocol(mbTrans340) + argvalue0 := meta.NewListUsersReq() + err344 := argvalue0.Read(jsProt343) + if err344 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListUsers(value0)) + fmt.Print("\n") + break + case "listRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") + flag.Usage() + } + arg345 := flag.Arg(1) + mbTrans346 := thrift.NewMemoryBufferLen(len(arg345)) + defer mbTrans346.Close() + _, err347 := mbTrans346.WriteString(arg345) + if err347 != nil { + Usage() + return + } + factory348 := thrift.NewSimpleJSONProtocolFactory() + jsProt349 := factory348.GetProtocol(mbTrans346) + argvalue0 := meta.NewListRolesReq() + err350 := argvalue0.Read(jsProt349) + if err350 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListRoles(value0)) + fmt.Print("\n") + break + case "getUserRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") + flag.Usage() + } + arg351 := flag.Arg(1) + mbTrans352 := thrift.NewMemoryBufferLen(len(arg351)) + defer mbTrans352.Close() + _, err353 := mbTrans352.WriteString(arg351) + if err353 != nil { + Usage() + return + } + factory354 := thrift.NewSimpleJSONProtocolFactory() + jsProt355 := factory354.GetProtocol(mbTrans352) + argvalue0 := meta.NewGetUserRolesReq() + err356 := argvalue0.Read(jsProt355) + if err356 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUserRoles(value0)) + fmt.Print("\n") + break + case "changePassword": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") + flag.Usage() + } + arg357 := flag.Arg(1) + mbTrans358 := thrift.NewMemoryBufferLen(len(arg357)) + defer mbTrans358.Close() + _, err359 := mbTrans358.WriteString(arg357) + if err359 != nil { + Usage() + return + } + factory360 := thrift.NewSimpleJSONProtocolFactory() + jsProt361 := factory360.GetProtocol(mbTrans358) + argvalue0 := meta.NewChangePasswordReq() + err362 := argvalue0.Read(jsProt361) + if err362 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChangePassword(value0)) + fmt.Print("\n") + break + case "heartBeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") + flag.Usage() + } + arg363 := flag.Arg(1) + mbTrans364 := thrift.NewMemoryBufferLen(len(arg363)) + defer mbTrans364.Close() + _, err365 := mbTrans364.WriteString(arg363) + if err365 != nil { + Usage() + return + } + factory366 := thrift.NewSimpleJSONProtocolFactory() + jsProt367 := factory366.GetProtocol(mbTrans364) + argvalue0 := meta.NewHBReq() + err368 := argvalue0.Read(jsProt367) + if err368 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.HeartBeat(value0)) + fmt.Print("\n") + break + case "balance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Balance requires 1 args") + flag.Usage() + } + arg369 := flag.Arg(1) + mbTrans370 := thrift.NewMemoryBufferLen(len(arg369)) + defer mbTrans370.Close() + _, err371 := mbTrans370.WriteString(arg369) + if err371 != nil { + Usage() + return + } + factory372 := thrift.NewSimpleJSONProtocolFactory() + jsProt373 := factory372.GetProtocol(mbTrans370) + argvalue0 := meta.NewBalanceReq() + err374 := argvalue0.Read(jsProt373) + if err374 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Balance(value0)) + fmt.Print("\n") + break + case "leaderBalance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LeaderBalance requires 1 args") + flag.Usage() + } + arg375 := flag.Arg(1) + mbTrans376 := thrift.NewMemoryBufferLen(len(arg375)) + defer mbTrans376.Close() + _, err377 := mbTrans376.WriteString(arg375) + if err377 != nil { + Usage() + return + } + factory378 := thrift.NewSimpleJSONProtocolFactory() + jsProt379 := factory378.GetProtocol(mbTrans376) + argvalue0 := meta.NewLeaderBalanceReq() + err380 := argvalue0.Read(jsProt379) + if err380 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LeaderBalance(value0)) + fmt.Print("\n") + break + case "regConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") + flag.Usage() + } + arg381 := flag.Arg(1) + mbTrans382 := thrift.NewMemoryBufferLen(len(arg381)) + defer mbTrans382.Close() + _, err383 := mbTrans382.WriteString(arg381) + if err383 != nil { + Usage() + return + } + factory384 := thrift.NewSimpleJSONProtocolFactory() + jsProt385 := factory384.GetProtocol(mbTrans382) + argvalue0 := meta.NewRegConfigReq() + err386 := argvalue0.Read(jsProt385) + if err386 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RegConfig(value0)) + fmt.Print("\n") + break + case "getConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") + flag.Usage() + } + arg387 := flag.Arg(1) + mbTrans388 := thrift.NewMemoryBufferLen(len(arg387)) + defer mbTrans388.Close() + _, err389 := mbTrans388.WriteString(arg387) + if err389 != nil { + Usage() + return + } + factory390 := thrift.NewSimpleJSONProtocolFactory() + jsProt391 := factory390.GetProtocol(mbTrans388) + argvalue0 := meta.NewGetConfigReq() + err392 := argvalue0.Read(jsProt391) + if err392 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetConfig(value0)) + fmt.Print("\n") + break + case "setConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") + flag.Usage() + } + arg393 := flag.Arg(1) + mbTrans394 := thrift.NewMemoryBufferLen(len(arg393)) + defer mbTrans394.Close() + _, err395 := mbTrans394.WriteString(arg393) + if err395 != nil { + Usage() + return + } + factory396 := thrift.NewSimpleJSONProtocolFactory() + jsProt397 := factory396.GetProtocol(mbTrans394) + argvalue0 := meta.NewSetConfigReq() + err398 := argvalue0.Read(jsProt397) + if err398 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetConfig(value0)) + fmt.Print("\n") + break + case "listConfigs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") + flag.Usage() + } + arg399 := flag.Arg(1) + mbTrans400 := thrift.NewMemoryBufferLen(len(arg399)) + defer mbTrans400.Close() + _, err401 := mbTrans400.WriteString(arg399) + if err401 != nil { + Usage() + return + } + factory402 := thrift.NewSimpleJSONProtocolFactory() + jsProt403 := factory402.GetProtocol(mbTrans400) + argvalue0 := meta.NewListConfigsReq() + err404 := argvalue0.Read(jsProt403) + if err404 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListConfigs(value0)) + fmt.Print("\n") + break + case "createSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") + flag.Usage() + } + arg405 := flag.Arg(1) + mbTrans406 := thrift.NewMemoryBufferLen(len(arg405)) + defer mbTrans406.Close() + _, err407 := mbTrans406.WriteString(arg405) + if err407 != nil { + Usage() + return + } + factory408 := thrift.NewSimpleJSONProtocolFactory() + jsProt409 := factory408.GetProtocol(mbTrans406) + argvalue0 := meta.NewCreateSnapshotReq() + err410 := argvalue0.Read(jsProt409) + if err410 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSnapshot(value0)) + fmt.Print("\n") + break + case "dropSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") + flag.Usage() + } + arg411 := flag.Arg(1) + mbTrans412 := thrift.NewMemoryBufferLen(len(arg411)) + defer mbTrans412.Close() + _, err413 := mbTrans412.WriteString(arg411) + if err413 != nil { + Usage() + return + } + factory414 := thrift.NewSimpleJSONProtocolFactory() + jsProt415 := factory414.GetProtocol(mbTrans412) + argvalue0 := meta.NewDropSnapshotReq() + err416 := argvalue0.Read(jsProt415) + if err416 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSnapshot(value0)) + fmt.Print("\n") + break + case "listSnapshots": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") + flag.Usage() + } + arg417 := flag.Arg(1) + mbTrans418 := thrift.NewMemoryBufferLen(len(arg417)) + defer mbTrans418.Close() + _, err419 := mbTrans418.WriteString(arg417) + if err419 != nil { + Usage() + return + } + factory420 := thrift.NewSimpleJSONProtocolFactory() + jsProt421 := factory420.GetProtocol(mbTrans418) + argvalue0 := meta.NewListSnapshotsReq() + err422 := argvalue0.Read(jsProt421) + if err422 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSnapshots(value0)) + fmt.Print("\n") + break + case "runAdminJob": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") + flag.Usage() + } + arg423 := flag.Arg(1) + mbTrans424 := thrift.NewMemoryBufferLen(len(arg423)) + defer mbTrans424.Close() + _, err425 := mbTrans424.WriteString(arg423) + if err425 != nil { + Usage() + return + } + factory426 := thrift.NewSimpleJSONProtocolFactory() + jsProt427 := factory426.GetProtocol(mbTrans424) + argvalue0 := meta.NewAdminJobReq() + err428 := argvalue0.Read(jsProt427) + if err428 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RunAdminJob(value0)) + fmt.Print("\n") + break + case "addZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZone requires 1 args") + flag.Usage() + } + arg429 := flag.Arg(1) + mbTrans430 := thrift.NewMemoryBufferLen(len(arg429)) + defer mbTrans430.Close() + _, err431 := mbTrans430.WriteString(arg429) + if err431 != nil { + Usage() + return + } + factory432 := thrift.NewSimpleJSONProtocolFactory() + jsProt433 := factory432.GetProtocol(mbTrans430) + argvalue0 := meta.NewAddZoneReq() + err434 := argvalue0.Read(jsProt433) + if err434 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZone(value0)) + fmt.Print("\n") + break + case "dropZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZone requires 1 args") + flag.Usage() + } + arg435 := flag.Arg(1) + mbTrans436 := thrift.NewMemoryBufferLen(len(arg435)) + defer mbTrans436.Close() + _, err437 := mbTrans436.WriteString(arg435) + if err437 != nil { + Usage() + return + } + factory438 := thrift.NewSimpleJSONProtocolFactory() + jsProt439 := factory438.GetProtocol(mbTrans436) + argvalue0 := meta.NewDropZoneReq() + err440 := argvalue0.Read(jsProt439) + if err440 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZone(value0)) + fmt.Print("\n") + break + case "addHostIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostIntoZone requires 1 args") + flag.Usage() + } + arg441 := flag.Arg(1) + mbTrans442 := thrift.NewMemoryBufferLen(len(arg441)) + defer mbTrans442.Close() + _, err443 := mbTrans442.WriteString(arg441) + if err443 != nil { + Usage() + return + } + factory444 := thrift.NewSimpleJSONProtocolFactory() + jsProt445 := factory444.GetProtocol(mbTrans442) + argvalue0 := meta.NewAddHostIntoZoneReq() + err446 := argvalue0.Read(jsProt445) + if err446 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostIntoZone(value0)) + fmt.Print("\n") + break + case "dropHostFromZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHostFromZone requires 1 args") + flag.Usage() + } + arg447 := flag.Arg(1) + mbTrans448 := thrift.NewMemoryBufferLen(len(arg447)) + defer mbTrans448.Close() + _, err449 := mbTrans448.WriteString(arg447) + if err449 != nil { + Usage() + return + } + factory450 := thrift.NewSimpleJSONProtocolFactory() + jsProt451 := factory450.GetProtocol(mbTrans448) + argvalue0 := meta.NewDropHostFromZoneReq() + err452 := argvalue0.Read(jsProt451) + if err452 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHostFromZone(value0)) + fmt.Print("\n") + break + case "getZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetZone requires 1 args") + flag.Usage() + } + arg453 := flag.Arg(1) + mbTrans454 := thrift.NewMemoryBufferLen(len(arg453)) + defer mbTrans454.Close() + _, err455 := mbTrans454.WriteString(arg453) + if err455 != nil { + Usage() + return + } + factory456 := thrift.NewSimpleJSONProtocolFactory() + jsProt457 := factory456.GetProtocol(mbTrans454) + argvalue0 := meta.NewGetZoneReq() + err458 := argvalue0.Read(jsProt457) + if err458 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetZone(value0)) + fmt.Print("\n") + break + case "listZones": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListZones requires 1 args") + flag.Usage() + } + arg459 := flag.Arg(1) + mbTrans460 := thrift.NewMemoryBufferLen(len(arg459)) + defer mbTrans460.Close() + _, err461 := mbTrans460.WriteString(arg459) + if err461 != nil { + Usage() + return + } + factory462 := thrift.NewSimpleJSONProtocolFactory() + jsProt463 := factory462.GetProtocol(mbTrans460) + argvalue0 := meta.NewListZonesReq() + err464 := argvalue0.Read(jsProt463) + if err464 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListZones(value0)) + fmt.Print("\n") + break + case "addGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddGroup requires 1 args") + flag.Usage() + } + arg465 := flag.Arg(1) + mbTrans466 := thrift.NewMemoryBufferLen(len(arg465)) + defer mbTrans466.Close() + _, err467 := mbTrans466.WriteString(arg465) + if err467 != nil { + Usage() + return + } + factory468 := thrift.NewSimpleJSONProtocolFactory() + jsProt469 := factory468.GetProtocol(mbTrans466) + argvalue0 := meta.NewAddGroupReq() + err470 := argvalue0.Read(jsProt469) + if err470 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddGroup(value0)) + fmt.Print("\n") + break + case "dropGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropGroup requires 1 args") + flag.Usage() + } + arg471 := flag.Arg(1) + mbTrans472 := thrift.NewMemoryBufferLen(len(arg471)) + defer mbTrans472.Close() + _, err473 := mbTrans472.WriteString(arg471) + if err473 != nil { + Usage() + return + } + factory474 := thrift.NewSimpleJSONProtocolFactory() + jsProt475 := factory474.GetProtocol(mbTrans472) + argvalue0 := meta.NewDropGroupReq() + err476 := argvalue0.Read(jsProt475) + if err476 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropGroup(value0)) + fmt.Print("\n") + break + case "addZoneIntoGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZoneIntoGroup requires 1 args") + flag.Usage() + } + arg477 := flag.Arg(1) + mbTrans478 := thrift.NewMemoryBufferLen(len(arg477)) + defer mbTrans478.Close() + _, err479 := mbTrans478.WriteString(arg477) + if err479 != nil { + Usage() + return + } + factory480 := thrift.NewSimpleJSONProtocolFactory() + jsProt481 := factory480.GetProtocol(mbTrans478) + argvalue0 := meta.NewAddZoneIntoGroupReq() + err482 := argvalue0.Read(jsProt481) + if err482 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZoneIntoGroup(value0)) + fmt.Print("\n") + break + case "dropZoneFromGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZoneFromGroup requires 1 args") + flag.Usage() + } + arg483 := flag.Arg(1) + mbTrans484 := thrift.NewMemoryBufferLen(len(arg483)) + defer mbTrans484.Close() + _, err485 := mbTrans484.WriteString(arg483) + if err485 != nil { + Usage() + return + } + factory486 := thrift.NewSimpleJSONProtocolFactory() + jsProt487 := factory486.GetProtocol(mbTrans484) + argvalue0 := meta.NewDropZoneFromGroupReq() + err488 := argvalue0.Read(jsProt487) + if err488 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZoneFromGroup(value0)) + fmt.Print("\n") + break + case "getGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetGroup requires 1 args") + flag.Usage() + } + arg489 := flag.Arg(1) + mbTrans490 := thrift.NewMemoryBufferLen(len(arg489)) + defer mbTrans490.Close() + _, err491 := mbTrans490.WriteString(arg489) + if err491 != nil { + Usage() + return + } + factory492 := thrift.NewSimpleJSONProtocolFactory() + jsProt493 := factory492.GetProtocol(mbTrans490) + argvalue0 := meta.NewGetGroupReq() + err494 := argvalue0.Read(jsProt493) + if err494 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetGroup(value0)) + fmt.Print("\n") + break + case "listGroups": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListGroups requires 1 args") + flag.Usage() + } + arg495 := flag.Arg(1) + mbTrans496 := thrift.NewMemoryBufferLen(len(arg495)) + defer mbTrans496.Close() + _, err497 := mbTrans496.WriteString(arg495) + if err497 != nil { + Usage() + return + } + factory498 := thrift.NewSimpleJSONProtocolFactory() + jsProt499 := factory498.GetProtocol(mbTrans496) + argvalue0 := meta.NewListGroupsReq() + err500 := argvalue0.Read(jsProt499) + if err500 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListGroups(value0)) + fmt.Print("\n") + break + case "createBackup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") + flag.Usage() + } + arg501 := flag.Arg(1) + mbTrans502 := thrift.NewMemoryBufferLen(len(arg501)) + defer mbTrans502.Close() + _, err503 := mbTrans502.WriteString(arg501) + if err503 != nil { + Usage() + return + } + factory504 := thrift.NewSimpleJSONProtocolFactory() + jsProt505 := factory504.GetProtocol(mbTrans502) + argvalue0 := meta.NewCreateBackupReq() + err506 := argvalue0.Read(jsProt505) + if err506 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateBackup(value0)) + fmt.Print("\n") + break + case "restoreMeta": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") + flag.Usage() + } + arg507 := flag.Arg(1) + mbTrans508 := thrift.NewMemoryBufferLen(len(arg507)) + defer mbTrans508.Close() + _, err509 := mbTrans508.WriteString(arg507) + if err509 != nil { + Usage() + return + } + factory510 := thrift.NewSimpleJSONProtocolFactory() + jsProt511 := factory510.GetProtocol(mbTrans508) + argvalue0 := meta.NewRestoreMetaReq() + err512 := argvalue0.Read(jsProt511) + if err512 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RestoreMeta(value0)) + fmt.Print("\n") + break + case "addListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddListener requires 1 args") + flag.Usage() + } + arg513 := flag.Arg(1) + mbTrans514 := thrift.NewMemoryBufferLen(len(arg513)) + defer mbTrans514.Close() + _, err515 := mbTrans514.WriteString(arg513) + if err515 != nil { + Usage() + return + } + factory516 := thrift.NewSimpleJSONProtocolFactory() + jsProt517 := factory516.GetProtocol(mbTrans514) + argvalue0 := meta.NewAddListenerReq() + err518 := argvalue0.Read(jsProt517) + if err518 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddListener(value0)) + fmt.Print("\n") + break + case "removeListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") + flag.Usage() + } + arg519 := flag.Arg(1) + mbTrans520 := thrift.NewMemoryBufferLen(len(arg519)) + defer mbTrans520.Close() + _, err521 := mbTrans520.WriteString(arg519) + if err521 != nil { + Usage() + return + } + factory522 := thrift.NewSimpleJSONProtocolFactory() + jsProt523 := factory522.GetProtocol(mbTrans520) + argvalue0 := meta.NewRemoveListenerReq() + err524 := argvalue0.Read(jsProt523) + if err524 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveListener(value0)) + fmt.Print("\n") + break + case "listListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListListener requires 1 args") + flag.Usage() + } + arg525 := flag.Arg(1) + mbTrans526 := thrift.NewMemoryBufferLen(len(arg525)) + defer mbTrans526.Close() + _, err527 := mbTrans526.WriteString(arg525) + if err527 != nil { + Usage() + return + } + factory528 := thrift.NewSimpleJSONProtocolFactory() + jsProt529 := factory528.GetProtocol(mbTrans526) + argvalue0 := meta.NewListListenerReq() + err530 := argvalue0.Read(jsProt529) + if err530 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListListener(value0)) + fmt.Print("\n") + break + case "getStatis": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetStatis requires 1 args") + flag.Usage() + } + arg531 := flag.Arg(1) + mbTrans532 := thrift.NewMemoryBufferLen(len(arg531)) + defer mbTrans532.Close() + _, err533 := mbTrans532.WriteString(arg531) + if err533 != nil { + Usage() + return + } + factory534 := thrift.NewSimpleJSONProtocolFactory() + jsProt535 := factory534.GetProtocol(mbTrans532) + argvalue0 := meta.NewGetStatisReq() + err536 := argvalue0.Read(jsProt535) + if err536 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetStatis(value0)) + fmt.Print("\n") + break + case "signInFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignInFTService requires 1 args") + flag.Usage() + } + arg537 := flag.Arg(1) + mbTrans538 := thrift.NewMemoryBufferLen(len(arg537)) + defer mbTrans538.Close() + _, err539 := mbTrans538.WriteString(arg537) + if err539 != nil { + Usage() + return + } + factory540 := thrift.NewSimpleJSONProtocolFactory() + jsProt541 := factory540.GetProtocol(mbTrans538) + argvalue0 := meta.NewSignInFTServiceReq() + err542 := argvalue0.Read(jsProt541) + if err542 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignInFTService(value0)) + fmt.Print("\n") + break + case "signOutFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignOutFTService requires 1 args") + flag.Usage() + } + arg543 := flag.Arg(1) + mbTrans544 := thrift.NewMemoryBufferLen(len(arg543)) + defer mbTrans544.Close() + _, err545 := mbTrans544.WriteString(arg543) + if err545 != nil { + Usage() + return + } + factory546 := thrift.NewSimpleJSONProtocolFactory() + jsProt547 := factory546.GetProtocol(mbTrans544) + argvalue0 := meta.NewSignOutFTServiceReq() + err548 := argvalue0.Read(jsProt547) + if err548 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignOutFTService(value0)) + fmt.Print("\n") + break + case "listFTClients": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTClients requires 1 args") + flag.Usage() + } + arg549 := flag.Arg(1) + mbTrans550 := thrift.NewMemoryBufferLen(len(arg549)) + defer mbTrans550.Close() + _, err551 := mbTrans550.WriteString(arg549) + if err551 != nil { + Usage() + return + } + factory552 := thrift.NewSimpleJSONProtocolFactory() + jsProt553 := factory552.GetProtocol(mbTrans550) + argvalue0 := meta.NewListFTClientsReq() + err554 := argvalue0.Read(jsProt553) + if err554 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTClients(value0)) + fmt.Print("\n") + break + case "createFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateFTIndex requires 1 args") + flag.Usage() + } + arg555 := flag.Arg(1) + mbTrans556 := thrift.NewMemoryBufferLen(len(arg555)) + defer mbTrans556.Close() + _, err557 := mbTrans556.WriteString(arg555) + if err557 != nil { + Usage() + return + } + factory558 := thrift.NewSimpleJSONProtocolFactory() + jsProt559 := factory558.GetProtocol(mbTrans556) + argvalue0 := meta.NewCreateFTIndexReq() + err560 := argvalue0.Read(jsProt559) + if err560 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateFTIndex(value0)) + fmt.Print("\n") + break + case "dropFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropFTIndex requires 1 args") + flag.Usage() + } + arg561 := flag.Arg(1) + mbTrans562 := thrift.NewMemoryBufferLen(len(arg561)) + defer mbTrans562.Close() + _, err563 := mbTrans562.WriteString(arg561) + if err563 != nil { + Usage() + return + } + factory564 := thrift.NewSimpleJSONProtocolFactory() + jsProt565 := factory564.GetProtocol(mbTrans562) + argvalue0 := meta.NewDropFTIndexReq() + err566 := argvalue0.Read(jsProt565) + if err566 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropFTIndex(value0)) + fmt.Print("\n") + break + case "listFTIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTIndexes requires 1 args") + flag.Usage() + } + arg567 := flag.Arg(1) + mbTrans568 := thrift.NewMemoryBufferLen(len(arg567)) + defer mbTrans568.Close() + _, err569 := mbTrans568.WriteString(arg567) + if err569 != nil { + Usage() + return + } + factory570 := thrift.NewSimpleJSONProtocolFactory() + jsProt571 := factory570.GetProtocol(mbTrans568) + argvalue0 := meta.NewListFTIndexesReq() + err572 := argvalue0.Read(jsProt571) + if err572 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTIndexes(value0)) + fmt.Print("\n") + break + case "createSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") + flag.Usage() + } + arg573 := flag.Arg(1) + mbTrans574 := thrift.NewMemoryBufferLen(len(arg573)) + defer mbTrans574.Close() + _, err575 := mbTrans574.WriteString(arg573) + if err575 != nil { + Usage() + return + } + factory576 := thrift.NewSimpleJSONProtocolFactory() + jsProt577 := factory576.GetProtocol(mbTrans574) + argvalue0 := meta.NewCreateSessionReq() + err578 := argvalue0.Read(jsProt577) + if err578 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSession(value0)) + fmt.Print("\n") + break + case "updateSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") + flag.Usage() + } + arg579 := flag.Arg(1) + mbTrans580 := thrift.NewMemoryBufferLen(len(arg579)) + defer mbTrans580.Close() + _, err581 := mbTrans580.WriteString(arg579) + if err581 != nil { + Usage() + return + } + factory582 := thrift.NewSimpleJSONProtocolFactory() + jsProt583 := factory582.GetProtocol(mbTrans580) + argvalue0 := meta.NewUpdateSessionsReq() + err584 := argvalue0.Read(jsProt583) + if err584 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateSessions(value0)) + fmt.Print("\n") + break + case "listSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") + flag.Usage() + } + arg585 := flag.Arg(1) + mbTrans586 := thrift.NewMemoryBufferLen(len(arg585)) + defer mbTrans586.Close() + _, err587 := mbTrans586.WriteString(arg585) + if err587 != nil { + Usage() + return + } + factory588 := thrift.NewSimpleJSONProtocolFactory() + jsProt589 := factory588.GetProtocol(mbTrans586) + argvalue0 := meta.NewListSessionsReq() + err590 := argvalue0.Read(jsProt589) + if err590 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSessions(value0)) + fmt.Print("\n") + break + case "getSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSession requires 1 args") + flag.Usage() + } + arg591 := flag.Arg(1) + mbTrans592 := thrift.NewMemoryBufferLen(len(arg591)) + defer mbTrans592.Close() + _, err593 := mbTrans592.WriteString(arg591) + if err593 != nil { + Usage() + return + } + factory594 := thrift.NewSimpleJSONProtocolFactory() + jsProt595 := factory594.GetProtocol(mbTrans592) + argvalue0 := meta.NewGetSessionReq() + err596 := argvalue0.Read(jsProt595) + if err596 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSession(value0)) + fmt.Print("\n") + break + case "removeSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") + flag.Usage() + } + arg597 := flag.Arg(1) + mbTrans598 := thrift.NewMemoryBufferLen(len(arg597)) + defer mbTrans598.Close() + _, err599 := mbTrans598.WriteString(arg597) + if err599 != nil { + Usage() + return + } + factory600 := thrift.NewSimpleJSONProtocolFactory() + jsProt601 := factory600.GetProtocol(mbTrans598) + argvalue0 := meta.NewRemoveSessionReq() + err602 := argvalue0.Read(jsProt601) + if err602 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveSession(value0)) + fmt.Print("\n") + break + case "killQuery": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "KillQuery requires 1 args") + flag.Usage() + } + arg603 := flag.Arg(1) + mbTrans604 := thrift.NewMemoryBufferLen(len(arg603)) + defer mbTrans604.Close() + _, err605 := mbTrans604.WriteString(arg603) + if err605 != nil { + Usage() + return + } + factory606 := thrift.NewSimpleJSONProtocolFactory() + jsProt607 := factory606.GetProtocol(mbTrans604) + argvalue0 := meta.NewKillQueryReq() + err608 := argvalue0.Read(jsProt607) + if err608 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.KillQuery(value0)) + fmt.Print("\n") + break + case "reportTaskFinish": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") + flag.Usage() + } + arg609 := flag.Arg(1) + mbTrans610 := thrift.NewMemoryBufferLen(len(arg609)) + defer mbTrans610.Close() + _, err611 := mbTrans610.WriteString(arg609) + if err611 != nil { + Usage() + return + } + factory612 := thrift.NewSimpleJSONProtocolFactory() + jsProt613 := factory612.GetProtocol(mbTrans610) + argvalue0 := meta.NewReportTaskReq() + err614 := argvalue0.Read(jsProt613) + if err614 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ReportTaskFinish(value0)) + fmt.Print("\n") + break + case "listCluster": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListCluster requires 1 args") + flag.Usage() + } + arg615 := flag.Arg(1) + mbTrans616 := thrift.NewMemoryBufferLen(len(arg615)) + defer mbTrans616.Close() + _, err617 := mbTrans616.WriteString(arg615) + if err617 != nil { + Usage() + return + } + factory618 := thrift.NewSimpleJSONProtocolFactory() + jsProt619 := factory618.GetProtocol(mbTrans616) + argvalue0 := meta.NewListClusterInfoReq() + err620 := argvalue0.Read(jsProt619) + if err620 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListCluster(value0)) + fmt.Print("\n") + break + case "getMetaDirInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetMetaDirInfo requires 1 args") + flag.Usage() + } + arg621 := flag.Arg(1) + mbTrans622 := thrift.NewMemoryBufferLen(len(arg621)) + defer mbTrans622.Close() + _, err623 := mbTrans622.WriteString(arg621) + if err623 != nil { + Usage() + return + } + factory624 := thrift.NewSimpleJSONProtocolFactory() + jsProt625 := factory624.GetProtocol(mbTrans622) + argvalue0 := meta.NewGetMetaDirInfoReq() + err626 := argvalue0.Read(jsProt625) + if err626 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetMetaDirInfo(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/meta/metaservice.go b/ccore/nebula/internal/thrift/v2_5_1/meta/metaservice.go new file mode 100644 index 0000000..a2de444 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/meta/metaservice.go @@ -0,0 +1,27604 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type MetaService interface { + // Parameters: + // - Req + CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStatis(ctx context.Context, req *GetStatisReq) (_r *GetStatisResp, err error) + // Parameters: + // - Req + SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) +} + +type MetaServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateTag(req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) + // Parameters: + // - Req + SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) +} + +type MetaServiceClient struct { + MetaServiceClientInterface + CC thrift.ClientConn +} + +func(client *MetaServiceClient) Open() error { + return client.CC.Open() +} + +func(client *MetaServiceClient) Close() error { + return client.CC.Close() +} + +func(client *MetaServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewMetaServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceClientProtocol(prot thrift.Protocol) *MetaServiceClient { + return NewMetaServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Get(req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) { + args := MetaServiceGetStatisArgs{ + Req : req, + } + err = p.CC.SendMsg("getStatis", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStatis() +} + + +func (p *MetaServiceClient) recvGetStatis() (value *GetStatisResp, err error) { + var result MetaServiceGetStatisResult + err = p.CC.RecvMsg("getStatis", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceThreadsafeClient struct { + MetaServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *MetaServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *MetaServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *MetaServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewMetaServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceThreadsafeClientProtocol(prot thrift.Protocol) *MetaServiceThreadsafeClient { + return NewMetaServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceThreadsafeClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceThreadsafeClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceThreadsafeClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceThreadsafeClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceThreadsafeClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Get(req *GetReq) (_r *GetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceThreadsafeClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceThreadsafeClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceThreadsafeClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceThreadsafeClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceThreadsafeClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceThreadsafeClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceThreadsafeClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceThreadsafeClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceThreadsafeClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceThreadsafeClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceThreadsafeClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceThreadsafeClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceThreadsafeClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceThreadsafeClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceThreadsafeClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceThreadsafeClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceThreadsafeClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetStatis(req *GetStatisReq) (_r *GetStatisResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetStatisArgs{ + Req : req, + } + err = p.CC.SendMsg("getStatis", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStatis() +} + + +func (p *MetaServiceThreadsafeClient) recvGetStatis() (value *GetStatisResp, err error) { + var result MetaServiceGetStatisResult + err = p.CC.RecvMsg("getStatis", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceThreadsafeClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceThreadsafeClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceThreadsafeClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceThreadsafeClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *MetaServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *MetaServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *MetaServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewMetaServiceChannelClient(channel thrift.RequestChannel) *MetaServiceChannelClient { + return &MetaServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + var result MetaServiceCreateSpaceResult + err = p.RequestChannel.Call(ctx, "createSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + var result MetaServiceDropSpaceResult + err = p.RequestChannel.Call(ctx, "dropSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + var result MetaServiceGetSpaceResult + err = p.RequestChannel.Call(ctx, "getSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + var result MetaServiceListSpacesResult + err = p.RequestChannel.Call(ctx, "listSpaces", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + var result MetaServiceCreateTagResult + err = p.RequestChannel.Call(ctx, "createTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + var result MetaServiceAlterTagResult + err = p.RequestChannel.Call(ctx, "alterTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + var result MetaServiceDropTagResult + err = p.RequestChannel.Call(ctx, "dropTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + var result MetaServiceGetTagResult + err = p.RequestChannel.Call(ctx, "getTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + var result MetaServiceListTagsResult + err = p.RequestChannel.Call(ctx, "listTags", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + var result MetaServiceCreateEdgeResult + err = p.RequestChannel.Call(ctx, "createEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + var result MetaServiceAlterEdgeResult + err = p.RequestChannel.Call(ctx, "alterEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + var result MetaServiceDropEdgeResult + err = p.RequestChannel.Call(ctx, "dropEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + var result MetaServiceGetEdgeResult + err = p.RequestChannel.Call(ctx, "getEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + var result MetaServiceListEdgesResult + err = p.RequestChannel.Call(ctx, "listEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + var result MetaServiceListHostsResult + err = p.RequestChannel.Call(ctx, "listHosts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + var result MetaServiceGetPartsAllocResult + err = p.RequestChannel.Call(ctx, "getPartsAlloc", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + var result MetaServiceListPartsResult + err = p.RequestChannel.Call(ctx, "listParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + var result MetaServiceMultiPutResult + err = p.RequestChannel.Call(ctx, "multiPut", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + var result MetaServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + var result MetaServiceMultiGetResult + err = p.RequestChannel.Call(ctx, "multiGet", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + var result MetaServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + var result MetaServiceRemoveRangeResult + err = p.RequestChannel.Call(ctx, "removeRange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + var result MetaServiceScanResult + err = p.RequestChannel.Call(ctx, "scan", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + var result MetaServiceCreateTagIndexResult + err = p.RequestChannel.Call(ctx, "createTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + var result MetaServiceDropTagIndexResult + err = p.RequestChannel.Call(ctx, "dropTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + var result MetaServiceGetTagIndexResult + err = p.RequestChannel.Call(ctx, "getTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + var result MetaServiceListTagIndexesResult + err = p.RequestChannel.Call(ctx, "listTagIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + var result MetaServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + var result MetaServiceListTagIndexStatusResult + err = p.RequestChannel.Call(ctx, "listTagIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + var result MetaServiceCreateEdgeIndexResult + err = p.RequestChannel.Call(ctx, "createEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + var result MetaServiceDropEdgeIndexResult + err = p.RequestChannel.Call(ctx, "dropEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + var result MetaServiceGetEdgeIndexResult + err = p.RequestChannel.Call(ctx, "getEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexesResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result MetaServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexStatusResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + var result MetaServiceCreateUserResult + err = p.RequestChannel.Call(ctx, "createUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + var result MetaServiceDropUserResult + err = p.RequestChannel.Call(ctx, "dropUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + var result MetaServiceAlterUserResult + err = p.RequestChannel.Call(ctx, "alterUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + var result MetaServiceGrantRoleResult + err = p.RequestChannel.Call(ctx, "grantRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + var result MetaServiceRevokeRoleResult + err = p.RequestChannel.Call(ctx, "revokeRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + var result MetaServiceListUsersResult + err = p.RequestChannel.Call(ctx, "listUsers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + var result MetaServiceListRolesResult + err = p.RequestChannel.Call(ctx, "listRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + var result MetaServiceGetUserRolesResult + err = p.RequestChannel.Call(ctx, "getUserRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + var result MetaServiceChangePasswordResult + err = p.RequestChannel.Call(ctx, "changePassword", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + var result MetaServiceHeartBeatResult + err = p.RequestChannel.Call(ctx, "heartBeat", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + var result MetaServiceBalanceResult + err = p.RequestChannel.Call(ctx, "balance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + var result MetaServiceLeaderBalanceResult + err = p.RequestChannel.Call(ctx, "leaderBalance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + var result MetaServiceRegConfigResult + err = p.RequestChannel.Call(ctx, "regConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + var result MetaServiceGetConfigResult + err = p.RequestChannel.Call(ctx, "getConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + var result MetaServiceSetConfigResult + err = p.RequestChannel.Call(ctx, "setConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + var result MetaServiceListConfigsResult + err = p.RequestChannel.Call(ctx, "listConfigs", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + var result MetaServiceCreateSnapshotResult + err = p.RequestChannel.Call(ctx, "createSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + var result MetaServiceDropSnapshotResult + err = p.RequestChannel.Call(ctx, "dropSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + var result MetaServiceListSnapshotsResult + err = p.RequestChannel.Call(ctx, "listSnapshots", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + var result MetaServiceRunAdminJobResult + err = p.RequestChannel.Call(ctx, "runAdminJob", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + var result MetaServiceAddZoneResult + err = p.RequestChannel.Call(ctx, "addZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + var result MetaServiceDropZoneResult + err = p.RequestChannel.Call(ctx, "dropZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + var result MetaServiceAddHostIntoZoneResult + err = p.RequestChannel.Call(ctx, "addHostIntoZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + var result MetaServiceDropHostFromZoneResult + err = p.RequestChannel.Call(ctx, "dropHostFromZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + var result MetaServiceGetZoneResult + err = p.RequestChannel.Call(ctx, "getZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + var result MetaServiceListZonesResult + err = p.RequestChannel.Call(ctx, "listZones", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + var result MetaServiceAddGroupResult + err = p.RequestChannel.Call(ctx, "addGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + var result MetaServiceDropGroupResult + err = p.RequestChannel.Call(ctx, "dropGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + var result MetaServiceAddZoneIntoGroupResult + err = p.RequestChannel.Call(ctx, "addZoneIntoGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + var result MetaServiceDropZoneFromGroupResult + err = p.RequestChannel.Call(ctx, "dropZoneFromGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + var result MetaServiceGetGroupResult + err = p.RequestChannel.Call(ctx, "getGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + var result MetaServiceListGroupsResult + err = p.RequestChannel.Call(ctx, "listGroups", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + var result MetaServiceCreateBackupResult + err = p.RequestChannel.Call(ctx, "createBackup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + var result MetaServiceRestoreMetaResult + err = p.RequestChannel.Call(ctx, "restoreMeta", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + var result MetaServiceAddListenerResult + err = p.RequestChannel.Call(ctx, "addListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + var result MetaServiceRemoveListenerResult + err = p.RequestChannel.Call(ctx, "removeListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + var result MetaServiceListListenerResult + err = p.RequestChannel.Call(ctx, "listListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetStatis(ctx context.Context, req *GetStatisReq) (_r *GetStatisResp, err error) { + args := MetaServiceGetStatisArgs{ + Req : req, + } + var result MetaServiceGetStatisResult + err = p.RequestChannel.Call(ctx, "getStatis", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + var result MetaServiceSignInFTServiceResult + err = p.RequestChannel.Call(ctx, "signInFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + var result MetaServiceSignOutFTServiceResult + err = p.RequestChannel.Call(ctx, "signOutFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + var result MetaServiceListFTClientsResult + err = p.RequestChannel.Call(ctx, "listFTClients", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + var result MetaServiceCreateFTIndexResult + err = p.RequestChannel.Call(ctx, "createFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + var result MetaServiceDropFTIndexResult + err = p.RequestChannel.Call(ctx, "dropFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + var result MetaServiceListFTIndexesResult + err = p.RequestChannel.Call(ctx, "listFTIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + var result MetaServiceCreateSessionResult + err = p.RequestChannel.Call(ctx, "createSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + var result MetaServiceUpdateSessionsResult + err = p.RequestChannel.Call(ctx, "updateSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + var result MetaServiceListSessionsResult + err = p.RequestChannel.Call(ctx, "listSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + var result MetaServiceGetSessionResult + err = p.RequestChannel.Call(ctx, "getSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + var result MetaServiceRemoveSessionResult + err = p.RequestChannel.Call(ctx, "removeSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + var result MetaServiceKillQueryResult + err = p.RequestChannel.Call(ctx, "killQuery", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + var result MetaServiceReportTaskFinishResult + err = p.RequestChannel.Call(ctx, "reportTaskFinish", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + var result MetaServiceListClusterResult + err = p.RequestChannel.Call(ctx, "listCluster", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + var result MetaServiceGetMetaDirInfoResult + err = p.RequestChannel.Call(ctx, "getMetaDirInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler MetaService +} + +func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *MetaServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { + self97 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self97.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self97.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self97.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self97.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self97.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self97.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self97.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self97.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self97.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self97.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self97.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self97.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self97.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self97.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self97.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self97.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self97.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self97.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} + self97.processorMap["get"] = &metaServiceProcessorGet{handler:handler} + self97.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} + self97.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} + self97.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} + self97.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} + self97.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self97.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self97.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self97.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self97.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self97.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self97.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self97.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self97.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self97.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self97.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self97.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self97.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self97.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self97.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self97.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self97.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self97.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self97.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self97.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self97.processorMap["balance"] = &metaServiceProcessorBalance{handler:handler} + self97.processorMap["leaderBalance"] = &metaServiceProcessorLeaderBalance{handler:handler} + self97.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self97.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self97.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self97.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self97.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self97.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self97.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self97.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self97.processorMap["addZone"] = &metaServiceProcessorAddZone{handler:handler} + self97.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self97.processorMap["addHostIntoZone"] = &metaServiceProcessorAddHostIntoZone{handler:handler} + self97.processorMap["dropHostFromZone"] = &metaServiceProcessorDropHostFromZone{handler:handler} + self97.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self97.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self97.processorMap["addGroup"] = &metaServiceProcessorAddGroup{handler:handler} + self97.processorMap["dropGroup"] = &metaServiceProcessorDropGroup{handler:handler} + self97.processorMap["addZoneIntoGroup"] = &metaServiceProcessorAddZoneIntoGroup{handler:handler} + self97.processorMap["dropZoneFromGroup"] = &metaServiceProcessorDropZoneFromGroup{handler:handler} + self97.processorMap["getGroup"] = &metaServiceProcessorGetGroup{handler:handler} + self97.processorMap["listGroups"] = &metaServiceProcessorListGroups{handler:handler} + self97.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self97.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self97.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self97.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self97.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self97.processorMap["getStatis"] = &metaServiceProcessorGetStatis{handler:handler} + self97.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} + self97.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} + self97.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} + self97.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self97.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self97.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self97.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self97.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self97.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self97.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self97.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self97.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self97.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self97.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self97.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + return self97 +} + +type metaServiceProcessorCreateSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSpace) 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("createSpace", 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 *metaServiceProcessorCreateSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSpaceArgs) + var result MetaServiceCreateSpaceResult + if retval, err := p.handler.CreateSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSpace) 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("dropSpace", 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 *metaServiceProcessorDropSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSpaceArgs) + var result MetaServiceDropSpaceResult + if retval, err := p.handler.DropSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSpace) 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("getSpace", 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 *metaServiceProcessorGetSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSpaceArgs) + var result MetaServiceGetSpaceResult + if retval, err := p.handler.GetSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSpaces struct { + handler MetaService +} + +func (p *metaServiceProcessorListSpaces) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSpacesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSpaces) 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("listSpaces", 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 *metaServiceProcessorListSpaces) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSpacesArgs) + var result MetaServiceListSpacesResult + if retval, err := p.handler.ListSpaces(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSpaces: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTag struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTag) 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("createTag", 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 *metaServiceProcessorCreateTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagArgs) + var result MetaServiceCreateTagResult + if retval, err := p.handler.CreateTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterTag struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterTag) 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("alterTag", 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 *metaServiceProcessorAlterTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterTagArgs) + var result MetaServiceAlterTagResult + if retval, err := p.handler.AlterTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTag struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTag) 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("dropTag", 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 *metaServiceProcessorDropTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagArgs) + var result MetaServiceDropTagResult + if retval, err := p.handler.DropTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTag struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTag) 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("getTag", 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 *metaServiceProcessorGetTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagArgs) + var result MetaServiceGetTagResult + if retval, err := p.handler.GetTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTags struct { + handler MetaService +} + +func (p *metaServiceProcessorListTags) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTags) 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("listTags", 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 *metaServiceProcessorListTags) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagsArgs) + var result MetaServiceListTagsResult + if retval, err := p.handler.ListTags(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTags: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdge) 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("createEdge", 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 *metaServiceProcessorCreateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeArgs) + var result MetaServiceCreateEdgeResult + if retval, err := p.handler.CreateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterEdge) 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("alterEdge", 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 *metaServiceProcessorAlterEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterEdgeArgs) + var result MetaServiceAlterEdgeResult + if retval, err := p.handler.AlterEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdge) 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("dropEdge", 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 *metaServiceProcessorDropEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeArgs) + var result MetaServiceDropEdgeResult + if retval, err := p.handler.DropEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdge) 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("getEdge", 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 *metaServiceProcessorGetEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeArgs) + var result MetaServiceGetEdgeResult + if retval, err := p.handler.GetEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdges struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdges) 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("listEdges", 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 *metaServiceProcessorListEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgesArgs) + var result MetaServiceListEdgesResult + if retval, err := p.handler.ListEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorListHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListHosts) 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("listHosts", 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 *metaServiceProcessorListHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListHostsArgs) + var result MetaServiceListHostsResult + if retval, err := p.handler.ListHosts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetPartsAlloc struct { + handler MetaService +} + +func (p *metaServiceProcessorGetPartsAlloc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetPartsAllocArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetPartsAlloc) 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("getPartsAlloc", 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 *metaServiceProcessorGetPartsAlloc) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetPartsAllocArgs) + var result MetaServiceGetPartsAllocResult + if retval, err := p.handler.GetPartsAlloc(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartsAlloc: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListParts struct { + handler MetaService +} + +func (p *metaServiceProcessorListParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListParts) 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("listParts", 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 *metaServiceProcessorListParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListPartsArgs) + var result MetaServiceListPartsResult + if retval, err := p.handler.ListParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiPut struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiPutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiPut) 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("multiPut", 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 *metaServiceProcessorMultiPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiPutArgs) + var result MetaServiceMultiPutResult + if retval, err := p.handler.MultiPut(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiPut: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGet struct { + handler MetaService +} + +func (p *metaServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetArgs) + var result MetaServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiGet struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiGet) 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("multiGet", 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 *metaServiceProcessorMultiGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiGetArgs) + var result MetaServiceMultiGetResult + if retval, err := p.handler.MultiGet(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiGet: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemove struct { + handler MetaService +} + +func (p *metaServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveArgs) + var result MetaServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveRange struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveRange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveRangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveRange) 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("removeRange", 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 *metaServiceProcessorRemoveRange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveRangeArgs) + var result MetaServiceRemoveRangeResult + if retval, err := p.handler.RemoveRange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeRange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorScan struct { + handler MetaService +} + +func (p *metaServiceProcessorScan) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceScanArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorScan) 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("scan", 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 *metaServiceProcessorScan) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceScanArgs) + var result MetaServiceScanResult + if retval, err := p.handler.Scan(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTagIndex) 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("createTagIndex", 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 *metaServiceProcessorCreateTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagIndexArgs) + var result MetaServiceCreateTagIndexResult + if retval, err := p.handler.CreateTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTagIndex) 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("dropTagIndex", 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 *metaServiceProcessorDropTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagIndexArgs) + var result MetaServiceDropTagIndexResult + if retval, err := p.handler.DropTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTagIndex) 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("getTagIndex", 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 *metaServiceProcessorGetTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagIndexArgs) + var result MetaServiceGetTagIndexResult + if retval, err := p.handler.GetTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexes) 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("listTagIndexes", 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 *metaServiceProcessorListTagIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexesArgs) + var result MetaServiceListTagIndexesResult + if retval, err := p.handler.ListTagIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *metaServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildTagIndexArgs) + var result MetaServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexStatus) 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("listTagIndexStatus", 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 *metaServiceProcessorListTagIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexStatusArgs) + var result MetaServiceListTagIndexStatusResult + if retval, err := p.handler.ListTagIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdgeIndex) 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("createEdgeIndex", 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 *metaServiceProcessorCreateEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeIndexArgs) + var result MetaServiceCreateEdgeIndexResult + if retval, err := p.handler.CreateEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdgeIndex) 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("dropEdgeIndex", 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 *metaServiceProcessorDropEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeIndexArgs) + var result MetaServiceDropEdgeIndexResult + if retval, err := p.handler.DropEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdgeIndex) 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("getEdgeIndex", 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 *metaServiceProcessorGetEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeIndexArgs) + var result MetaServiceGetEdgeIndexResult + if retval, err := p.handler.GetEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexes) 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("listEdgeIndexes", 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 *metaServiceProcessorListEdgeIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexesArgs) + var result MetaServiceListEdgeIndexesResult + if retval, err := p.handler.ListEdgeIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *metaServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildEdgeIndexArgs) + var result MetaServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexStatus) 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("listEdgeIndexStatus", 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 *metaServiceProcessorListEdgeIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexStatusArgs) + var result MetaServiceListEdgeIndexStatusResult + if retval, err := p.handler.ListEdgeIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateUser struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateUser) 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("createUser", 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 *metaServiceProcessorCreateUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateUserArgs) + var result MetaServiceCreateUserResult + if retval, err := p.handler.CreateUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropUser struct { + handler MetaService +} + +func (p *metaServiceProcessorDropUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropUser) 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("dropUser", 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 *metaServiceProcessorDropUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropUserArgs) + var result MetaServiceDropUserResult + if retval, err := p.handler.DropUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterUser struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterUser) 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("alterUser", 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 *metaServiceProcessorAlterUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterUserArgs) + var result MetaServiceAlterUserResult + if retval, err := p.handler.AlterUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGrantRole struct { + handler MetaService +} + +func (p *metaServiceProcessorGrantRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGrantRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGrantRole) 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("grantRole", 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 *metaServiceProcessorGrantRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGrantRoleArgs) + var result MetaServiceGrantRoleResult + if retval, err := p.handler.GrantRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grantRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRevokeRole struct { + handler MetaService +} + +func (p *metaServiceProcessorRevokeRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRevokeRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRevokeRole) 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("revokeRole", 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 *metaServiceProcessorRevokeRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRevokeRoleArgs) + var result MetaServiceRevokeRoleResult + if retval, err := p.handler.RevokeRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListUsers struct { + handler MetaService +} + +func (p *metaServiceProcessorListUsers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListUsersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListUsers) 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("listUsers", 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 *metaServiceProcessorListUsers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListUsersArgs) + var result MetaServiceListUsersResult + if retval, err := p.handler.ListUsers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listUsers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorListRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListRoles) 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("listRoles", 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 *metaServiceProcessorListRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListRolesArgs) + var result MetaServiceListRolesResult + if retval, err := p.handler.ListRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetUserRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorGetUserRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetUserRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetUserRoles) 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("getUserRoles", 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 *metaServiceProcessorGetUserRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetUserRolesArgs) + var result MetaServiceGetUserRolesResult + if retval, err := p.handler.GetUserRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUserRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorChangePassword struct { + handler MetaService +} + +func (p *metaServiceProcessorChangePassword) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceChangePasswordArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorChangePassword) 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("changePassword", 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 *metaServiceProcessorChangePassword) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceChangePasswordArgs) + var result MetaServiceChangePasswordResult + if retval, err := p.handler.ChangePassword(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changePassword: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorHeartBeat struct { + handler MetaService +} + +func (p *metaServiceProcessorHeartBeat) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceHeartBeatArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorHeartBeat) 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("heartBeat", 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 *metaServiceProcessorHeartBeat) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceHeartBeatArgs) + var result MetaServiceHeartBeatResult + if retval, err := p.handler.HeartBeat(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing heartBeat: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorBalance) 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("balance", 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 *metaServiceProcessorBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceBalanceArgs) + var result MetaServiceBalanceResult + if retval, err := p.handler.Balance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing balance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorLeaderBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorLeaderBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceLeaderBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorLeaderBalance) 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("leaderBalance", 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 *metaServiceProcessorLeaderBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceLeaderBalanceArgs) + var result MetaServiceLeaderBalanceResult + if retval, err := p.handler.LeaderBalance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing leaderBalance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRegConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorRegConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRegConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRegConfig) 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("regConfig", 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 *metaServiceProcessorRegConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRegConfigArgs) + var result MetaServiceRegConfigResult + if retval, err := p.handler.RegConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing regConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorGetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetConfig) 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("getConfig", 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 *metaServiceProcessorGetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetConfigArgs) + var result MetaServiceGetConfigResult + if retval, err := p.handler.GetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorSetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSetConfig) 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("setConfig", 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 *metaServiceProcessorSetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSetConfigArgs) + var result MetaServiceSetConfigResult + if retval, err := p.handler.SetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListConfigs struct { + handler MetaService +} + +func (p *metaServiceProcessorListConfigs) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListConfigsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListConfigs) 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("listConfigs", 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 *metaServiceProcessorListConfigs) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListConfigsArgs) + var result MetaServiceListConfigsResult + if retval, err := p.handler.ListConfigs(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listConfigs: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSnapshot) 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("createSnapshot", 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 *metaServiceProcessorCreateSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSnapshotArgs) + var result MetaServiceCreateSnapshotResult + if retval, err := p.handler.CreateSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSnapshot) 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("dropSnapshot", 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 *metaServiceProcessorDropSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSnapshotArgs) + var result MetaServiceDropSnapshotResult + if retval, err := p.handler.DropSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSnapshots struct { + handler MetaService +} + +func (p *metaServiceProcessorListSnapshots) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSnapshotsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSnapshots) 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("listSnapshots", 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 *metaServiceProcessorListSnapshots) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSnapshotsArgs) + var result MetaServiceListSnapshotsResult + if retval, err := p.handler.ListSnapshots(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSnapshots: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRunAdminJob struct { + handler MetaService +} + +func (p *metaServiceProcessorRunAdminJob) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRunAdminJobArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRunAdminJob) 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("runAdminJob", 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 *metaServiceProcessorRunAdminJob) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRunAdminJobArgs) + var result MetaServiceRunAdminJobResult + if retval, err := p.handler.RunAdminJob(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing runAdminJob: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneArgs) + var result MetaServiceAddZoneResult + if retval, err := p.handler.AddZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZone) 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("dropZone", 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 *metaServiceProcessorDropZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneArgs) + var result MetaServiceDropZoneResult + if retval, err := p.handler.DropZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddHostIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostIntoZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHostIntoZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddHostIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostIntoZoneArgs) + var result MetaServiceAddHostIntoZoneResult + if retval, err := p.handler.AddHostIntoZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostIntoZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropHostFromZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropHostFromZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("dropHostFromZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorDropHostFromZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropHostFromZoneArgs) + var result MetaServiceDropHostFromZoneResult + if retval, err := p.handler.DropHostFromZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHostFromZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetZone struct { + handler MetaService +} + +func (p *metaServiceProcessorGetZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetZone) 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("getZone", 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 *metaServiceProcessorGetZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetZoneArgs) + var result MetaServiceGetZoneResult + if retval, err := p.handler.GetZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListZones struct { + handler MetaService +} + +func (p *metaServiceProcessorListZones) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListZonesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListZones) 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("listZones", 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 *metaServiceProcessorListZones) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListZonesArgs) + var result MetaServiceListZonesResult + if retval, err := p.handler.ListZones(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listZones: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddGroup) 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("addGroup", 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 *metaServiceProcessorAddGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddGroupArgs) + var result MetaServiceAddGroupResult + if retval, err := p.handler.AddGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropGroup) 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("dropGroup", 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 *metaServiceProcessorDropGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropGroupArgs) + var result MetaServiceDropGroupResult + if retval, err := p.handler.DropGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZoneIntoGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZoneIntoGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneIntoGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZoneIntoGroup) 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("addZoneIntoGroup", 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 *metaServiceProcessorAddZoneIntoGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneIntoGroupArgs) + var result MetaServiceAddZoneIntoGroupResult + if retval, err := p.handler.AddZoneIntoGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZoneIntoGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZoneFromGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZoneFromGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneFromGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZoneFromGroup) 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("dropZoneFromGroup", 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 *metaServiceProcessorDropZoneFromGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneFromGroupArgs) + var result MetaServiceDropZoneFromGroupResult + if retval, err := p.handler.DropZoneFromGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZoneFromGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorGetGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetGroup) 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("getGroup", 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 *metaServiceProcessorGetGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetGroupArgs) + var result MetaServiceGetGroupResult + if retval, err := p.handler.GetGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListGroups struct { + handler MetaService +} + +func (p *metaServiceProcessorListGroups) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListGroupsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListGroups) 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("listGroups", 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 *metaServiceProcessorListGroups) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListGroupsArgs) + var result MetaServiceListGroupsResult + if retval, err := p.handler.ListGroups(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listGroups: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateBackup struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateBackup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateBackupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateBackup) 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("createBackup", 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 *metaServiceProcessorCreateBackup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateBackupArgs) + var result MetaServiceCreateBackupResult + if retval, err := p.handler.CreateBackup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createBackup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRestoreMeta struct { + handler MetaService +} + +func (p *metaServiceProcessorRestoreMeta) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRestoreMetaArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRestoreMeta) 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("restoreMeta", 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 *metaServiceProcessorRestoreMeta) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRestoreMetaArgs) + var result MetaServiceRestoreMetaResult + if retval, err := p.handler.RestoreMeta(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restoreMeta: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddListener struct { + handler MetaService +} + +func (p *metaServiceProcessorAddListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddListener) 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("addListener", 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 *metaServiceProcessorAddListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddListenerArgs) + var result MetaServiceAddListenerResult + if retval, err := p.handler.AddListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveListener struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveListener) 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("removeListener", 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 *metaServiceProcessorRemoveListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveListenerArgs) + var result MetaServiceRemoveListenerResult + if retval, err := p.handler.RemoveListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListListener struct { + handler MetaService +} + +func (p *metaServiceProcessorListListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListListener) 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("listListener", 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 *metaServiceProcessorListListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListListenerArgs) + var result MetaServiceListListenerResult + if retval, err := p.handler.ListListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetStatis struct { + handler MetaService +} + +func (p *metaServiceProcessorGetStatis) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetStatisArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetStatis) 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("getStatis", 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 *metaServiceProcessorGetStatis) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetStatisArgs) + var result MetaServiceGetStatisResult + if retval, err := p.handler.GetStatis(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStatis: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignInFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignInFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignInFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignInFTService) 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("signInFTService", 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 *metaServiceProcessorSignInFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignInFTServiceArgs) + var result MetaServiceSignInFTServiceResult + if retval, err := p.handler.SignInFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignOutFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignOutFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignOutFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignOutFTService) 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("signOutFTService", 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 *metaServiceProcessorSignOutFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignOutFTServiceArgs) + var result MetaServiceSignOutFTServiceResult + if retval, err := p.handler.SignOutFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTClients struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTClients) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTClientsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTClients) 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("listFTClients", 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 *metaServiceProcessorListFTClients) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTClientsArgs) + var result MetaServiceListFTClientsResult + if retval, err := p.handler.ListFTClients(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTClients: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateFTIndex) 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("createFTIndex", 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 *metaServiceProcessorCreateFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateFTIndexArgs) + var result MetaServiceCreateFTIndexResult + if retval, err := p.handler.CreateFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropFTIndex) 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("dropFTIndex", 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 *metaServiceProcessorDropFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropFTIndexArgs) + var result MetaServiceDropFTIndexResult + if retval, err := p.handler.DropFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTIndexes) 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("listFTIndexes", 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 *metaServiceProcessorListFTIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTIndexesArgs) + var result MetaServiceListFTIndexesResult + if retval, err := p.handler.ListFTIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSession struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSession) 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("createSession", 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 *metaServiceProcessorCreateSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSessionArgs) + var result MetaServiceCreateSessionResult + if retval, err := p.handler.CreateSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorUpdateSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorUpdateSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceUpdateSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorUpdateSessions) 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("updateSessions", 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 *metaServiceProcessorUpdateSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceUpdateSessionsArgs) + var result MetaServiceUpdateSessionsResult + if retval, err := p.handler.UpdateSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorListSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSessions) 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("listSessions", 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 *metaServiceProcessorListSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSessionsArgs) + var result MetaServiceListSessionsResult + if retval, err := p.handler.ListSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSession struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSession) 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("getSession", 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 *metaServiceProcessorGetSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSessionArgs) + var result MetaServiceGetSessionResult + if retval, err := p.handler.GetSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveSession struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveSession) 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("removeSession", 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 *metaServiceProcessorRemoveSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveSessionArgs) + var result MetaServiceRemoveSessionResult + if retval, err := p.handler.RemoveSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorKillQuery struct { + handler MetaService +} + +func (p *metaServiceProcessorKillQuery) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceKillQueryArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorKillQuery) 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("killQuery", 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 *metaServiceProcessorKillQuery) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceKillQueryArgs) + var result MetaServiceKillQueryResult + if retval, err := p.handler.KillQuery(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killQuery: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorReportTaskFinish struct { + handler MetaService +} + +func (p *metaServiceProcessorReportTaskFinish) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceReportTaskFinishArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorReportTaskFinish) 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("reportTaskFinish", 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 *metaServiceProcessorReportTaskFinish) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceReportTaskFinishArgs) + var result MetaServiceReportTaskFinishResult + if retval, err := p.handler.ReportTaskFinish(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reportTaskFinish: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListCluster struct { + handler MetaService +} + +func (p *metaServiceProcessorListCluster) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListClusterArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListCluster) 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("listCluster", 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 *metaServiceProcessorListCluster) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListClusterArgs) + var result MetaServiceListClusterResult + if retval, err := p.handler.ListCluster(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listCluster: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetMetaDirInfo struct { + handler MetaService +} + +func (p *metaServiceProcessorGetMetaDirInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetMetaDirInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetMetaDirInfo) 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("getMetaDirInfo", 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 *metaServiceProcessorGetMetaDirInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetMetaDirInfoArgs) + var result MetaServiceGetMetaDirInfoResult + if retval, err := p.handler.GetMetaDirInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMetaDirInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type MetaServiceCreateSpaceArgs struct { + thrift.IRequest + Req *CreateSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceArgs() *MetaServiceCreateSpaceArgs { + return &MetaServiceCreateSpaceArgs{ + Req: NewCreateSpaceReq(), + } +} + +var MetaServiceCreateSpaceArgs_Req_DEFAULT *CreateSpaceReq +func (p *MetaServiceCreateSpaceArgs) GetReq() *CreateSpaceReq { + if !p.IsSetReq() { + return MetaServiceCreateSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSpaceResult() *MetaServiceCreateSpaceResult { + return &MetaServiceCreateSpaceResult{} +} + +var MetaServiceCreateSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSpaceArgs struct { + thrift.IRequest + Req *DropSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSpaceArgs() *MetaServiceDropSpaceArgs { + return &MetaServiceDropSpaceArgs{ + Req: NewDropSpaceReq(), + } +} + +var MetaServiceDropSpaceArgs_Req_DEFAULT *DropSpaceReq +func (p *MetaServiceDropSpaceArgs) GetReq() *DropSpaceReq { + if !p.IsSetReq() { + return MetaServiceDropSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSpaceResult() *MetaServiceDropSpaceResult { + return &MetaServiceDropSpaceResult{} +} + +var MetaServiceDropSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSpaceArgs struct { + thrift.IRequest + Req *GetSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSpaceArgs() *MetaServiceGetSpaceArgs { + return &MetaServiceGetSpaceArgs{ + Req: NewGetSpaceReq(), + } +} + +var MetaServiceGetSpaceArgs_Req_DEFAULT *GetSpaceReq +func (p *MetaServiceGetSpaceArgs) GetReq() *GetSpaceReq { + if !p.IsSetReq() { + return MetaServiceGetSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSpaceResult struct { + thrift.IResponse + Success *GetSpaceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSpaceResult() *MetaServiceGetSpaceResult { + return &MetaServiceGetSpaceResult{} +} + +var MetaServiceGetSpaceResult_Success_DEFAULT *GetSpaceResp +func (p *MetaServiceGetSpaceResult) GetSuccess() *GetSpaceResp { + if !p.IsSetSuccess() { + return MetaServiceGetSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSpaceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSpacesArgs struct { + thrift.IRequest + Req *ListSpacesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSpacesArgs() *MetaServiceListSpacesArgs { + return &MetaServiceListSpacesArgs{ + Req: NewListSpacesReq(), + } +} + +var MetaServiceListSpacesArgs_Req_DEFAULT *ListSpacesReq +func (p *MetaServiceListSpacesArgs) GetReq() *ListSpacesReq { + if !p.IsSetReq() { + return MetaServiceListSpacesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSpacesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSpacesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSpacesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSpacesResult struct { + thrift.IResponse + Success *ListSpacesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSpacesResult() *MetaServiceListSpacesResult { + return &MetaServiceListSpacesResult{} +} + +var MetaServiceListSpacesResult_Success_DEFAULT *ListSpacesResp +func (p *MetaServiceListSpacesResult) GetSuccess() *ListSpacesResp { + if !p.IsSetSuccess() { + return MetaServiceListSpacesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSpacesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSpacesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSpacesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagArgs struct { + thrift.IRequest + Req *CreateTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagArgs() *MetaServiceCreateTagArgs { + return &MetaServiceCreateTagArgs{ + Req: NewCreateTagReq(), + } +} + +var MetaServiceCreateTagArgs_Req_DEFAULT *CreateTagReq +func (p *MetaServiceCreateTagArgs) GetReq() *CreateTagReq { + if !p.IsSetReq() { + return MetaServiceCreateTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagResult() *MetaServiceCreateTagResult { + return &MetaServiceCreateTagResult{} +} + +var MetaServiceCreateTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterTagArgs struct { + thrift.IRequest + Req *AlterTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterTagArgs() *MetaServiceAlterTagArgs { + return &MetaServiceAlterTagArgs{ + Req: NewAlterTagReq(), + } +} + +var MetaServiceAlterTagArgs_Req_DEFAULT *AlterTagReq +func (p *MetaServiceAlterTagArgs) GetReq() *AlterTagReq { + if !p.IsSetReq() { + return MetaServiceAlterTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterTagResult() *MetaServiceAlterTagResult { + return &MetaServiceAlterTagResult{} +} + +var MetaServiceAlterTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagArgs struct { + thrift.IRequest + Req *DropTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagArgs() *MetaServiceDropTagArgs { + return &MetaServiceDropTagArgs{ + Req: NewDropTagReq(), + } +} + +var MetaServiceDropTagArgs_Req_DEFAULT *DropTagReq +func (p *MetaServiceDropTagArgs) GetReq() *DropTagReq { + if !p.IsSetReq() { + return MetaServiceDropTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagResult() *MetaServiceDropTagResult { + return &MetaServiceDropTagResult{} +} + +var MetaServiceDropTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagArgs struct { + thrift.IRequest + Req *GetTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagArgs() *MetaServiceGetTagArgs { + return &MetaServiceGetTagArgs{ + Req: NewGetTagReq(), + } +} + +var MetaServiceGetTagArgs_Req_DEFAULT *GetTagReq +func (p *MetaServiceGetTagArgs) GetReq() *GetTagReq { + if !p.IsSetReq() { + return MetaServiceGetTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagResult struct { + thrift.IResponse + Success *GetTagResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagResult() *MetaServiceGetTagResult { + return &MetaServiceGetTagResult{} +} + +var MetaServiceGetTagResult_Success_DEFAULT *GetTagResp +func (p *MetaServiceGetTagResult) GetSuccess() *GetTagResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagsArgs struct { + thrift.IRequest + Req *ListTagsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagsArgs() *MetaServiceListTagsArgs { + return &MetaServiceListTagsArgs{ + Req: NewListTagsReq(), + } +} + +var MetaServiceListTagsArgs_Req_DEFAULT *ListTagsReq +func (p *MetaServiceListTagsArgs) GetReq() *ListTagsReq { + if !p.IsSetReq() { + return MetaServiceListTagsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagsResult struct { + thrift.IResponse + Success *ListTagsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagsResult() *MetaServiceListTagsResult { + return &MetaServiceListTagsResult{} +} + +var MetaServiceListTagsResult_Success_DEFAULT *ListTagsResp +func (p *MetaServiceListTagsResult) GetSuccess() *ListTagsResp { + if !p.IsSetSuccess() { + return MetaServiceListTagsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeArgs struct { + thrift.IRequest + Req *CreateEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeArgs() *MetaServiceCreateEdgeArgs { + return &MetaServiceCreateEdgeArgs{ + Req: NewCreateEdgeReq(), + } +} + +var MetaServiceCreateEdgeArgs_Req_DEFAULT *CreateEdgeReq +func (p *MetaServiceCreateEdgeArgs) GetReq() *CreateEdgeReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeResult() *MetaServiceCreateEdgeResult { + return &MetaServiceCreateEdgeResult{} +} + +var MetaServiceCreateEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterEdgeArgs struct { + thrift.IRequest + Req *AlterEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterEdgeArgs() *MetaServiceAlterEdgeArgs { + return &MetaServiceAlterEdgeArgs{ + Req: NewAlterEdgeReq(), + } +} + +var MetaServiceAlterEdgeArgs_Req_DEFAULT *AlterEdgeReq +func (p *MetaServiceAlterEdgeArgs) GetReq() *AlterEdgeReq { + if !p.IsSetReq() { + return MetaServiceAlterEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterEdgeResult() *MetaServiceAlterEdgeResult { + return &MetaServiceAlterEdgeResult{} +} + +var MetaServiceAlterEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeArgs struct { + thrift.IRequest + Req *DropEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeArgs() *MetaServiceDropEdgeArgs { + return &MetaServiceDropEdgeArgs{ + Req: NewDropEdgeReq(), + } +} + +var MetaServiceDropEdgeArgs_Req_DEFAULT *DropEdgeReq +func (p *MetaServiceDropEdgeArgs) GetReq() *DropEdgeReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeResult() *MetaServiceDropEdgeResult { + return &MetaServiceDropEdgeResult{} +} + +var MetaServiceDropEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeArgs struct { + thrift.IRequest + Req *GetEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeArgs() *MetaServiceGetEdgeArgs { + return &MetaServiceGetEdgeArgs{ + Req: NewGetEdgeReq(), + } +} + +var MetaServiceGetEdgeArgs_Req_DEFAULT *GetEdgeReq +func (p *MetaServiceGetEdgeArgs) GetReq() *GetEdgeReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeResult struct { + thrift.IResponse + Success *GetEdgeResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeResult() *MetaServiceGetEdgeResult { + return &MetaServiceGetEdgeResult{} +} + +var MetaServiceGetEdgeResult_Success_DEFAULT *GetEdgeResp +func (p *MetaServiceGetEdgeResult) GetSuccess() *GetEdgeResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgesArgs struct { + thrift.IRequest + Req *ListEdgesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgesArgs() *MetaServiceListEdgesArgs { + return &MetaServiceListEdgesArgs{ + Req: NewListEdgesReq(), + } +} + +var MetaServiceListEdgesArgs_Req_DEFAULT *ListEdgesReq +func (p *MetaServiceListEdgesArgs) GetReq() *ListEdgesReq { + if !p.IsSetReq() { + return MetaServiceListEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgesResult struct { + thrift.IResponse + Success *ListEdgesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgesResult() *MetaServiceListEdgesResult { + return &MetaServiceListEdgesResult{} +} + +var MetaServiceListEdgesResult_Success_DEFAULT *ListEdgesResp +func (p *MetaServiceListEdgesResult) GetSuccess() *ListEdgesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListHostsArgs struct { + thrift.IRequest + Req *ListHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListHostsArgs() *MetaServiceListHostsArgs { + return &MetaServiceListHostsArgs{ + Req: NewListHostsReq(), + } +} + +var MetaServiceListHostsArgs_Req_DEFAULT *ListHostsReq +func (p *MetaServiceListHostsArgs) GetReq() *ListHostsReq { + if !p.IsSetReq() { + return MetaServiceListHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListHostsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListHostsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListHostsResult struct { + thrift.IResponse + Success *ListHostsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListHostsResult() *MetaServiceListHostsResult { + return &MetaServiceListHostsResult{} +} + +var MetaServiceListHostsResult_Success_DEFAULT *ListHostsResp +func (p *MetaServiceListHostsResult) GetSuccess() *ListHostsResp { + if !p.IsSetSuccess() { + return MetaServiceListHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListHostsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListHostsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListHostsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetPartsAllocArgs struct { + thrift.IRequest + Req *GetPartsAllocReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetPartsAllocArgs() *MetaServiceGetPartsAllocArgs { + return &MetaServiceGetPartsAllocArgs{ + Req: NewGetPartsAllocReq(), + } +} + +var MetaServiceGetPartsAllocArgs_Req_DEFAULT *GetPartsAllocReq +func (p *MetaServiceGetPartsAllocArgs) GetReq() *GetPartsAllocReq { + if !p.IsSetReq() { + return MetaServiceGetPartsAllocArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetPartsAllocArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPartsAllocReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetPartsAllocArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetPartsAllocResult struct { + thrift.IResponse + Success *GetPartsAllocResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetPartsAllocResult() *MetaServiceGetPartsAllocResult { + return &MetaServiceGetPartsAllocResult{} +} + +var MetaServiceGetPartsAllocResult_Success_DEFAULT *GetPartsAllocResp +func (p *MetaServiceGetPartsAllocResult) GetSuccess() *GetPartsAllocResp { + if !p.IsSetSuccess() { + return MetaServiceGetPartsAllocResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetPartsAllocResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPartsAllocResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetPartsAllocResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListPartsArgs struct { + thrift.IRequest + Req *ListPartsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListPartsArgs() *MetaServiceListPartsArgs { + return &MetaServiceListPartsArgs{ + Req: NewListPartsReq(), + } +} + +var MetaServiceListPartsArgs_Req_DEFAULT *ListPartsReq +func (p *MetaServiceListPartsArgs) GetReq() *ListPartsReq { + if !p.IsSetReq() { + return MetaServiceListPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListPartsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListPartsResult struct { + thrift.IResponse + Success *ListPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListPartsResult() *MetaServiceListPartsResult { + return &MetaServiceListPartsResult{} +} + +var MetaServiceListPartsResult_Success_DEFAULT *ListPartsResp +func (p *MetaServiceListPartsResult) GetSuccess() *ListPartsResp { + if !p.IsSetSuccess() { + return MetaServiceListPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiPutArgs struct { + thrift.IRequest + Req *MultiPutReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiPutArgs() *MetaServiceMultiPutArgs { + return &MetaServiceMultiPutArgs{ + Req: NewMultiPutReq(), + } +} + +var MetaServiceMultiPutArgs_Req_DEFAULT *MultiPutReq +func (p *MetaServiceMultiPutArgs) GetReq() *MultiPutReq { + if !p.IsSetReq() { + return MetaServiceMultiPutArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiPutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiPutReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiPutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiPutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiPutResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiPutResult() *MetaServiceMultiPutResult { + return &MetaServiceMultiPutResult{} +} + +var MetaServiceMultiPutResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMultiPutResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceMultiPutResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiPutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiPutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiPutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetArgs struct { + thrift.IRequest + Req *GetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetArgs() *MetaServiceGetArgs { + return &MetaServiceGetArgs{ + Req: NewGetReq(), + } +} + +var MetaServiceGetArgs_Req_DEFAULT *GetReq +func (p *MetaServiceGetArgs) GetReq() *GetReq { + if !p.IsSetReq() { + return MetaServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetResult struct { + thrift.IResponse + Success *GetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetResult() *MetaServiceGetResult { + return &MetaServiceGetResult{} +} + +var MetaServiceGetResult_Success_DEFAULT *GetResp +func (p *MetaServiceGetResult) GetSuccess() *GetResp { + if !p.IsSetSuccess() { + return MetaServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiGetArgs struct { + thrift.IRequest + Req *MultiGetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiGetArgs() *MetaServiceMultiGetArgs { + return &MetaServiceMultiGetArgs{ + Req: NewMultiGetReq(), + } +} + +var MetaServiceMultiGetArgs_Req_DEFAULT *MultiGetReq +func (p *MetaServiceMultiGetArgs) GetReq() *MultiGetReq { + if !p.IsSetReq() { + return MetaServiceMultiGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiGetResult struct { + thrift.IResponse + Success *MultiGetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiGetResult() *MetaServiceMultiGetResult { + return &MetaServiceMultiGetResult{} +} + +var MetaServiceMultiGetResult_Success_DEFAULT *MultiGetResp +func (p *MetaServiceMultiGetResult) GetSuccess() *MultiGetResp { + if !p.IsSetSuccess() { + return MetaServiceMultiGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewMultiGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveArgs struct { + thrift.IRequest + Req *RemoveReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveArgs() *MetaServiceRemoveArgs { + return &MetaServiceRemoveArgs{ + Req: NewRemoveReq(), + } +} + +var MetaServiceRemoveArgs_Req_DEFAULT *RemoveReq +func (p *MetaServiceRemoveArgs) GetReq() *RemoveReq { + if !p.IsSetReq() { + return MetaServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveResult() *MetaServiceRemoveResult { + return &MetaServiceRemoveResult{} +} + +var MetaServiceRemoveResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveRangeArgs struct { + thrift.IRequest + Req *RemoveRangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveRangeArgs() *MetaServiceRemoveRangeArgs { + return &MetaServiceRemoveRangeArgs{ + Req: NewRemoveRangeReq(), + } +} + +var MetaServiceRemoveRangeArgs_Req_DEFAULT *RemoveRangeReq +func (p *MetaServiceRemoveRangeArgs) GetReq() *RemoveRangeReq { + if !p.IsSetReq() { + return MetaServiceRemoveRangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveRangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveRangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveRangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveRangeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveRangeResult() *MetaServiceRemoveRangeResult { + return &MetaServiceRemoveRangeResult{} +} + +var MetaServiceRemoveRangeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveRangeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveRangeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveRangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveRangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceScanArgs struct { + thrift.IRequest + Req *ScanReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceScanArgs() *MetaServiceScanArgs { + return &MetaServiceScanArgs{ + Req: NewScanReq(), + } +} + +var MetaServiceScanArgs_Req_DEFAULT *ScanReq +func (p *MetaServiceScanArgs) GetReq() *ScanReq { + if !p.IsSetReq() { + return MetaServiceScanArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceScanArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceScanArgs) 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 *MetaServiceScanArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceScanArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanArgs) 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 *MetaServiceScanArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceScanArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceScanResult struct { + thrift.IResponse + Success *ScanResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceScanResult() *MetaServiceScanResult { + return &MetaServiceScanResult{} +} + +var MetaServiceScanResult_Success_DEFAULT *ScanResp +func (p *MetaServiceScanResult) GetSuccess() *ScanResp { + if !p.IsSetSuccess() { + return MetaServiceScanResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceScanResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceScanResult) 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 *MetaServiceScanResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceScanResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanResult) 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 *MetaServiceScanResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceScanResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagIndexArgs struct { + thrift.IRequest + Req *CreateTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagIndexArgs() *MetaServiceCreateTagIndexArgs { + return &MetaServiceCreateTagIndexArgs{ + Req: NewCreateTagIndexReq(), + } +} + +var MetaServiceCreateTagIndexArgs_Req_DEFAULT *CreateTagIndexReq +func (p *MetaServiceCreateTagIndexArgs) GetReq() *CreateTagIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagIndexResult() *MetaServiceCreateTagIndexResult { + return &MetaServiceCreateTagIndexResult{} +} + +var MetaServiceCreateTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagIndexArgs struct { + thrift.IRequest + Req *DropTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagIndexArgs() *MetaServiceDropTagIndexArgs { + return &MetaServiceDropTagIndexArgs{ + Req: NewDropTagIndexReq(), + } +} + +var MetaServiceDropTagIndexArgs_Req_DEFAULT *DropTagIndexReq +func (p *MetaServiceDropTagIndexArgs) GetReq() *DropTagIndexReq { + if !p.IsSetReq() { + return MetaServiceDropTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagIndexResult() *MetaServiceDropTagIndexResult { + return &MetaServiceDropTagIndexResult{} +} + +var MetaServiceDropTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagIndexArgs struct { + thrift.IRequest + Req *GetTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagIndexArgs() *MetaServiceGetTagIndexArgs { + return &MetaServiceGetTagIndexArgs{ + Req: NewGetTagIndexReq(), + } +} + +var MetaServiceGetTagIndexArgs_Req_DEFAULT *GetTagIndexReq +func (p *MetaServiceGetTagIndexArgs) GetReq() *GetTagIndexReq { + if !p.IsSetReq() { + return MetaServiceGetTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagIndexResult struct { + thrift.IResponse + Success *GetTagIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagIndexResult() *MetaServiceGetTagIndexResult { + return &MetaServiceGetTagIndexResult{} +} + +var MetaServiceGetTagIndexResult_Success_DEFAULT *GetTagIndexResp +func (p *MetaServiceGetTagIndexResult) GetSuccess() *GetTagIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexesArgs struct { + thrift.IRequest + Req *ListTagIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexesArgs() *MetaServiceListTagIndexesArgs { + return &MetaServiceListTagIndexesArgs{ + Req: NewListTagIndexesReq(), + } +} + +var MetaServiceListTagIndexesArgs_Req_DEFAULT *ListTagIndexesReq +func (p *MetaServiceListTagIndexesArgs) GetReq() *ListTagIndexesReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexesResult struct { + thrift.IResponse + Success *ListTagIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexesResult() *MetaServiceListTagIndexesResult { + return &MetaServiceListTagIndexesResult{} +} + +var MetaServiceListTagIndexesResult_Success_DEFAULT *ListTagIndexesResp +func (p *MetaServiceListTagIndexesResult) GetSuccess() *ListTagIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildTagIndexArgs() *MetaServiceRebuildTagIndexArgs { + return &MetaServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildTagIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildTagIndexResult() *MetaServiceRebuildTagIndexResult { + return &MetaServiceRebuildTagIndexResult{} +} + +var MetaServiceRebuildTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexStatusArgs() *MetaServiceListTagIndexStatusArgs { + return &MetaServiceListTagIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListTagIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListTagIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexStatusResult() *MetaServiceListTagIndexStatusResult { + return &MetaServiceListTagIndexStatusResult{} +} + +var MetaServiceListTagIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListTagIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeIndexArgs struct { + thrift.IRequest + Req *CreateEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeIndexArgs() *MetaServiceCreateEdgeIndexArgs { + return &MetaServiceCreateEdgeIndexArgs{ + Req: NewCreateEdgeIndexReq(), + } +} + +var MetaServiceCreateEdgeIndexArgs_Req_DEFAULT *CreateEdgeIndexReq +func (p *MetaServiceCreateEdgeIndexArgs) GetReq() *CreateEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeIndexResult() *MetaServiceCreateEdgeIndexResult { + return &MetaServiceCreateEdgeIndexResult{} +} + +var MetaServiceCreateEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeIndexArgs struct { + thrift.IRequest + Req *DropEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeIndexArgs() *MetaServiceDropEdgeIndexArgs { + return &MetaServiceDropEdgeIndexArgs{ + Req: NewDropEdgeIndexReq(), + } +} + +var MetaServiceDropEdgeIndexArgs_Req_DEFAULT *DropEdgeIndexReq +func (p *MetaServiceDropEdgeIndexArgs) GetReq() *DropEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeIndexResult() *MetaServiceDropEdgeIndexResult { + return &MetaServiceDropEdgeIndexResult{} +} + +var MetaServiceDropEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeIndexArgs struct { + thrift.IRequest + Req *GetEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeIndexArgs() *MetaServiceGetEdgeIndexArgs { + return &MetaServiceGetEdgeIndexArgs{ + Req: NewGetEdgeIndexReq(), + } +} + +var MetaServiceGetEdgeIndexArgs_Req_DEFAULT *GetEdgeIndexReq +func (p *MetaServiceGetEdgeIndexArgs) GetReq() *GetEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeIndexResult struct { + thrift.IResponse + Success *GetEdgeIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeIndexResult() *MetaServiceGetEdgeIndexResult { + return &MetaServiceGetEdgeIndexResult{} +} + +var MetaServiceGetEdgeIndexResult_Success_DEFAULT *GetEdgeIndexResp +func (p *MetaServiceGetEdgeIndexResult) GetSuccess() *GetEdgeIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexesArgs struct { + thrift.IRequest + Req *ListEdgeIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexesArgs() *MetaServiceListEdgeIndexesArgs { + return &MetaServiceListEdgeIndexesArgs{ + Req: NewListEdgeIndexesReq(), + } +} + +var MetaServiceListEdgeIndexesArgs_Req_DEFAULT *ListEdgeIndexesReq +func (p *MetaServiceListEdgeIndexesArgs) GetReq() *ListEdgeIndexesReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgeIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexesResult struct { + thrift.IResponse + Success *ListEdgeIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexesResult() *MetaServiceListEdgeIndexesResult { + return &MetaServiceListEdgeIndexesResult{} +} + +var MetaServiceListEdgeIndexesResult_Success_DEFAULT *ListEdgeIndexesResp +func (p *MetaServiceListEdgeIndexesResult) GetSuccess() *ListEdgeIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgeIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildEdgeIndexArgs() *MetaServiceRebuildEdgeIndexArgs { + return &MetaServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildEdgeIndexResult() *MetaServiceRebuildEdgeIndexResult { + return &MetaServiceRebuildEdgeIndexResult{} +} + +var MetaServiceRebuildEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexStatusArgs() *MetaServiceListEdgeIndexStatusArgs { + return &MetaServiceListEdgeIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListEdgeIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexStatusResult() *MetaServiceListEdgeIndexStatusResult { + return &MetaServiceListEdgeIndexStatusResult{} +} + +var MetaServiceListEdgeIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListEdgeIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateUserArgs struct { + thrift.IRequest + Req *CreateUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateUserArgs() *MetaServiceCreateUserArgs { + return &MetaServiceCreateUserArgs{ + Req: NewCreateUserReq(), + } +} + +var MetaServiceCreateUserArgs_Req_DEFAULT *CreateUserReq +func (p *MetaServiceCreateUserArgs) GetReq() *CreateUserReq { + if !p.IsSetReq() { + return MetaServiceCreateUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateUserResult() *MetaServiceCreateUserResult { + return &MetaServiceCreateUserResult{} +} + +var MetaServiceCreateUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropUserArgs struct { + thrift.IRequest + Req *DropUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropUserArgs() *MetaServiceDropUserArgs { + return &MetaServiceDropUserArgs{ + Req: NewDropUserReq(), + } +} + +var MetaServiceDropUserArgs_Req_DEFAULT *DropUserReq +func (p *MetaServiceDropUserArgs) GetReq() *DropUserReq { + if !p.IsSetReq() { + return MetaServiceDropUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropUserResult() *MetaServiceDropUserResult { + return &MetaServiceDropUserResult{} +} + +var MetaServiceDropUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterUserArgs struct { + thrift.IRequest + Req *AlterUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterUserArgs() *MetaServiceAlterUserArgs { + return &MetaServiceAlterUserArgs{ + Req: NewAlterUserReq(), + } +} + +var MetaServiceAlterUserArgs_Req_DEFAULT *AlterUserReq +func (p *MetaServiceAlterUserArgs) GetReq() *AlterUserReq { + if !p.IsSetReq() { + return MetaServiceAlterUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterUserResult() *MetaServiceAlterUserResult { + return &MetaServiceAlterUserResult{} +} + +var MetaServiceAlterUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGrantRoleArgs struct { + thrift.IRequest + Req *GrantRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGrantRoleArgs() *MetaServiceGrantRoleArgs { + return &MetaServiceGrantRoleArgs{ + Req: NewGrantRoleReq(), + } +} + +var MetaServiceGrantRoleArgs_Req_DEFAULT *GrantRoleReq +func (p *MetaServiceGrantRoleArgs) GetReq() *GrantRoleReq { + if !p.IsSetReq() { + return MetaServiceGrantRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGrantRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGrantRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGrantRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGrantRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGrantRoleResult() *MetaServiceGrantRoleResult { + return &MetaServiceGrantRoleResult{} +} + +var MetaServiceGrantRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceGrantRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceGrantRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGrantRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGrantRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRevokeRoleArgs struct { + thrift.IRequest + Req *RevokeRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRevokeRoleArgs() *MetaServiceRevokeRoleArgs { + return &MetaServiceRevokeRoleArgs{ + Req: NewRevokeRoleReq(), + } +} + +var MetaServiceRevokeRoleArgs_Req_DEFAULT *RevokeRoleReq +func (p *MetaServiceRevokeRoleArgs) GetReq() *RevokeRoleReq { + if !p.IsSetReq() { + return MetaServiceRevokeRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRevokeRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRevokeRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRevokeRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRevokeRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRevokeRoleResult() *MetaServiceRevokeRoleResult { + return &MetaServiceRevokeRoleResult{} +} + +var MetaServiceRevokeRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRevokeRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRevokeRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRevokeRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRevokeRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListUsersArgs struct { + thrift.IRequest + Req *ListUsersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListUsersArgs() *MetaServiceListUsersArgs { + return &MetaServiceListUsersArgs{ + Req: NewListUsersReq(), + } +} + +var MetaServiceListUsersArgs_Req_DEFAULT *ListUsersReq +func (p *MetaServiceListUsersArgs) GetReq() *ListUsersReq { + if !p.IsSetReq() { + return MetaServiceListUsersArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListUsersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListUsersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListUsersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListUsersResult struct { + thrift.IResponse + Success *ListUsersResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListUsersResult() *MetaServiceListUsersResult { + return &MetaServiceListUsersResult{} +} + +var MetaServiceListUsersResult_Success_DEFAULT *ListUsersResp +func (p *MetaServiceListUsersResult) GetSuccess() *ListUsersResp { + if !p.IsSetSuccess() { + return MetaServiceListUsersResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListUsersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListUsersResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListUsersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListRolesArgs struct { + thrift.IRequest + Req *ListRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListRolesArgs() *MetaServiceListRolesArgs { + return &MetaServiceListRolesArgs{ + Req: NewListRolesReq(), + } +} + +var MetaServiceListRolesArgs_Req_DEFAULT *ListRolesReq +func (p *MetaServiceListRolesArgs) GetReq() *ListRolesReq { + if !p.IsSetReq() { + return MetaServiceListRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListRolesResult() *MetaServiceListRolesResult { + return &MetaServiceListRolesResult{} +} + +var MetaServiceListRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceListRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceListRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetUserRolesArgs struct { + thrift.IRequest + Req *GetUserRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetUserRolesArgs() *MetaServiceGetUserRolesArgs { + return &MetaServiceGetUserRolesArgs{ + Req: NewGetUserRolesReq(), + } +} + +var MetaServiceGetUserRolesArgs_Req_DEFAULT *GetUserRolesReq +func (p *MetaServiceGetUserRolesArgs) GetReq() *GetUserRolesReq { + if !p.IsSetReq() { + return MetaServiceGetUserRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetUserRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUserRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetUserRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetUserRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetUserRolesResult() *MetaServiceGetUserRolesResult { + return &MetaServiceGetUserRolesResult{} +} + +var MetaServiceGetUserRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceGetUserRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceGetUserRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetUserRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetUserRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceChangePasswordArgs struct { + thrift.IRequest + Req *ChangePasswordReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceChangePasswordArgs() *MetaServiceChangePasswordArgs { + return &MetaServiceChangePasswordArgs{ + Req: NewChangePasswordReq(), + } +} + +var MetaServiceChangePasswordArgs_Req_DEFAULT *ChangePasswordReq +func (p *MetaServiceChangePasswordArgs) GetReq() *ChangePasswordReq { + if !p.IsSetReq() { + return MetaServiceChangePasswordArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceChangePasswordArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewChangePasswordReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceChangePasswordArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceChangePasswordResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceChangePasswordResult() *MetaServiceChangePasswordResult { + return &MetaServiceChangePasswordResult{} +} + +var MetaServiceChangePasswordResult_Success_DEFAULT *ExecResp +func (p *MetaServiceChangePasswordResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceChangePasswordResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceChangePasswordResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceChangePasswordResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceHeartBeatArgs struct { + thrift.IRequest + Req *HBReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceHeartBeatArgs() *MetaServiceHeartBeatArgs { + return &MetaServiceHeartBeatArgs{ + Req: NewHBReq(), + } +} + +var MetaServiceHeartBeatArgs_Req_DEFAULT *HBReq +func (p *MetaServiceHeartBeatArgs) GetReq() *HBReq { + if !p.IsSetReq() { + return MetaServiceHeartBeatArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceHeartBeatArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewHBReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceHeartBeatArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceHeartBeatResult struct { + thrift.IResponse + Success *HBResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceHeartBeatResult() *MetaServiceHeartBeatResult { + return &MetaServiceHeartBeatResult{} +} + +var MetaServiceHeartBeatResult_Success_DEFAULT *HBResp +func (p *MetaServiceHeartBeatResult) GetSuccess() *HBResp { + if !p.IsSetSuccess() { + return MetaServiceHeartBeatResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceHeartBeatResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewHBResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceHeartBeatResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceBalanceArgs struct { + thrift.IRequest + Req *BalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceBalanceArgs() *MetaServiceBalanceArgs { + return &MetaServiceBalanceArgs{ + Req: NewBalanceReq(), + } +} + +var MetaServiceBalanceArgs_Req_DEFAULT *BalanceReq +func (p *MetaServiceBalanceArgs) GetReq() *BalanceReq { + if !p.IsSetReq() { + return MetaServiceBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceBalanceResult struct { + thrift.IResponse + Success *BalanceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceBalanceResult() *MetaServiceBalanceResult { + return &MetaServiceBalanceResult{} +} + +var MetaServiceBalanceResult_Success_DEFAULT *BalanceResp +func (p *MetaServiceBalanceResult) GetSuccess() *BalanceResp { + if !p.IsSetSuccess() { + return MetaServiceBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewBalanceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceLeaderBalanceArgs struct { + thrift.IRequest + Req *LeaderBalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceLeaderBalanceArgs() *MetaServiceLeaderBalanceArgs { + return &MetaServiceLeaderBalanceArgs{ + Req: NewLeaderBalanceReq(), + } +} + +var MetaServiceLeaderBalanceArgs_Req_DEFAULT *LeaderBalanceReq +func (p *MetaServiceLeaderBalanceArgs) GetReq() *LeaderBalanceReq { + if !p.IsSetReq() { + return MetaServiceLeaderBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceLeaderBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLeaderBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceLeaderBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceLeaderBalanceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceLeaderBalanceResult() *MetaServiceLeaderBalanceResult { + return &MetaServiceLeaderBalanceResult{} +} + +var MetaServiceLeaderBalanceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceLeaderBalanceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceLeaderBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceLeaderBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceLeaderBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRegConfigArgs struct { + thrift.IRequest + Req *RegConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRegConfigArgs() *MetaServiceRegConfigArgs { + return &MetaServiceRegConfigArgs{ + Req: NewRegConfigReq(), + } +} + +var MetaServiceRegConfigArgs_Req_DEFAULT *RegConfigReq +func (p *MetaServiceRegConfigArgs) GetReq() *RegConfigReq { + if !p.IsSetReq() { + return MetaServiceRegConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRegConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRegConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRegConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRegConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRegConfigResult() *MetaServiceRegConfigResult { + return &MetaServiceRegConfigResult{} +} + +var MetaServiceRegConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRegConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRegConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRegConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRegConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetConfigArgs struct { + thrift.IRequest + Req *GetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetConfigArgs() *MetaServiceGetConfigArgs { + return &MetaServiceGetConfigArgs{ + Req: NewGetConfigReq(), + } +} + +var MetaServiceGetConfigArgs_Req_DEFAULT *GetConfigReq +func (p *MetaServiceGetConfigArgs) GetReq() *GetConfigReq { + if !p.IsSetReq() { + return MetaServiceGetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetConfigResult struct { + thrift.IResponse + Success *GetConfigResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetConfigResult() *MetaServiceGetConfigResult { + return &MetaServiceGetConfigResult{} +} + +var MetaServiceGetConfigResult_Success_DEFAULT *GetConfigResp +func (p *MetaServiceGetConfigResult) GetSuccess() *GetConfigResp { + if !p.IsSetSuccess() { + return MetaServiceGetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetConfigResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSetConfigArgs struct { + thrift.IRequest + Req *SetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSetConfigArgs() *MetaServiceSetConfigArgs { + return &MetaServiceSetConfigArgs{ + Req: NewSetConfigReq(), + } +} + +var MetaServiceSetConfigArgs_Req_DEFAULT *SetConfigReq +func (p *MetaServiceSetConfigArgs) GetReq() *SetConfigReq { + if !p.IsSetReq() { + return MetaServiceSetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSetConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSetConfigResult() *MetaServiceSetConfigResult { + return &MetaServiceSetConfigResult{} +} + +var MetaServiceSetConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSetConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListConfigsArgs struct { + thrift.IRequest + Req *ListConfigsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListConfigsArgs() *MetaServiceListConfigsArgs { + return &MetaServiceListConfigsArgs{ + Req: NewListConfigsReq(), + } +} + +var MetaServiceListConfigsArgs_Req_DEFAULT *ListConfigsReq +func (p *MetaServiceListConfigsArgs) GetReq() *ListConfigsReq { + if !p.IsSetReq() { + return MetaServiceListConfigsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListConfigsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListConfigsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListConfigsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListConfigsResult struct { + thrift.IResponse + Success *ListConfigsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListConfigsResult() *MetaServiceListConfigsResult { + return &MetaServiceListConfigsResult{} +} + +var MetaServiceListConfigsResult_Success_DEFAULT *ListConfigsResp +func (p *MetaServiceListConfigsResult) GetSuccess() *ListConfigsResp { + if !p.IsSetSuccess() { + return MetaServiceListConfigsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListConfigsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListConfigsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListConfigsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSnapshotArgs struct { + thrift.IRequest + Req *CreateSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSnapshotArgs() *MetaServiceCreateSnapshotArgs { + return &MetaServiceCreateSnapshotArgs{ + Req: NewCreateSnapshotReq(), + } +} + +var MetaServiceCreateSnapshotArgs_Req_DEFAULT *CreateSnapshotReq +func (p *MetaServiceCreateSnapshotArgs) GetReq() *CreateSnapshotReq { + if !p.IsSetReq() { + return MetaServiceCreateSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSnapshotResult() *MetaServiceCreateSnapshotResult { + return &MetaServiceCreateSnapshotResult{} +} + +var MetaServiceCreateSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSnapshotArgs struct { + thrift.IRequest + Req *DropSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSnapshotArgs() *MetaServiceDropSnapshotArgs { + return &MetaServiceDropSnapshotArgs{ + Req: NewDropSnapshotReq(), + } +} + +var MetaServiceDropSnapshotArgs_Req_DEFAULT *DropSnapshotReq +func (p *MetaServiceDropSnapshotArgs) GetReq() *DropSnapshotReq { + if !p.IsSetReq() { + return MetaServiceDropSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSnapshotResult() *MetaServiceDropSnapshotResult { + return &MetaServiceDropSnapshotResult{} +} + +var MetaServiceDropSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSnapshotsArgs struct { + thrift.IRequest + Req *ListSnapshotsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSnapshotsArgs() *MetaServiceListSnapshotsArgs { + return &MetaServiceListSnapshotsArgs{ + Req: NewListSnapshotsReq(), + } +} + +var MetaServiceListSnapshotsArgs_Req_DEFAULT *ListSnapshotsReq +func (p *MetaServiceListSnapshotsArgs) GetReq() *ListSnapshotsReq { + if !p.IsSetReq() { + return MetaServiceListSnapshotsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSnapshotsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSnapshotsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSnapshotsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSnapshotsResult struct { + thrift.IResponse + Success *ListSnapshotsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSnapshotsResult() *MetaServiceListSnapshotsResult { + return &MetaServiceListSnapshotsResult{} +} + +var MetaServiceListSnapshotsResult_Success_DEFAULT *ListSnapshotsResp +func (p *MetaServiceListSnapshotsResult) GetSuccess() *ListSnapshotsResp { + if !p.IsSetSuccess() { + return MetaServiceListSnapshotsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSnapshotsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSnapshotsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSnapshotsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRunAdminJobArgs struct { + thrift.IRequest + Req *AdminJobReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRunAdminJobArgs() *MetaServiceRunAdminJobArgs { + return &MetaServiceRunAdminJobArgs{ + Req: NewAdminJobReq(), + } +} + +var MetaServiceRunAdminJobArgs_Req_DEFAULT *AdminJobReq +func (p *MetaServiceRunAdminJobArgs) GetReq() *AdminJobReq { + if !p.IsSetReq() { + return MetaServiceRunAdminJobArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRunAdminJobArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAdminJobReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRunAdminJobArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRunAdminJobResult struct { + thrift.IResponse + Success *AdminJobResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRunAdminJobResult() *MetaServiceRunAdminJobResult { + return &MetaServiceRunAdminJobResult{} +} + +var MetaServiceRunAdminJobResult_Success_DEFAULT *AdminJobResp +func (p *MetaServiceRunAdminJobResult) GetSuccess() *AdminJobResp { + if !p.IsSetSuccess() { + return MetaServiceRunAdminJobResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRunAdminJobResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminJobResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRunAdminJobResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneArgs struct { + thrift.IRequest + Req *AddZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneArgs() *MetaServiceAddZoneArgs { + return &MetaServiceAddZoneArgs{ + Req: NewAddZoneReq(), + } +} + +var MetaServiceAddZoneArgs_Req_DEFAULT *AddZoneReq +func (p *MetaServiceAddZoneArgs) GetReq() *AddZoneReq { + if !p.IsSetReq() { + return MetaServiceAddZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_args"); err != nil { + 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 *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneResult() *MetaServiceAddZoneResult { + return &MetaServiceAddZoneResult{} +} + +var MetaServiceAddZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_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 *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneArgs struct { + thrift.IRequest + Req *DropZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneArgs() *MetaServiceDropZoneArgs { + return &MetaServiceDropZoneArgs{ + Req: NewDropZoneReq(), + } +} + +var MetaServiceDropZoneArgs_Req_DEFAULT *DropZoneReq +func (p *MetaServiceDropZoneArgs) GetReq() *DropZoneReq { + if !p.IsSetReq() { + return MetaServiceDropZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneResult() *MetaServiceDropZoneResult { + return &MetaServiceDropZoneResult{} +} + +var MetaServiceDropZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddHostIntoZoneArgs struct { + thrift.IRequest + Req *AddHostIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostIntoZoneArgs() *MetaServiceAddHostIntoZoneArgs { + return &MetaServiceAddHostIntoZoneArgs{ + Req: NewAddHostIntoZoneReq(), + } +} + +var MetaServiceAddHostIntoZoneArgs_Req_DEFAULT *AddHostIntoZoneReq +func (p *MetaServiceAddHostIntoZoneArgs) GetReq() *AddHostIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostIntoZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostIntoZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_args"); err != nil { + 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 *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddHostIntoZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostIntoZoneResult() *MetaServiceAddHostIntoZoneResult { + return &MetaServiceAddHostIntoZoneResult{} +} + +var MetaServiceAddHostIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostIntoZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_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 *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropHostFromZoneArgs struct { + thrift.IRequest + Req *DropHostFromZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostFromZoneArgs() *MetaServiceDropHostFromZoneArgs { + return &MetaServiceDropHostFromZoneArgs{ + Req: NewDropHostFromZoneReq(), + } +} + +var MetaServiceDropHostFromZoneArgs_Req_DEFAULT *DropHostFromZoneReq +func (p *MetaServiceDropHostFromZoneArgs) GetReq() *DropHostFromZoneReq { + if !p.IsSetReq() { + return MetaServiceDropHostFromZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostFromZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropHostFromZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_args"); err != nil { + 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 *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropHostFromZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostFromZoneResult() *MetaServiceDropHostFromZoneResult { + return &MetaServiceDropHostFromZoneResult{} +} + +var MetaServiceDropHostFromZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostFromZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostFromZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostFromZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_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 *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetZoneArgs struct { + thrift.IRequest + Req *GetZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetZoneArgs() *MetaServiceGetZoneArgs { + return &MetaServiceGetZoneArgs{ + Req: NewGetZoneReq(), + } +} + +var MetaServiceGetZoneArgs_Req_DEFAULT *GetZoneReq +func (p *MetaServiceGetZoneArgs) GetReq() *GetZoneReq { + if !p.IsSetReq() { + return MetaServiceGetZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetZoneResult struct { + thrift.IResponse + Success *GetZoneResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetZoneResult() *MetaServiceGetZoneResult { + return &MetaServiceGetZoneResult{} +} + +var MetaServiceGetZoneResult_Success_DEFAULT *GetZoneResp +func (p *MetaServiceGetZoneResult) GetSuccess() *GetZoneResp { + if !p.IsSetSuccess() { + return MetaServiceGetZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetZoneResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListZonesArgs struct { + thrift.IRequest + Req *ListZonesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListZonesArgs() *MetaServiceListZonesArgs { + return &MetaServiceListZonesArgs{ + Req: NewListZonesReq(), + } +} + +var MetaServiceListZonesArgs_Req_DEFAULT *ListZonesReq +func (p *MetaServiceListZonesArgs) GetReq() *ListZonesReq { + if !p.IsSetReq() { + return MetaServiceListZonesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListZonesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListZonesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListZonesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListZonesResult struct { + thrift.IResponse + Success *ListZonesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListZonesResult() *MetaServiceListZonesResult { + return &MetaServiceListZonesResult{} +} + +var MetaServiceListZonesResult_Success_DEFAULT *ListZonesResp +func (p *MetaServiceListZonesResult) GetSuccess() *ListZonesResp { + if !p.IsSetSuccess() { + return MetaServiceListZonesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListZonesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListZonesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListZonesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddGroupArgs struct { + thrift.IRequest + Req *AddGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddGroupArgs() *MetaServiceAddGroupArgs { + return &MetaServiceAddGroupArgs{ + Req: NewAddGroupReq(), + } +} + +var MetaServiceAddGroupArgs_Req_DEFAULT *AddGroupReq +func (p *MetaServiceAddGroupArgs) GetReq() *AddGroupReq { + if !p.IsSetReq() { + return MetaServiceAddGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddGroupResult() *MetaServiceAddGroupResult { + return &MetaServiceAddGroupResult{} +} + +var MetaServiceAddGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropGroupArgs struct { + thrift.IRequest + Req *DropGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropGroupArgs() *MetaServiceDropGroupArgs { + return &MetaServiceDropGroupArgs{ + Req: NewDropGroupReq(), + } +} + +var MetaServiceDropGroupArgs_Req_DEFAULT *DropGroupReq +func (p *MetaServiceDropGroupArgs) GetReq() *DropGroupReq { + if !p.IsSetReq() { + return MetaServiceDropGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropGroupResult() *MetaServiceDropGroupResult { + return &MetaServiceDropGroupResult{} +} + +var MetaServiceDropGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneIntoGroupArgs struct { + thrift.IRequest + Req *AddZoneIntoGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneIntoGroupArgs() *MetaServiceAddZoneIntoGroupArgs { + return &MetaServiceAddZoneIntoGroupArgs{ + Req: NewAddZoneIntoGroupReq(), + } +} + +var MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT *AddZoneIntoGroupReq +func (p *MetaServiceAddZoneIntoGroupArgs) GetReq() *AddZoneIntoGroupReq { + if !p.IsSetReq() { + return MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneIntoGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneIntoGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneIntoGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneIntoGroupResult() *MetaServiceAddZoneIntoGroupResult { + return &MetaServiceAddZoneIntoGroupResult{} +} + +var MetaServiceAddZoneIntoGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneIntoGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneIntoGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneIntoGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneFromGroupArgs struct { + thrift.IRequest + Req *DropZoneFromGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneFromGroupArgs() *MetaServiceDropZoneFromGroupArgs { + return &MetaServiceDropZoneFromGroupArgs{ + Req: NewDropZoneFromGroupReq(), + } +} + +var MetaServiceDropZoneFromGroupArgs_Req_DEFAULT *DropZoneFromGroupReq +func (p *MetaServiceDropZoneFromGroupArgs) GetReq() *DropZoneFromGroupReq { + if !p.IsSetReq() { + return MetaServiceDropZoneFromGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneFromGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneFromGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneFromGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneFromGroupResult() *MetaServiceDropZoneFromGroupResult { + return &MetaServiceDropZoneFromGroupResult{} +} + +var MetaServiceDropZoneFromGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneFromGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneFromGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneFromGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetGroupArgs struct { + thrift.IRequest + Req *GetGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetGroupArgs() *MetaServiceGetGroupArgs { + return &MetaServiceGetGroupArgs{ + Req: NewGetGroupReq(), + } +} + +var MetaServiceGetGroupArgs_Req_DEFAULT *GetGroupReq +func (p *MetaServiceGetGroupArgs) GetReq() *GetGroupReq { + if !p.IsSetReq() { + return MetaServiceGetGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetGroupResult struct { + thrift.IResponse + Success *GetGroupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetGroupResult() *MetaServiceGetGroupResult { + return &MetaServiceGetGroupResult{} +} + +var MetaServiceGetGroupResult_Success_DEFAULT *GetGroupResp +func (p *MetaServiceGetGroupResult) GetSuccess() *GetGroupResp { + if !p.IsSetSuccess() { + return MetaServiceGetGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetGroupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListGroupsArgs struct { + thrift.IRequest + Req *ListGroupsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListGroupsArgs() *MetaServiceListGroupsArgs { + return &MetaServiceListGroupsArgs{ + Req: NewListGroupsReq(), + } +} + +var MetaServiceListGroupsArgs_Req_DEFAULT *ListGroupsReq +func (p *MetaServiceListGroupsArgs) GetReq() *ListGroupsReq { + if !p.IsSetReq() { + return MetaServiceListGroupsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListGroupsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListGroupsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListGroupsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListGroupsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListGroupsResult struct { + thrift.IResponse + Success *ListGroupsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListGroupsResult() *MetaServiceListGroupsResult { + return &MetaServiceListGroupsResult{} +} + +var MetaServiceListGroupsResult_Success_DEFAULT *ListGroupsResp +func (p *MetaServiceListGroupsResult) GetSuccess() *ListGroupsResp { + if !p.IsSetSuccess() { + return MetaServiceListGroupsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListGroupsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListGroupsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListGroupsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListGroupsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateBackupArgs struct { + thrift.IRequest + Req *CreateBackupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateBackupArgs() *MetaServiceCreateBackupArgs { + return &MetaServiceCreateBackupArgs{ + Req: NewCreateBackupReq(), + } +} + +var MetaServiceCreateBackupArgs_Req_DEFAULT *CreateBackupReq +func (p *MetaServiceCreateBackupArgs) GetReq() *CreateBackupReq { + if !p.IsSetReq() { + return MetaServiceCreateBackupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateBackupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateBackupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateBackupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateBackupResult struct { + thrift.IResponse + Success *CreateBackupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateBackupResult() *MetaServiceCreateBackupResult { + return &MetaServiceCreateBackupResult{} +} + +var MetaServiceCreateBackupResult_Success_DEFAULT *CreateBackupResp +func (p *MetaServiceCreateBackupResult) GetSuccess() *CreateBackupResp { + if !p.IsSetSuccess() { + return MetaServiceCreateBackupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateBackupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateBackupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateBackupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRestoreMetaArgs struct { + thrift.IRequest + Req *RestoreMetaReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRestoreMetaArgs() *MetaServiceRestoreMetaArgs { + return &MetaServiceRestoreMetaArgs{ + Req: NewRestoreMetaReq(), + } +} + +var MetaServiceRestoreMetaArgs_Req_DEFAULT *RestoreMetaReq +func (p *MetaServiceRestoreMetaArgs) GetReq() *RestoreMetaReq { + if !p.IsSetReq() { + return MetaServiceRestoreMetaArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRestoreMetaArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRestoreMetaReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRestoreMetaArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRestoreMetaResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { + return &MetaServiceRestoreMetaResult{} +} + +var MetaServiceRestoreMetaResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRestoreMetaResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRestoreMetaResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddListenerArgs struct { + thrift.IRequest + Req *AddListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddListenerArgs() *MetaServiceAddListenerArgs { + return &MetaServiceAddListenerArgs{ + Req: NewAddListenerReq(), + } +} + +var MetaServiceAddListenerArgs_Req_DEFAULT *AddListenerReq +func (p *MetaServiceAddListenerArgs) GetReq() *AddListenerReq { + if !p.IsSetReq() { + return MetaServiceAddListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddListenerResult() *MetaServiceAddListenerResult { + return &MetaServiceAddListenerResult{} +} + +var MetaServiceAddListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveListenerArgs struct { + thrift.IRequest + Req *RemoveListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveListenerArgs() *MetaServiceRemoveListenerArgs { + return &MetaServiceRemoveListenerArgs{ + Req: NewRemoveListenerReq(), + } +} + +var MetaServiceRemoveListenerArgs_Req_DEFAULT *RemoveListenerReq +func (p *MetaServiceRemoveListenerArgs) GetReq() *RemoveListenerReq { + if !p.IsSetReq() { + return MetaServiceRemoveListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveListenerResult() *MetaServiceRemoveListenerResult { + return &MetaServiceRemoveListenerResult{} +} + +var MetaServiceRemoveListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListListenerArgs struct { + thrift.IRequest + Req *ListListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListListenerArgs() *MetaServiceListListenerArgs { + return &MetaServiceListListenerArgs{ + Req: NewListListenerReq(), + } +} + +var MetaServiceListListenerArgs_Req_DEFAULT *ListListenerReq +func (p *MetaServiceListListenerArgs) GetReq() *ListListenerReq { + if !p.IsSetReq() { + return MetaServiceListListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListListenerResult struct { + thrift.IResponse + Success *ListListenerResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListListenerResult() *MetaServiceListListenerResult { + return &MetaServiceListListenerResult{} +} + +var MetaServiceListListenerResult_Success_DEFAULT *ListListenerResp +func (p *MetaServiceListListenerResult) GetSuccess() *ListListenerResp { + if !p.IsSetSuccess() { + return MetaServiceListListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListListenerResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetStatisArgs struct { + thrift.IRequest + Req *GetStatisReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetStatisArgs() *MetaServiceGetStatisArgs { + return &MetaServiceGetStatisArgs{ + Req: NewGetStatisReq(), + } +} + +var MetaServiceGetStatisArgs_Req_DEFAULT *GetStatisReq +func (p *MetaServiceGetStatisArgs) GetReq() *GetStatisReq { + if !p.IsSetReq() { + return MetaServiceGetStatisArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetStatisArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetStatisReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetStatisArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisArgs) 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 *MetaServiceGetStatisArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetStatisArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetStatisResult struct { + thrift.IResponse + Success *GetStatisResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetStatisResult() *MetaServiceGetStatisResult { + return &MetaServiceGetStatisResult{} +} + +var MetaServiceGetStatisResult_Success_DEFAULT *GetStatisResp +func (p *MetaServiceGetStatisResult) GetSuccess() *GetStatisResp { + if !p.IsSetSuccess() { + return MetaServiceGetStatisResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetStatisResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetStatisResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetStatisResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStatis_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 *MetaServiceGetStatisResult) 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 *MetaServiceGetStatisResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetStatisResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignInFTServiceArgs struct { + thrift.IRequest + Req *SignInFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignInFTServiceArgs() *MetaServiceSignInFTServiceArgs { + return &MetaServiceSignInFTServiceArgs{ + Req: NewSignInFTServiceReq(), + } +} + +var MetaServiceSignInFTServiceArgs_Req_DEFAULT *SignInFTServiceReq +func (p *MetaServiceSignInFTServiceArgs) GetReq() *SignInFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignInFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignInFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignInFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignInFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignInFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignInFTServiceResult() *MetaServiceSignInFTServiceResult { + return &MetaServiceSignInFTServiceResult{} +} + +var MetaServiceSignInFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignInFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignInFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignInFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignInFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignOutFTServiceArgs struct { + thrift.IRequest + Req *SignOutFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignOutFTServiceArgs() *MetaServiceSignOutFTServiceArgs { + return &MetaServiceSignOutFTServiceArgs{ + Req: NewSignOutFTServiceReq(), + } +} + +var MetaServiceSignOutFTServiceArgs_Req_DEFAULT *SignOutFTServiceReq +func (p *MetaServiceSignOutFTServiceArgs) GetReq() *SignOutFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignOutFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignOutFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignOutFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignOutFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignOutFTServiceResult() *MetaServiceSignOutFTServiceResult { + return &MetaServiceSignOutFTServiceResult{} +} + +var MetaServiceSignOutFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignOutFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignOutFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignOutFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTClientsArgs struct { + thrift.IRequest + Req *ListFTClientsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTClientsArgs() *MetaServiceListFTClientsArgs { + return &MetaServiceListFTClientsArgs{ + Req: NewListFTClientsReq(), + } +} + +var MetaServiceListFTClientsArgs_Req_DEFAULT *ListFTClientsReq +func (p *MetaServiceListFTClientsArgs) GetReq() *ListFTClientsReq { + if !p.IsSetReq() { + return MetaServiceListFTClientsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTClientsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTClientsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTClientsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTClientsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTClientsResult struct { + thrift.IResponse + Success *ListFTClientsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTClientsResult() *MetaServiceListFTClientsResult { + return &MetaServiceListFTClientsResult{} +} + +var MetaServiceListFTClientsResult_Success_DEFAULT *ListFTClientsResp +func (p *MetaServiceListFTClientsResult) GetSuccess() *ListFTClientsResp { + if !p.IsSetSuccess() { + return MetaServiceListFTClientsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTClientsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTClientsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTClientsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTClientsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateFTIndexArgs struct { + thrift.IRequest + Req *CreateFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateFTIndexArgs() *MetaServiceCreateFTIndexArgs { + return &MetaServiceCreateFTIndexArgs{ + Req: NewCreateFTIndexReq(), + } +} + +var MetaServiceCreateFTIndexArgs_Req_DEFAULT *CreateFTIndexReq +func (p *MetaServiceCreateFTIndexArgs) GetReq() *CreateFTIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateFTIndexResult() *MetaServiceCreateFTIndexResult { + return &MetaServiceCreateFTIndexResult{} +} + +var MetaServiceCreateFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropFTIndexArgs struct { + thrift.IRequest + Req *DropFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropFTIndexArgs() *MetaServiceDropFTIndexArgs { + return &MetaServiceDropFTIndexArgs{ + Req: NewDropFTIndexReq(), + } +} + +var MetaServiceDropFTIndexArgs_Req_DEFAULT *DropFTIndexReq +func (p *MetaServiceDropFTIndexArgs) GetReq() *DropFTIndexReq { + if !p.IsSetReq() { + return MetaServiceDropFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropFTIndexResult() *MetaServiceDropFTIndexResult { + return &MetaServiceDropFTIndexResult{} +} + +var MetaServiceDropFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTIndexesArgs struct { + thrift.IRequest + Req *ListFTIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTIndexesArgs() *MetaServiceListFTIndexesArgs { + return &MetaServiceListFTIndexesArgs{ + Req: NewListFTIndexesReq(), + } +} + +var MetaServiceListFTIndexesArgs_Req_DEFAULT *ListFTIndexesReq +func (p *MetaServiceListFTIndexesArgs) GetReq() *ListFTIndexesReq { + if !p.IsSetReq() { + return MetaServiceListFTIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTIndexesResult struct { + thrift.IResponse + Success *ListFTIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTIndexesResult() *MetaServiceListFTIndexesResult { + return &MetaServiceListFTIndexesResult{} +} + +var MetaServiceListFTIndexesResult_Success_DEFAULT *ListFTIndexesResp +func (p *MetaServiceListFTIndexesResult) GetSuccess() *ListFTIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListFTIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSessionArgs struct { + thrift.IRequest + Req *CreateSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSessionArgs() *MetaServiceCreateSessionArgs { + return &MetaServiceCreateSessionArgs{ + Req: NewCreateSessionReq(), + } +} + +var MetaServiceCreateSessionArgs_Req_DEFAULT *CreateSessionReq +func (p *MetaServiceCreateSessionArgs) GetReq() *CreateSessionReq { + if !p.IsSetReq() { + return MetaServiceCreateSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSessionResult struct { + thrift.IResponse + Success *CreateSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSessionResult() *MetaServiceCreateSessionResult { + return &MetaServiceCreateSessionResult{} +} + +var MetaServiceCreateSessionResult_Success_DEFAULT *CreateSessionResp +func (p *MetaServiceCreateSessionResult) GetSuccess() *CreateSessionResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceUpdateSessionsArgs struct { + thrift.IRequest + Req *UpdateSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceUpdateSessionsArgs() *MetaServiceUpdateSessionsArgs { + return &MetaServiceUpdateSessionsArgs{ + Req: NewUpdateSessionsReq(), + } +} + +var MetaServiceUpdateSessionsArgs_Req_DEFAULT *UpdateSessionsReq +func (p *MetaServiceUpdateSessionsArgs) GetReq() *UpdateSessionsReq { + if !p.IsSetReq() { + return MetaServiceUpdateSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceUpdateSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceUpdateSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceUpdateSessionsResult struct { + thrift.IResponse + Success *UpdateSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceUpdateSessionsResult() *MetaServiceUpdateSessionsResult { + return &MetaServiceUpdateSessionsResult{} +} + +var MetaServiceUpdateSessionsResult_Success_DEFAULT *UpdateSessionsResp +func (p *MetaServiceUpdateSessionsResult) GetSuccess() *UpdateSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceUpdateSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceUpdateSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceUpdateSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSessionsArgs struct { + thrift.IRequest + Req *ListSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSessionsArgs() *MetaServiceListSessionsArgs { + return &MetaServiceListSessionsArgs{ + Req: NewListSessionsReq(), + } +} + +var MetaServiceListSessionsArgs_Req_DEFAULT *ListSessionsReq +func (p *MetaServiceListSessionsArgs) GetReq() *ListSessionsReq { + if !p.IsSetReq() { + return MetaServiceListSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSessionsResult struct { + thrift.IResponse + Success *ListSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSessionsResult() *MetaServiceListSessionsResult { + return &MetaServiceListSessionsResult{} +} + +var MetaServiceListSessionsResult_Success_DEFAULT *ListSessionsResp +func (p *MetaServiceListSessionsResult) GetSuccess() *ListSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceListSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSessionArgs struct { + thrift.IRequest + Req *GetSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSessionArgs() *MetaServiceGetSessionArgs { + return &MetaServiceGetSessionArgs{ + Req: NewGetSessionReq(), + } +} + +var MetaServiceGetSessionArgs_Req_DEFAULT *GetSessionReq +func (p *MetaServiceGetSessionArgs) GetReq() *GetSessionReq { + if !p.IsSetReq() { + return MetaServiceGetSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSessionResult struct { + thrift.IResponse + Success *GetSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSessionResult() *MetaServiceGetSessionResult { + return &MetaServiceGetSessionResult{} +} + +var MetaServiceGetSessionResult_Success_DEFAULT *GetSessionResp +func (p *MetaServiceGetSessionResult) GetSuccess() *GetSessionResp { + if !p.IsSetSuccess() { + return MetaServiceGetSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveSessionArgs struct { + thrift.IRequest + Req *RemoveSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveSessionArgs() *MetaServiceRemoveSessionArgs { + return &MetaServiceRemoveSessionArgs{ + Req: NewRemoveSessionReq(), + } +} + +var MetaServiceRemoveSessionArgs_Req_DEFAULT *RemoveSessionReq +func (p *MetaServiceRemoveSessionArgs) GetReq() *RemoveSessionReq { + if !p.IsSetReq() { + return MetaServiceRemoveSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveSessionResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveSessionResult() *MetaServiceRemoveSessionResult { + return &MetaServiceRemoveSessionResult{} +} + +var MetaServiceRemoveSessionResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveSessionResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceKillQueryArgs struct { + thrift.IRequest + Req *KillQueryReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceKillQueryArgs() *MetaServiceKillQueryArgs { + return &MetaServiceKillQueryArgs{ + Req: NewKillQueryReq(), + } +} + +var MetaServiceKillQueryArgs_Req_DEFAULT *KillQueryReq +func (p *MetaServiceKillQueryArgs) GetReq() *KillQueryReq { + if !p.IsSetReq() { + return MetaServiceKillQueryArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceKillQueryArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKillQueryReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceKillQueryArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceKillQueryArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceKillQueryResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceKillQueryResult() *MetaServiceKillQueryResult { + return &MetaServiceKillQueryResult{} +} + +var MetaServiceKillQueryResult_Success_DEFAULT *ExecResp +func (p *MetaServiceKillQueryResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceKillQueryResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceKillQueryResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceKillQueryResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceKillQueryResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceReportTaskFinishArgs struct { + thrift.IRequest + Req *ReportTaskReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceReportTaskFinishArgs() *MetaServiceReportTaskFinishArgs { + return &MetaServiceReportTaskFinishArgs{ + Req: NewReportTaskReq(), + } +} + +var MetaServiceReportTaskFinishArgs_Req_DEFAULT *ReportTaskReq +func (p *MetaServiceReportTaskFinishArgs) GetReq() *ReportTaskReq { + if !p.IsSetReq() { + return MetaServiceReportTaskFinishArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceReportTaskFinishArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewReportTaskReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceReportTaskFinishArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceReportTaskFinishResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceReportTaskFinishResult() *MetaServiceReportTaskFinishResult { + return &MetaServiceReportTaskFinishResult{} +} + +var MetaServiceReportTaskFinishResult_Success_DEFAULT *ExecResp +func (p *MetaServiceReportTaskFinishResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceReportTaskFinishResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceReportTaskFinishResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceReportTaskFinishResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListClusterArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListClusterArgs() *MetaServiceListClusterArgs { + return &MetaServiceListClusterArgs{ + Req: NewListClusterInfoReq(), + } +} + +var MetaServiceListClusterArgs_Req_DEFAULT *ListClusterInfoReq +func (p *MetaServiceListClusterArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return MetaServiceListClusterArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListClusterArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListClusterArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListClusterArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListClusterResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListClusterResult() *MetaServiceListClusterResult { + return &MetaServiceListClusterResult{} +} + +var MetaServiceListClusterResult_Success_DEFAULT *ListClusterInfoResp +func (p *MetaServiceListClusterResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return MetaServiceListClusterResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListClusterResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListClusterResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListClusterResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetMetaDirInfoArgs struct { + thrift.IRequest + Req *GetMetaDirInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetMetaDirInfoArgs() *MetaServiceGetMetaDirInfoArgs { + return &MetaServiceGetMetaDirInfoArgs{ + Req: NewGetMetaDirInfoReq(), + } +} + +var MetaServiceGetMetaDirInfoArgs_Req_DEFAULT *GetMetaDirInfoReq +func (p *MetaServiceGetMetaDirInfoArgs) GetReq() *GetMetaDirInfoReq { + if !p.IsSetReq() { + return MetaServiceGetMetaDirInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetMetaDirInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetMetaDirInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetMetaDirInfoResult struct { + thrift.IResponse + Success *GetMetaDirInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetMetaDirInfoResult() *MetaServiceGetMetaDirInfoResult { + return &MetaServiceGetMetaDirInfoResult{} +} + +var MetaServiceGetMetaDirInfoResult_Success_DEFAULT *GetMetaDirInfoResp +func (p *MetaServiceGetMetaDirInfoResult) GetSuccess() *GetMetaDirInfoResp { + if !p.IsSetSuccess() { + return MetaServiceGetMetaDirInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetMetaDirInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetMetaDirInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_1/meta/ttypes.go b/ccore/nebula/internal/thrift/v2_5_1/meta/ttypes.go new file mode 100644 index 0000000..f507504 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/meta/ttypes.go @@ -0,0 +1,29680 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + "sync" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int + +type AlterSchemaOp int64 + +const ( + AlterSchemaOp_ADD AlterSchemaOp = 1 + AlterSchemaOp_CHANGE AlterSchemaOp = 2 + AlterSchemaOp_DROP AlterSchemaOp = 3 + AlterSchemaOp_UNKNOWN AlterSchemaOp = 4 +) + +var AlterSchemaOpToName = map[AlterSchemaOp]string{ + AlterSchemaOp_ADD: "ADD", + AlterSchemaOp_CHANGE: "CHANGE", + AlterSchemaOp_DROP: "DROP", + AlterSchemaOp_UNKNOWN: "UNKNOWN", +} + +var AlterSchemaOpToValue = map[string]AlterSchemaOp{ + "ADD": AlterSchemaOp_ADD, + "CHANGE": AlterSchemaOp_CHANGE, + "DROP": AlterSchemaOp_DROP, + "UNKNOWN": AlterSchemaOp_UNKNOWN, +} + +var AlterSchemaOpNames = []string{ + "ADD", + "CHANGE", + "DROP", + "UNKNOWN", +} + +var AlterSchemaOpValues = []AlterSchemaOp{ + AlterSchemaOp_ADD, + AlterSchemaOp_CHANGE, + AlterSchemaOp_DROP, + AlterSchemaOp_UNKNOWN, +} + +func (p AlterSchemaOp) String() string { + if v, ok := AlterSchemaOpToName[p]; ok { + return v + } + return "" +} + +func AlterSchemaOpFromString(s string) (AlterSchemaOp, error) { + if v, ok := AlterSchemaOpToValue[s]; ok { + return v, nil + } + return AlterSchemaOp(0), fmt.Errorf("not a valid AlterSchemaOp string") +} + +func AlterSchemaOpPtr(v AlterSchemaOp) *AlterSchemaOp { return &v } + +type RoleType int64 + +const ( + RoleType_GOD RoleType = 1 + RoleType_ADMIN RoleType = 2 + RoleType_DBA RoleType = 3 + RoleType_USER RoleType = 4 + RoleType_GUEST RoleType = 5 +) + +var RoleTypeToName = map[RoleType]string{ + RoleType_GOD: "GOD", + RoleType_ADMIN: "ADMIN", + RoleType_DBA: "DBA", + RoleType_USER: "USER", + RoleType_GUEST: "GUEST", +} + +var RoleTypeToValue = map[string]RoleType{ + "GOD": RoleType_GOD, + "ADMIN": RoleType_ADMIN, + "DBA": RoleType_DBA, + "USER": RoleType_USER, + "GUEST": RoleType_GUEST, +} + +var RoleTypeNames = []string{ + "GOD", + "ADMIN", + "DBA", + "USER", + "GUEST", +} + +var RoleTypeValues = []RoleType{ + RoleType_GOD, + RoleType_ADMIN, + RoleType_DBA, + RoleType_USER, + RoleType_GUEST, +} + +func (p RoleType) String() string { + if v, ok := RoleTypeToName[p]; ok { + return v + } + return "" +} + +func RoleTypeFromString(s string) (RoleType, error) { + if v, ok := RoleTypeToValue[s]; ok { + return v, nil + } + return RoleType(0), fmt.Errorf("not a valid RoleType string") +} + +func RoleTypePtr(v RoleType) *RoleType { return &v } + +type PropertyType int64 + +const ( + PropertyType_UNKNOWN PropertyType = 0 + PropertyType_BOOL PropertyType = 1 + PropertyType_INT64 PropertyType = 2 + PropertyType_VID PropertyType = 3 + PropertyType_FLOAT PropertyType = 4 + PropertyType_DOUBLE PropertyType = 5 + PropertyType_STRING PropertyType = 6 + PropertyType_FIXED_STRING PropertyType = 7 + PropertyType_INT8 PropertyType = 8 + PropertyType_INT16 PropertyType = 9 + PropertyType_INT32 PropertyType = 10 + PropertyType_TIMESTAMP PropertyType = 21 + PropertyType_DATE PropertyType = 24 + PropertyType_DATETIME PropertyType = 25 + PropertyType_TIME PropertyType = 26 +) + +var PropertyTypeToName = map[PropertyType]string{ + PropertyType_UNKNOWN: "UNKNOWN", + PropertyType_BOOL: "BOOL", + PropertyType_INT64: "INT64", + PropertyType_VID: "VID", + PropertyType_FLOAT: "FLOAT", + PropertyType_DOUBLE: "DOUBLE", + PropertyType_STRING: "STRING", + PropertyType_FIXED_STRING: "FIXED_STRING", + PropertyType_INT8: "INT8", + PropertyType_INT16: "INT16", + PropertyType_INT32: "INT32", + PropertyType_TIMESTAMP: "TIMESTAMP", + PropertyType_DATE: "DATE", + PropertyType_DATETIME: "DATETIME", + PropertyType_TIME: "TIME", +} + +var PropertyTypeToValue = map[string]PropertyType{ + "UNKNOWN": PropertyType_UNKNOWN, + "BOOL": PropertyType_BOOL, + "INT64": PropertyType_INT64, + "VID": PropertyType_VID, + "FLOAT": PropertyType_FLOAT, + "DOUBLE": PropertyType_DOUBLE, + "STRING": PropertyType_STRING, + "FIXED_STRING": PropertyType_FIXED_STRING, + "INT8": PropertyType_INT8, + "INT16": PropertyType_INT16, + "INT32": PropertyType_INT32, + "TIMESTAMP": PropertyType_TIMESTAMP, + "DATE": PropertyType_DATE, + "DATETIME": PropertyType_DATETIME, + "TIME": PropertyType_TIME, +} + +var PropertyTypeNames = []string{ + "UNKNOWN", + "BOOL", + "INT64", + "VID", + "FLOAT", + "DOUBLE", + "STRING", + "FIXED_STRING", + "INT8", + "INT16", + "INT32", + "TIMESTAMP", + "DATE", + "DATETIME", + "TIME", +} + +var PropertyTypeValues = []PropertyType{ + PropertyType_UNKNOWN, + PropertyType_BOOL, + PropertyType_INT64, + PropertyType_VID, + PropertyType_FLOAT, + PropertyType_DOUBLE, + PropertyType_STRING, + PropertyType_FIXED_STRING, + PropertyType_INT8, + PropertyType_INT16, + PropertyType_INT32, + PropertyType_TIMESTAMP, + PropertyType_DATE, + PropertyType_DATETIME, + PropertyType_TIME, +} + +func (p PropertyType) String() string { + if v, ok := PropertyTypeToName[p]; ok { + return v + } + return "" +} + +func PropertyTypeFromString(s string) (PropertyType, error) { + if v, ok := PropertyTypeToValue[s]; ok { + return v, nil + } + return PropertyType(0), fmt.Errorf("not a valid PropertyType string") +} + +func PropertyTypePtr(v PropertyType) *PropertyType { return &v } + +type IsolationLevel int64 + +const ( + IsolationLevel_DEFAULT IsolationLevel = 0 + IsolationLevel_TOSS IsolationLevel = 1 +) + +var IsolationLevelToName = map[IsolationLevel]string{ + IsolationLevel_DEFAULT: "DEFAULT", + IsolationLevel_TOSS: "TOSS", +} + +var IsolationLevelToValue = map[string]IsolationLevel{ + "DEFAULT": IsolationLevel_DEFAULT, + "TOSS": IsolationLevel_TOSS, +} + +var IsolationLevelNames = []string{ + "DEFAULT", + "TOSS", +} + +var IsolationLevelValues = []IsolationLevel{ + IsolationLevel_DEFAULT, + IsolationLevel_TOSS, +} + +func (p IsolationLevel) String() string { + if v, ok := IsolationLevelToName[p]; ok { + return v + } + return "" +} + +func IsolationLevelFromString(s string) (IsolationLevel, error) { + if v, ok := IsolationLevelToValue[s]; ok { + return v, nil + } + return IsolationLevel(0), fmt.Errorf("not a valid IsolationLevel string") +} + +func IsolationLevelPtr(v IsolationLevel) *IsolationLevel { return &v } + +type HostStatus int64 + +const ( + HostStatus_ONLINE HostStatus = 0 + HostStatus_OFFLINE HostStatus = 1 + HostStatus_UNKNOWN HostStatus = 2 +) + +var HostStatusToName = map[HostStatus]string{ + HostStatus_ONLINE: "ONLINE", + HostStatus_OFFLINE: "OFFLINE", + HostStatus_UNKNOWN: "UNKNOWN", +} + +var HostStatusToValue = map[string]HostStatus{ + "ONLINE": HostStatus_ONLINE, + "OFFLINE": HostStatus_OFFLINE, + "UNKNOWN": HostStatus_UNKNOWN, +} + +var HostStatusNames = []string{ + "ONLINE", + "OFFLINE", + "UNKNOWN", +} + +var HostStatusValues = []HostStatus{ + HostStatus_ONLINE, + HostStatus_OFFLINE, + HostStatus_UNKNOWN, +} + +func (p HostStatus) String() string { + if v, ok := HostStatusToName[p]; ok { + return v + } + return "" +} + +func HostStatusFromString(s string) (HostStatus, error) { + if v, ok := HostStatusToValue[s]; ok { + return v, nil + } + return HostStatus(0), fmt.Errorf("not a valid HostStatus string") +} + +func HostStatusPtr(v HostStatus) *HostStatus { return &v } + +type SnapshotStatus int64 + +const ( + SnapshotStatus_VALID SnapshotStatus = 0 + SnapshotStatus_INVALID SnapshotStatus = 1 +) + +var SnapshotStatusToName = map[SnapshotStatus]string{ + SnapshotStatus_VALID: "VALID", + SnapshotStatus_INVALID: "INVALID", +} + +var SnapshotStatusToValue = map[string]SnapshotStatus{ + "VALID": SnapshotStatus_VALID, + "INVALID": SnapshotStatus_INVALID, +} + +var SnapshotStatusNames = []string{ + "VALID", + "INVALID", +} + +var SnapshotStatusValues = []SnapshotStatus{ + SnapshotStatus_VALID, + SnapshotStatus_INVALID, +} + +func (p SnapshotStatus) String() string { + if v, ok := SnapshotStatusToName[p]; ok { + return v + } + return "" +} + +func SnapshotStatusFromString(s string) (SnapshotStatus, error) { + if v, ok := SnapshotStatusToValue[s]; ok { + return v, nil + } + return SnapshotStatus(0), fmt.Errorf("not a valid SnapshotStatus string") +} + +func SnapshotStatusPtr(v SnapshotStatus) *SnapshotStatus { return &v } + +type AdminJobOp int64 + +const ( + AdminJobOp_ADD AdminJobOp = 1 + AdminJobOp_SHOW_All AdminJobOp = 2 + AdminJobOp_SHOW AdminJobOp = 3 + AdminJobOp_STOP AdminJobOp = 4 + AdminJobOp_RECOVER AdminJobOp = 5 +) + +var AdminJobOpToName = map[AdminJobOp]string{ + AdminJobOp_ADD: "ADD", + AdminJobOp_SHOW_All: "SHOW_All", + AdminJobOp_SHOW: "SHOW", + AdminJobOp_STOP: "STOP", + AdminJobOp_RECOVER: "RECOVER", +} + +var AdminJobOpToValue = map[string]AdminJobOp{ + "ADD": AdminJobOp_ADD, + "SHOW_All": AdminJobOp_SHOW_All, + "SHOW": AdminJobOp_SHOW, + "STOP": AdminJobOp_STOP, + "RECOVER": AdminJobOp_RECOVER, +} + +var AdminJobOpNames = []string{ + "ADD", + "SHOW_All", + "SHOW", + "STOP", + "RECOVER", +} + +var AdminJobOpValues = []AdminJobOp{ + AdminJobOp_ADD, + AdminJobOp_SHOW_All, + AdminJobOp_SHOW, + AdminJobOp_STOP, + AdminJobOp_RECOVER, +} + +func (p AdminJobOp) String() string { + if v, ok := AdminJobOpToName[p]; ok { + return v + } + return "" +} + +func AdminJobOpFromString(s string) (AdminJobOp, error) { + if v, ok := AdminJobOpToValue[s]; ok { + return v, nil + } + return AdminJobOp(0), fmt.Errorf("not a valid AdminJobOp string") +} + +func AdminJobOpPtr(v AdminJobOp) *AdminJobOp { return &v } + +type AdminCmd int64 + +const ( + AdminCmd_COMPACT AdminCmd = 0 + AdminCmd_FLUSH AdminCmd = 1 + AdminCmd_REBUILD_TAG_INDEX AdminCmd = 2 + AdminCmd_REBUILD_EDGE_INDEX AdminCmd = 3 + AdminCmd_REBUILD_FULLTEXT_INDEX AdminCmd = 4 + AdminCmd_STATS AdminCmd = 5 + AdminCmd_DATA_BALANCE AdminCmd = 6 + AdminCmd_DOWNLOAD AdminCmd = 7 + AdminCmd_INGEST AdminCmd = 8 + AdminCmd_UNKNOWN AdminCmd = 99 +) + +var AdminCmdToName = map[AdminCmd]string{ + AdminCmd_COMPACT: "COMPACT", + AdminCmd_FLUSH: "FLUSH", + AdminCmd_REBUILD_TAG_INDEX: "REBUILD_TAG_INDEX", + AdminCmd_REBUILD_EDGE_INDEX: "REBUILD_EDGE_INDEX", + AdminCmd_REBUILD_FULLTEXT_INDEX: "REBUILD_FULLTEXT_INDEX", + AdminCmd_STATS: "STATS", + AdminCmd_DATA_BALANCE: "DATA_BALANCE", + AdminCmd_DOWNLOAD: "DOWNLOAD", + AdminCmd_INGEST: "INGEST", + AdminCmd_UNKNOWN: "UNKNOWN", +} + +var AdminCmdToValue = map[string]AdminCmd{ + "COMPACT": AdminCmd_COMPACT, + "FLUSH": AdminCmd_FLUSH, + "REBUILD_TAG_INDEX": AdminCmd_REBUILD_TAG_INDEX, + "REBUILD_EDGE_INDEX": AdminCmd_REBUILD_EDGE_INDEX, + "REBUILD_FULLTEXT_INDEX": AdminCmd_REBUILD_FULLTEXT_INDEX, + "STATS": AdminCmd_STATS, + "DATA_BALANCE": AdminCmd_DATA_BALANCE, + "DOWNLOAD": AdminCmd_DOWNLOAD, + "INGEST": AdminCmd_INGEST, + "UNKNOWN": AdminCmd_UNKNOWN, +} + +var AdminCmdNames = []string{ + "COMPACT", + "FLUSH", + "REBUILD_TAG_INDEX", + "REBUILD_EDGE_INDEX", + "REBUILD_FULLTEXT_INDEX", + "STATS", + "DATA_BALANCE", + "DOWNLOAD", + "INGEST", + "UNKNOWN", +} + +var AdminCmdValues = []AdminCmd{ + AdminCmd_COMPACT, + AdminCmd_FLUSH, + AdminCmd_REBUILD_TAG_INDEX, + AdminCmd_REBUILD_EDGE_INDEX, + AdminCmd_REBUILD_FULLTEXT_INDEX, + AdminCmd_STATS, + AdminCmd_DATA_BALANCE, + AdminCmd_DOWNLOAD, + AdminCmd_INGEST, + AdminCmd_UNKNOWN, +} + +func (p AdminCmd) String() string { + if v, ok := AdminCmdToName[p]; ok { + return v + } + return "" +} + +func AdminCmdFromString(s string) (AdminCmd, error) { + if v, ok := AdminCmdToValue[s]; ok { + return v, nil + } + return AdminCmd(0), fmt.Errorf("not a valid AdminCmd string") +} + +func AdminCmdPtr(v AdminCmd) *AdminCmd { return &v } + +type JobStatus int64 + +const ( + JobStatus_QUEUE JobStatus = 1 + JobStatus_RUNNING JobStatus = 2 + JobStatus_FINISHED JobStatus = 3 + JobStatus_FAILED JobStatus = 4 + JobStatus_STOPPED JobStatus = 5 + JobStatus_INVALID JobStatus = 255 +) + +var JobStatusToName = map[JobStatus]string{ + JobStatus_QUEUE: "QUEUE", + JobStatus_RUNNING: "RUNNING", + JobStatus_FINISHED: "FINISHED", + JobStatus_FAILED: "FAILED", + JobStatus_STOPPED: "STOPPED", + JobStatus_INVALID: "INVALID", +} + +var JobStatusToValue = map[string]JobStatus{ + "QUEUE": JobStatus_QUEUE, + "RUNNING": JobStatus_RUNNING, + "FINISHED": JobStatus_FINISHED, + "FAILED": JobStatus_FAILED, + "STOPPED": JobStatus_STOPPED, + "INVALID": JobStatus_INVALID, +} + +var JobStatusNames = []string{ + "QUEUE", + "RUNNING", + "FINISHED", + "FAILED", + "STOPPED", + "INVALID", +} + +var JobStatusValues = []JobStatus{ + JobStatus_QUEUE, + JobStatus_RUNNING, + JobStatus_FINISHED, + JobStatus_FAILED, + JobStatus_STOPPED, + JobStatus_INVALID, +} + +func (p JobStatus) String() string { + if v, ok := JobStatusToName[p]; ok { + return v + } + return "" +} + +func JobStatusFromString(s string) (JobStatus, error) { + if v, ok := JobStatusToValue[s]; ok { + return v, nil + } + return JobStatus(0), fmt.Errorf("not a valid JobStatus string") +} + +func JobStatusPtr(v JobStatus) *JobStatus { return &v } + +type ListHostType int64 + +const ( + ListHostType_ALLOC ListHostType = 0 + ListHostType_GRAPH ListHostType = 1 + ListHostType_META ListHostType = 2 + ListHostType_STORAGE ListHostType = 3 +) + +var ListHostTypeToName = map[ListHostType]string{ + ListHostType_ALLOC: "ALLOC", + ListHostType_GRAPH: "GRAPH", + ListHostType_META: "META", + ListHostType_STORAGE: "STORAGE", +} + +var ListHostTypeToValue = map[string]ListHostType{ + "ALLOC": ListHostType_ALLOC, + "GRAPH": ListHostType_GRAPH, + "META": ListHostType_META, + "STORAGE": ListHostType_STORAGE, +} + +var ListHostTypeNames = []string{ + "ALLOC", + "GRAPH", + "META", + "STORAGE", +} + +var ListHostTypeValues = []ListHostType{ + ListHostType_ALLOC, + ListHostType_GRAPH, + ListHostType_META, + ListHostType_STORAGE, +} + +func (p ListHostType) String() string { + if v, ok := ListHostTypeToName[p]; ok { + return v + } + return "" +} + +func ListHostTypeFromString(s string) (ListHostType, error) { + if v, ok := ListHostTypeToValue[s]; ok { + return v, nil + } + return ListHostType(0), fmt.Errorf("not a valid ListHostType string") +} + +func ListHostTypePtr(v ListHostType) *ListHostType { return &v } + +type HostRole int64 + +const ( + HostRole_GRAPH HostRole = 0 + HostRole_META HostRole = 1 + HostRole_STORAGE HostRole = 2 + HostRole_LISTENER HostRole = 3 + HostRole_UNKNOWN HostRole = 4 +) + +var HostRoleToName = map[HostRole]string{ + HostRole_GRAPH: "GRAPH", + HostRole_META: "META", + HostRole_STORAGE: "STORAGE", + HostRole_LISTENER: "LISTENER", + HostRole_UNKNOWN: "UNKNOWN", +} + +var HostRoleToValue = map[string]HostRole{ + "GRAPH": HostRole_GRAPH, + "META": HostRole_META, + "STORAGE": HostRole_STORAGE, + "LISTENER": HostRole_LISTENER, + "UNKNOWN": HostRole_UNKNOWN, +} + +var HostRoleNames = []string{ + "GRAPH", + "META", + "STORAGE", + "LISTENER", + "UNKNOWN", +} + +var HostRoleValues = []HostRole{ + HostRole_GRAPH, + HostRole_META, + HostRole_STORAGE, + HostRole_LISTENER, + HostRole_UNKNOWN, +} + +func (p HostRole) String() string { + if v, ok := HostRoleToName[p]; ok { + return v + } + return "" +} + +func HostRoleFromString(s string) (HostRole, error) { + if v, ok := HostRoleToValue[s]; ok { + return v, nil + } + return HostRole(0), fmt.Errorf("not a valid HostRole string") +} + +func HostRolePtr(v HostRole) *HostRole { return &v } + +type TaskResult_ int64 + +const ( + TaskResult__SUCCEEDED TaskResult_ = 0 + TaskResult__FAILED TaskResult_ = 1 + TaskResult__IN_PROGRESS TaskResult_ = 2 + TaskResult__INVALID TaskResult_ = 3 +) + +var TaskResult_ToName = map[TaskResult_]string{ + TaskResult__SUCCEEDED: "SUCCEEDED", + TaskResult__FAILED: "FAILED", + TaskResult__IN_PROGRESS: "IN_PROGRESS", + TaskResult__INVALID: "INVALID", +} + +var TaskResult_ToValue = map[string]TaskResult_{ + "SUCCEEDED": TaskResult__SUCCEEDED, + "FAILED": TaskResult__FAILED, + "IN_PROGRESS": TaskResult__IN_PROGRESS, + "INVALID": TaskResult__INVALID, +} + +var TaskResult_Names = []string{ + "SUCCEEDED", + "FAILED", + "IN_PROGRESS", + "INVALID", +} + +var TaskResult_Values = []TaskResult_{ + TaskResult__SUCCEEDED, + TaskResult__FAILED, + TaskResult__IN_PROGRESS, + TaskResult__INVALID, +} + +func (p TaskResult_) String() string { + if v, ok := TaskResult_ToName[p]; ok { + return v + } + return "" +} + +func TaskResult_FromString(s string) (TaskResult_, error) { + if v, ok := TaskResult_ToValue[s]; ok { + return v, nil + } + return TaskResult_(0), fmt.Errorf("not a valid TaskResult_ string") +} + +func TaskResult_Ptr(v TaskResult_) *TaskResult_ { return &v } + +type ConfigModule int64 + +const ( + ConfigModule_UNKNOWN ConfigModule = 0 + ConfigModule_ALL ConfigModule = 1 + ConfigModule_GRAPH ConfigModule = 2 + ConfigModule_META ConfigModule = 3 + ConfigModule_STORAGE ConfigModule = 4 +) + +var ConfigModuleToName = map[ConfigModule]string{ + ConfigModule_UNKNOWN: "UNKNOWN", + ConfigModule_ALL: "ALL", + ConfigModule_GRAPH: "GRAPH", + ConfigModule_META: "META", + ConfigModule_STORAGE: "STORAGE", +} + +var ConfigModuleToValue = map[string]ConfigModule{ + "UNKNOWN": ConfigModule_UNKNOWN, + "ALL": ConfigModule_ALL, + "GRAPH": ConfigModule_GRAPH, + "META": ConfigModule_META, + "STORAGE": ConfigModule_STORAGE, +} + +var ConfigModuleNames = []string{ + "UNKNOWN", + "ALL", + "GRAPH", + "META", + "STORAGE", +} + +var ConfigModuleValues = []ConfigModule{ + ConfigModule_UNKNOWN, + ConfigModule_ALL, + ConfigModule_GRAPH, + ConfigModule_META, + ConfigModule_STORAGE, +} + +func (p ConfigModule) String() string { + if v, ok := ConfigModuleToName[p]; ok { + return v + } + return "" +} + +func ConfigModuleFromString(s string) (ConfigModule, error) { + if v, ok := ConfigModuleToValue[s]; ok { + return v, nil + } + return ConfigModule(0), fmt.Errorf("not a valid ConfigModule string") +} + +func ConfigModulePtr(v ConfigModule) *ConfigModule { return &v } + +type ConfigMode int64 + +const ( + ConfigMode_IMMUTABLE ConfigMode = 0 + ConfigMode_REBOOT ConfigMode = 1 + ConfigMode_MUTABLE ConfigMode = 2 + ConfigMode_IGNORED ConfigMode = 3 +) + +var ConfigModeToName = map[ConfigMode]string{ + ConfigMode_IMMUTABLE: "IMMUTABLE", + ConfigMode_REBOOT: "REBOOT", + ConfigMode_MUTABLE: "MUTABLE", + ConfigMode_IGNORED: "IGNORED", +} + +var ConfigModeToValue = map[string]ConfigMode{ + "IMMUTABLE": ConfigMode_IMMUTABLE, + "REBOOT": ConfigMode_REBOOT, + "MUTABLE": ConfigMode_MUTABLE, + "IGNORED": ConfigMode_IGNORED, +} + +var ConfigModeNames = []string{ + "IMMUTABLE", + "REBOOT", + "MUTABLE", + "IGNORED", +} + +var ConfigModeValues = []ConfigMode{ + ConfigMode_IMMUTABLE, + ConfigMode_REBOOT, + ConfigMode_MUTABLE, + ConfigMode_IGNORED, +} + +func (p ConfigMode) String() string { + if v, ok := ConfigModeToName[p]; ok { + return v + } + return "" +} + +func ConfigModeFromString(s string) (ConfigMode, error) { + if v, ok := ConfigModeToValue[s]; ok { + return v, nil + } + return ConfigMode(0), fmt.Errorf("not a valid ConfigMode string") +} + +func ConfigModePtr(v ConfigMode) *ConfigMode { return &v } + +type ListenerType int64 + +const ( + ListenerType_UNKNOWN ListenerType = 0 + ListenerType_ELASTICSEARCH ListenerType = 1 +) + +var ListenerTypeToName = map[ListenerType]string{ + ListenerType_UNKNOWN: "UNKNOWN", + ListenerType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var ListenerTypeToValue = map[string]ListenerType{ + "UNKNOWN": ListenerType_UNKNOWN, + "ELASTICSEARCH": ListenerType_ELASTICSEARCH, +} + +var ListenerTypeNames = []string{ + "UNKNOWN", + "ELASTICSEARCH", +} + +var ListenerTypeValues = []ListenerType{ + ListenerType_UNKNOWN, + ListenerType_ELASTICSEARCH, +} + +func (p ListenerType) String() string { + if v, ok := ListenerTypeToName[p]; ok { + return v + } + return "" +} + +func ListenerTypeFromString(s string) (ListenerType, error) { + if v, ok := ListenerTypeToValue[s]; ok { + return v, nil + } + return ListenerType(0), fmt.Errorf("not a valid ListenerType string") +} + +func ListenerTypePtr(v ListenerType) *ListenerType { return &v } + +type FTServiceType int64 + +const ( + FTServiceType_ELASTICSEARCH FTServiceType = 1 +) + +var FTServiceTypeToName = map[FTServiceType]string{ + FTServiceType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var FTServiceTypeToValue = map[string]FTServiceType{ + "ELASTICSEARCH": FTServiceType_ELASTICSEARCH, +} + +var FTServiceTypeNames = []string{ + "ELASTICSEARCH", +} + +var FTServiceTypeValues = []FTServiceType{ + FTServiceType_ELASTICSEARCH, +} + +func (p FTServiceType) String() string { + if v, ok := FTServiceTypeToName[p]; ok { + return v + } + return "" +} + +func FTServiceTypeFromString(s string) (FTServiceType, error) { + if v, ok := FTServiceTypeToValue[s]; ok { + return v, nil + } + return FTServiceType(0), fmt.Errorf("not a valid FTServiceType string") +} + +func FTServiceTypePtr(v FTServiceType) *FTServiceType { return &v } + +type QueryStatus int64 + +const ( + QueryStatus_RUNNING QueryStatus = 1 + QueryStatus_KILLING QueryStatus = 2 +) + +var QueryStatusToName = map[QueryStatus]string{ + QueryStatus_RUNNING: "RUNNING", + QueryStatus_KILLING: "KILLING", +} + +var QueryStatusToValue = map[string]QueryStatus{ + "RUNNING": QueryStatus_RUNNING, + "KILLING": QueryStatus_KILLING, +} + +var QueryStatusNames = []string{ + "RUNNING", + "KILLING", +} + +var QueryStatusValues = []QueryStatus{ + QueryStatus_RUNNING, + QueryStatus_KILLING, +} + +func (p QueryStatus) String() string { + if v, ok := QueryStatusToName[p]; ok { + return v + } + return "" +} + +func QueryStatusFromString(s string) (QueryStatus, error) { + if v, ok := QueryStatusToValue[s]; ok { + return v, nil + } + return QueryStatus(0), fmt.Errorf("not a valid QueryStatus string") +} + +func QueryStatusPtr(v QueryStatus) *QueryStatus { return &v } + +type SchemaVer = int64 + +func SchemaVerPtr(v SchemaVer) *SchemaVer { return &v } + +type ClusterID = int64 + +func ClusterIDPtr(v ClusterID) *ClusterID { return &v } + +// Attributes: +// - SpaceID +// - TagID +// - EdgeType +// - IndexID +// - ClusterID +type ID struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + TagID *nebula0.TagID `thrift:"tag_id,2" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,3" db:"edge_type" json:"edge_type,omitempty"` + IndexID *nebula0.IndexID `thrift:"index_id,4" db:"index_id" json:"index_id,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,5" db:"cluster_id" json:"cluster_id,omitempty"` +} + +func NewID() *ID { + return &ID{} +} + +var ID_SpaceID_DEFAULT nebula0.GraphSpaceID + +func (p *ID) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return ID_SpaceID_DEFAULT + } + return *p.SpaceID +} + +var ID_TagID_DEFAULT nebula0.TagID + +func (p *ID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return ID_TagID_DEFAULT + } + return *p.TagID +} + +var ID_EdgeType_DEFAULT nebula0.EdgeType + +func (p *ID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return ID_EdgeType_DEFAULT + } + return *p.EdgeType +} + +var ID_IndexID_DEFAULT nebula0.IndexID + +func (p *ID) GetIndexID() nebula0.IndexID { + if !p.IsSetIndexID() { + return ID_IndexID_DEFAULT + } + return *p.IndexID +} + +var ID_ClusterID_DEFAULT ClusterID + +func (p *ID) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return ID_ClusterID_DEFAULT + } + return *p.ClusterID +} +func (p *ID) CountSetFieldsID() int { + count := 0 + if p.IsSetSpaceID() { + count++ + } + if p.IsSetTagID() { + count++ + } + if p.IsSetEdgeType() { + count++ + } + if p.IsSetIndexID() { + count++ + } + if p.IsSetClusterID() { + count++ + } + return count + +} + +func (p *ID) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *ID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *ID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *ID) IsSetIndexID() bool { + return p != nil && p.IndexID != nil +} + +func (p *ID) IsSetClusterID() bool { + return p != nil && p.ClusterID != nil +} + +func (p *ID) 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 + } + 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 *ID) 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 *ID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = &temp + } + return nil +} + +func (p *ID) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp + } + return nil +} + +func (p *ID) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := nebula0.IndexID(v) + p.IndexID = &temp + } + return nil +} + +func (p *ID) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := ClusterID(v) + p.ClusterID = &temp + } + return nil +} + +func (p *ID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("ID"); 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 *ID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *ID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_id: ", p), err) + } + } + return err +} + +func (p *ID) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_type: ", p), err) + } + } + return err +} + +func (p *ID) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetIndexID() { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:index_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:index_id: ", p), err) + } + } + return err +} + +func (p *ID) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_id: ", p), err) + } + } + return err +} + +func (p *ID) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + var indexIDVal string + if p.IndexID == nil { + indexIDVal = "" + } else { + indexIDVal = fmt.Sprintf("%v", *p.IndexID) + } + var clusterIDVal string + if p.ClusterID == nil { + clusterIDVal = "" + } else { + clusterIDVal = fmt.Sprintf("%v", *p.ClusterID) + } + return fmt.Sprintf("ID({SpaceID:%s TagID:%s EdgeType:%s IndexID:%s ClusterID:%s})", spaceIDVal, tagIDVal, edgeTypeVal, indexIDVal, clusterIDVal) +} + +// Attributes: +// - Type +// - TypeLength +type ColumnTypeDef struct { + Type PropertyType `thrift:"type,1,required" db:"type" json:"type"` + TypeLength int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewColumnTypeDef() *ColumnTypeDef { + return &ColumnTypeDef{} +} + +func (p *ColumnTypeDef) GetType() PropertyType { + return p.Type +} + +var ColumnTypeDef_TypeLength_DEFAULT int16 = 0 + +func (p *ColumnTypeDef) GetTypeLength() int16 { + return p.TypeLength +} +func (p *ColumnTypeDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != ColumnTypeDef_TypeLength_DEFAULT +} + +func (p *ColumnTypeDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType 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 + } + issetType = 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 !issetType { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) + } + return nil +} + +func (p *ColumnTypeDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := PropertyType(v) + p.Type = temp + } + return nil +} + +func (p *ColumnTypeDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TypeLength = v + } + return nil +} + +func (p *ColumnTypeDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnTypeDef"); 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 *ColumnTypeDef) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ColumnTypeDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) + } + if err := oprot.WriteI16(int16(p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) + } + } + return err +} + +func (p *ColumnTypeDef) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + typeLengthVal := fmt.Sprintf("%v", p.TypeLength) + return fmt.Sprintf("ColumnTypeDef({Type:%s TypeLength:%s})", typeVal, typeLengthVal) +} + +// Attributes: +// - Name +// - Type +// - DefaultValue +// - Nullable +// - Comment +type ColumnDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Type *ColumnTypeDef `thrift:"type,2,required" db:"type" json:"type"` + DefaultValue []byte `thrift:"default_value,3" db:"default_value" json:"default_value,omitempty"` + Nullable bool `thrift:"nullable,4" db:"nullable" json:"nullable,omitempty"` + Comment []byte `thrift:"comment,5" db:"comment" json:"comment,omitempty"` +} + +func NewColumnDef() *ColumnDef { + return &ColumnDef{ + Type: NewColumnTypeDef(), + } +} + +func (p *ColumnDef) GetName() []byte { + return p.Name +} + +var ColumnDef_Type_DEFAULT *ColumnTypeDef + +func (p *ColumnDef) GetType() *ColumnTypeDef { + if !p.IsSetType() { + return ColumnDef_Type_DEFAULT + } + return p.Type +} + +var ColumnDef_DefaultValue_DEFAULT []byte + +func (p *ColumnDef) GetDefaultValue() []byte { + return p.DefaultValue +} + +var ColumnDef_Nullable_DEFAULT bool = false + +func (p *ColumnDef) GetNullable() bool { + return p.Nullable +} + +var ColumnDef_Comment_DEFAULT []byte + +func (p *ColumnDef) GetComment() []byte { + return p.Comment +} +func (p *ColumnDef) IsSetType() bool { + return p != nil && p.Type != nil +} + +func (p *ColumnDef) IsSetDefaultValue() bool { + return p != nil && p.DefaultValue != nil +} + +func (p *ColumnDef) IsSetNullable() bool { + return p != nil && p.Nullable != ColumnDef_Nullable_DEFAULT +} + +func (p *ColumnDef) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ColumnDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false + var issetType 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetType = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(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) + } + if !issetName { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")) + } + if !issetType { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) + } + return nil +} + +func (p *ColumnDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *ColumnDef) ReadField2(iprot thrift.Protocol) error { + p.Type = NewColumnTypeDef() + if err := p.Type.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err) + } + return nil +} + +func (p *ColumnDef) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.DefaultValue = v + } + return nil +} + +func (p *ColumnDef) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Nullable = v + } + return nil +} + +func (p *ColumnDef) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *ColumnDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnDef"); 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 *ColumnDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *ColumnDef) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := p.Type.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *ColumnDef) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetDefaultValue() { + if err := oprot.WriteFieldBegin("default_value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:default_value: ", p), err) + } + if err := oprot.WriteBinary(p.DefaultValue); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.default_value (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:default_value: ", p), err) + } + } + return err +} + +func (p *ColumnDef) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNullable() { + if err := oprot.WriteFieldBegin("nullable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:nullable: ", p), err) + } + if err := oprot.WriteBool(bool(p.Nullable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullable (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:nullable: ", p), err) + } + } + return err +} + +func (p *ColumnDef) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:comment: ", p), err) + } + } + return err +} + +func (p *ColumnDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeVal string + if p.Type == nil { + typeVal = "" + } else { + typeVal = fmt.Sprintf("%v", p.Type) + } + defaultValueVal := fmt.Sprintf("%v", p.DefaultValue) + nullableVal := fmt.Sprintf("%v", p.Nullable) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ColumnDef({Name:%s Type:%s DefaultValue:%s Nullable:%s Comment:%s})", nameVal, typeVal, defaultValueVal, nullableVal, commentVal) +} + +// Attributes: +// - TtlDuration +// - TtlCol +// - Comment +type SchemaProp struct { + TtlDuration *int64 `thrift:"ttl_duration,1" db:"ttl_duration" json:"ttl_duration,omitempty"` + TtlCol []byte `thrift:"ttl_col,2" db:"ttl_col" json:"ttl_col,omitempty"` + Comment []byte `thrift:"comment,3" db:"comment" json:"comment,omitempty"` +} + +func NewSchemaProp() *SchemaProp { + return &SchemaProp{} +} + +var SchemaProp_TtlDuration_DEFAULT int64 + +func (p *SchemaProp) GetTtlDuration() int64 { + if !p.IsSetTtlDuration() { + return SchemaProp_TtlDuration_DEFAULT + } + return *p.TtlDuration +} + +var SchemaProp_TtlCol_DEFAULT []byte + +func (p *SchemaProp) GetTtlCol() []byte { + return p.TtlCol +} + +var SchemaProp_Comment_DEFAULT []byte + +func (p *SchemaProp) GetComment() []byte { + return p.Comment +} +func (p *SchemaProp) IsSetTtlDuration() bool { + return p != nil && p.TtlDuration != nil +} + +func (p *SchemaProp) IsSetTtlCol() bool { + return p != nil && p.TtlCol != nil +} + +func (p *SchemaProp) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SchemaProp) 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 *SchemaProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TtlDuration = &v + } + return nil +} + +func (p *SchemaProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TtlCol = v + } + return nil +} + +func (p *SchemaProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *SchemaProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SchemaProp"); 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 *SchemaProp) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTtlDuration() { + if err := oprot.WriteFieldBegin("ttl_duration", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ttl_duration: ", p), err) + } + if err := oprot.WriteI64(int64(*p.TtlDuration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_duration (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ttl_duration: ", p), err) + } + } + return err +} + +func (p *SchemaProp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTtlCol() { + if err := oprot.WriteFieldBegin("ttl_col", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_col: ", p), err) + } + if err := oprot.WriteBinary(p.TtlCol); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_col (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_col: ", p), err) + } + } + return err +} + +func (p *SchemaProp) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:comment: ", p), err) + } + } + return err +} + +func (p *SchemaProp) String() string { + if p == nil { + return "" + } + + var ttlDurationVal string + if p.TtlDuration == nil { + ttlDurationVal = "" + } else { + ttlDurationVal = fmt.Sprintf("%v", *p.TtlDuration) + } + ttlColVal := fmt.Sprintf("%v", p.TtlCol) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SchemaProp({TtlDuration:%s TtlCol:%s Comment:%s})", ttlDurationVal, ttlColVal, commentVal) +} + +// Attributes: +// - Columns +// - SchemaProp +type Schema struct { + Columns []*ColumnDef `thrift:"columns,1" db:"columns" json:"columns"` + SchemaProp *SchemaProp `thrift:"schema_prop,2" db:"schema_prop" json:"schema_prop"` +} + +func NewSchema() *Schema { + return &Schema{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *Schema) GetColumns() []*ColumnDef { + return p.Columns +} + +var Schema_SchemaProp_DEFAULT *SchemaProp + +func (p *Schema) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return Schema_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *Schema) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *Schema) 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 *Schema) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Columns = tSlice + for i := 0; i < size; i++ { + _elem1 := NewColumnDef() + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Columns = append(p.Columns, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Schema) ReadField2(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *Schema) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Schema"); 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 *Schema) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) + } + return err +} + +func (p *Schema) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_prop: ", p), err) + } + return err +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + + columnsVal := fmt.Sprintf("%v", p.Columns) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("Schema({Columns:%s SchemaProp:%s})", columnsVal, schemaPropVal) +} + +// Attributes: +// - Id +// - Name +type IdName struct { + Id *ID `thrift:"id,1" db:"id" json:"id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewIdName() *IdName { + return &IdName{} +} + +var IdName_Id_DEFAULT *ID + +func (p *IdName) GetId() *ID { + if !p.IsSetId() { + return IdName_Id_DEFAULT + } + return p.Id +} + +func (p *IdName) GetName() []byte { + return p.Name +} +func (p *IdName) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *IdName) 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 *IdName) ReadField1(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *IdName) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IdName) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IdName"); 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 *IdName) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *IdName) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) + } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) + } + return err +} + +func (p *IdName) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("IdName({Id:%s Name:%s})", idVal, nameVal) +} + +// Attributes: +// - SpaceName +// - PartitionNum +// - ReplicaFactor +// - CharsetName +// - CollateName +// - VidType +// - GroupName +// - IsolationLevel +// - Comment +type SpaceDesc struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + PartitionNum int32 `thrift:"partition_num,2" db:"partition_num" json:"partition_num"` + ReplicaFactor int32 `thrift:"replica_factor,3" db:"replica_factor" json:"replica_factor"` + CharsetName []byte `thrift:"charset_name,4" db:"charset_name" json:"charset_name"` + CollateName []byte `thrift:"collate_name,5" db:"collate_name" json:"collate_name"` + VidType *ColumnTypeDef `thrift:"vid_type,6" db:"vid_type" json:"vid_type"` + GroupName []byte `thrift:"group_name,7" db:"group_name" json:"group_name,omitempty"` + IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` + Comment []byte `thrift:"comment,9" db:"comment" json:"comment,omitempty"` +} + +func NewSpaceDesc() *SpaceDesc { + return &SpaceDesc{ + VidType: NewColumnTypeDef(), + } +} + +func (p *SpaceDesc) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *SpaceDesc) GetPartitionNum() int32 { + return p.PartitionNum +} + +func (p *SpaceDesc) GetReplicaFactor() int32 { + return p.ReplicaFactor +} + +func (p *SpaceDesc) GetCharsetName() []byte { + return p.CharsetName +} + +func (p *SpaceDesc) GetCollateName() []byte { + return p.CollateName +} + +var SpaceDesc_VidType_DEFAULT *ColumnTypeDef = &ColumnTypeDef{ + Type: 7, + TypeLength: const_lit_vid_type_type_length, +} + +func (p *SpaceDesc) GetVidType() *ColumnTypeDef { + if !p.IsSetVidType() { + return SpaceDesc_VidType_DEFAULT + } + return p.VidType +} + +var SpaceDesc_GroupName_DEFAULT []byte + +func (p *SpaceDesc) GetGroupName() []byte { + return p.GroupName +} + +var SpaceDesc_IsolationLevel_DEFAULT IsolationLevel + +func (p *SpaceDesc) GetIsolationLevel() IsolationLevel { + if !p.IsSetIsolationLevel() { + return SpaceDesc_IsolationLevel_DEFAULT + } + return *p.IsolationLevel +} + +var SpaceDesc_Comment_DEFAULT []byte + +func (p *SpaceDesc) GetComment() []byte { + return p.Comment +} +func (p *SpaceDesc) IsSetVidType() bool { + return p != nil && p.VidType != nil +} + +func (p *SpaceDesc) IsSetGroupName() bool { + return p != nil && p.GroupName != nil +} + +func (p *SpaceDesc) IsSetIsolationLevel() bool { + return p != nil && p.IsolationLevel != nil +} + +func (p *SpaceDesc) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SpaceDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *SpaceDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.PartitionNum = v + } + return nil +} + +func (p *SpaceDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ReplicaFactor = v + } + return nil +} + +func (p *SpaceDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CharsetName = v + } + return nil +} + +func (p *SpaceDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.CollateName = v + } + return nil +} + +func (p *SpaceDesc) ReadField6(iprot thrift.Protocol) error { + p.VidType = NewColumnTypeDef() + if err := p.VidType.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VidType), err) + } + return nil +} + +func (p *SpaceDesc) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *SpaceDesc) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + temp := IsolationLevel(v) + p.IsolationLevel = &temp + } + return nil +} + +func (p *SpaceDesc) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *SpaceDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *SpaceDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_num", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_num: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartitionNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_num (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_num: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("replica_factor", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:replica_factor: ", p), err) + } + if err := oprot.WriteI32(int32(p.ReplicaFactor)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_factor (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:replica_factor: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("charset_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:charset_name: ", p), err) + } + if err := oprot.WriteBinary(p.CharsetName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.charset_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:charset_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("collate_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:collate_name: ", p), err) + } + if err := oprot.WriteBinary(p.CollateName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.collate_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:collate_name: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid_type", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vid_type: ", p), err) + } + if err := p.VidType.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VidType), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vid_type: ", p), err) + } + return err +} + +func (p *SpaceDesc) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetGroupName() { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:group_name: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetIsolationLevel() { + if err := oprot.WriteFieldBegin("isolation_level", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:isolation_level: ", p), err) + } + if err := oprot.WriteI32(int32(*p.IsolationLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isolation_level (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:isolation_level: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:comment: ", p), err) + } + } + return err +} + +func (p *SpaceDesc) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + partitionNumVal := fmt.Sprintf("%v", p.PartitionNum) + replicaFactorVal := fmt.Sprintf("%v", p.ReplicaFactor) + charsetNameVal := fmt.Sprintf("%v", p.CharsetName) + collateNameVal := fmt.Sprintf("%v", p.CollateName) + var vidTypeVal string + if p.VidType == nil { + vidTypeVal = "" + } else { + vidTypeVal = fmt.Sprintf("%v", p.VidType) + } + groupNameVal := fmt.Sprintf("%v", p.GroupName) + var isolationLevelVal string + if p.IsolationLevel == nil { + isolationLevelVal = "" + } else { + isolationLevelVal = fmt.Sprintf("%v", *p.IsolationLevel) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SpaceDesc({SpaceName:%s PartitionNum:%s ReplicaFactor:%s CharsetName:%s CollateName:%s VidType:%s GroupName:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, groupNameVal, isolationLevelVal, commentVal) +} + +// Attributes: +// - SpaceID +// - Properties +type SpaceItem struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Properties *SpaceDesc `thrift:"properties,2" db:"properties" json:"properties"` +} + +func NewSpaceItem() *SpaceItem { + return &SpaceItem{ + Properties: NewSpaceDesc(), + } +} + +func (p *SpaceItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +var SpaceItem_Properties_DEFAULT *SpaceDesc + +func (p *SpaceItem) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return SpaceItem_Properties_DEFAULT + } + return p.Properties +} +func (p *SpaceItem) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *SpaceItem) 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 *SpaceItem) 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 *SpaceItem) ReadField2(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *SpaceItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceItem"); 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 *SpaceItem) 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 *SpaceItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:properties: ", p), err) + } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) + } + return err +} + +func (p *SpaceItem) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + return fmt.Sprintf("SpaceItem({SpaceID:%s Properties:%s})", spaceIDVal, propertiesVal) +} + +// Attributes: +// - TagID +// - TagName +// - Version +// - Schema +type TagItem struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewTagItem() *TagItem { + return &TagItem{ + Schema: NewSchema(), + } +} + +func (p *TagItem) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *TagItem) GetTagName() []byte { + return p.TagName +} + +func (p *TagItem) GetVersion() SchemaVer { + return p.Version +} + +var TagItem_Schema_DEFAULT *Schema + +func (p *TagItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return TagItem_Schema_DEFAULT + } + return p.Schema +} +func (p *TagItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *TagItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TagItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = temp + } + return nil +} + +func (p *TagItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *TagItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *TagItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TagItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TagItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *TagItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) + } + return err +} + +func (p *TagItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *TagItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *TagItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) + } + return err +} + +func (p *TagItem) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("TagItem({TagID:%s TagName:%s Version:%s Schema:%s})", tagIDVal, tagNameVal, versionVal, schemaVal) +} + +// Attributes: +// - Op +// - Schema +type AlterSchemaItem struct { + Op AlterSchemaOp `thrift:"op,1" db:"op" json:"op"` + Schema *Schema `thrift:"schema,2" db:"schema" json:"schema"` +} + +func NewAlterSchemaItem() *AlterSchemaItem { + return &AlterSchemaItem{ + Schema: NewSchema(), + } +} + +func (p *AlterSchemaItem) GetOp() AlterSchemaOp { + return p.Op +} + +var AlterSchemaItem_Schema_DEFAULT *Schema + +func (p *AlterSchemaItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return AlterSchemaItem_Schema_DEFAULT + } + return p.Schema +} +func (p *AlterSchemaItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *AlterSchemaItem) 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 *AlterSchemaItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := AlterSchemaOp(v) + p.Op = temp + } + return nil +} + +func (p *AlterSchemaItem) ReadField2(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *AlterSchemaItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterSchemaItem"); 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 *AlterSchemaItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) + } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) + } + return err +} + +func (p *AlterSchemaItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) + } + return err +} + +func (p *AlterSchemaItem) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("AlterSchemaItem({Op:%s Schema:%s})", opVal, schemaVal) +} + +// Attributes: +// - EdgeType +// - EdgeName +// - Version +// - Schema +type EdgeItem struct { + EdgeType nebula0.EdgeType `thrift:"edge_type,1" db:"edge_type" json:"edge_type"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewEdgeItem() *EdgeItem { + return &EdgeItem{ + Schema: NewSchema(), + } +} + +func (p *EdgeItem) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeItem) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *EdgeItem) GetVersion() SchemaVer { + return p.Version +} + +var EdgeItem_Schema_DEFAULT *Schema + +func (p *EdgeItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return EdgeItem_Schema_DEFAULT + } + return p.Schema +} +func (p *EdgeItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *EdgeItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp + } + return nil +} + +func (p *EdgeItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *EdgeItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *EdgeItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *EdgeItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *EdgeItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_type: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *EdgeItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) + } + return err +} + +func (p *EdgeItem) String() string { + if p == nil { + return "" + } + + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("EdgeItem({EdgeType:%s EdgeName:%s Version:%s Schema:%s})", edgeTypeVal, edgeNameVal, versionVal, schemaVal) +} + +// Attributes: +// - TagID +// - EdgeType +type SchemaID struct { + TagID *nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type,omitempty"` +} + +func NewSchemaID() *SchemaID { + return &SchemaID{} +} + +var SchemaID_TagID_DEFAULT nebula0.TagID + +func (p *SchemaID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return SchemaID_TagID_DEFAULT + } + return *p.TagID +} + +var SchemaID_EdgeType_DEFAULT nebula0.EdgeType + +func (p *SchemaID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return SchemaID_EdgeType_DEFAULT + } + return *p.EdgeType +} +func (p *SchemaID) CountSetFieldsSchemaID() int { + count := 0 + if p.IsSetTagID() { + count++ + } + if p.IsSetEdgeType() { + count++ + } + return count + +} + +func (p *SchemaID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *SchemaID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *SchemaID) 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 *SchemaID) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.TagID(v) + p.TagID = &temp + } + return nil +} + +func (p *SchemaID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp + } + return nil +} + +func (p *SchemaID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsSchemaID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SchemaID"); 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 *SchemaID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) + } + } + return err +} + +func (p *SchemaID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) + } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) + } + } + return err +} + +func (p *SchemaID) String() string { + if p == nil { + return "" + } + + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + return fmt.Sprintf("SchemaID({TagID:%s EdgeType:%s})", tagIDVal, edgeTypeVal) +} + +// Attributes: +// - IndexID +// - IndexName +// - SchemaID +// - SchemaName +// - Fields +// - Comment +type IndexItem struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + SchemaID *SchemaID `thrift:"schema_id,3" db:"schema_id" json:"schema_id"` + SchemaName []byte `thrift:"schema_name,4" db:"schema_name" json:"schema_name"` + Fields []*ColumnDef `thrift:"fields,5" db:"fields" json:"fields"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewIndexItem() *IndexItem { + return &IndexItem{} +} + +func (p *IndexItem) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexItem) GetIndexName() []byte { + return p.IndexName +} + +var IndexItem_SchemaID_DEFAULT *SchemaID + +func (p *IndexItem) GetSchemaID() *SchemaID { + if !p.IsSetSchemaID() { + return IndexItem_SchemaID_DEFAULT + } + return p.SchemaID +} + +func (p *IndexItem) GetSchemaName() []byte { + return p.SchemaName +} + +func (p *IndexItem) GetFields() []*ColumnDef { + return p.Fields +} + +var IndexItem_Comment_DEFAULT []byte + +func (p *IndexItem) GetComment() []byte { + return p.Comment +} +func (p *IndexItem) IsSetSchemaID() bool { + return p != nil && p.SchemaID != nil +} + +func (p *IndexItem) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *IndexItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.IndexID(v) + p.IndexID = temp + } + return nil +} + +func (p *IndexItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *IndexItem) ReadField3(iprot thrift.Protocol) error { + p.SchemaID = NewSchemaID() + if err := p.SchemaID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SchemaName = v + } + return nil +} + +func (p *IndexItem) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem2 := NewColumnDef() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.Fields = append(p.Fields, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *IndexItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *IndexItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) + } + return err +} + +func (p *IndexItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *IndexItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema_id: ", p), err) + } + if err := p.SchemaID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema_id: ", p), err) + } + return err +} + +func (p *IndexItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_name: ", p), err) + } + if err := oprot.WriteBinary(p.SchemaName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schema_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_name: ", p), err) + } + return err +} + +func (p *IndexItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err) + } + return err +} + +func (p *IndexItem) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *IndexItem) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + var schemaIDVal string + if p.SchemaID == nil { + schemaIDVal = "" + } else { + schemaIDVal = fmt.Sprintf("%v", p.SchemaID) + } + schemaNameVal := fmt.Sprintf("%v", p.SchemaName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal) +} + +// Attributes: +// - HostAddr +// - Status +// - LeaderParts +// - AllParts +// - Role +// - GitInfoSha +// - ZoneName +// - Version +type HostItem struct { + HostAddr *nebula0.HostAddr `thrift:"hostAddr,1" db:"hostAddr" json:"hostAddr"` + Status HostStatus `thrift:"status,2" db:"status" json:"status"` + LeaderParts map[string][]nebula0.PartitionID `thrift:"leader_parts,3" db:"leader_parts" json:"leader_parts"` + AllParts map[string][]nebula0.PartitionID `thrift:"all_parts,4" db:"all_parts" json:"all_parts"` + Role HostRole `thrift:"role,5" db:"role" json:"role"` + GitInfoSha []byte `thrift:"git_info_sha,6" db:"git_info_sha" json:"git_info_sha"` + ZoneName []byte `thrift:"zone_name,7" db:"zone_name" json:"zone_name,omitempty"` + Version []byte `thrift:"version,8" db:"version" json:"version,omitempty"` +} + +func NewHostItem() *HostItem { + return &HostItem{ + HostAddr: nebula0.NewHostAddr(), + } +} + +var HostItem_HostAddr_DEFAULT *nebula0.HostAddr + +func (p *HostItem) GetHostAddr() *nebula0.HostAddr { + if !p.IsSetHostAddr() { + return HostItem_HostAddr_DEFAULT + } + return p.HostAddr +} + +func (p *HostItem) GetStatus() HostStatus { + return p.Status +} + +func (p *HostItem) GetLeaderParts() map[string][]nebula0.PartitionID { + return p.LeaderParts +} + +func (p *HostItem) GetAllParts() map[string][]nebula0.PartitionID { + return p.AllParts +} + +func (p *HostItem) GetRole() HostRole { + return p.Role +} + +func (p *HostItem) GetGitInfoSha() []byte { + return p.GitInfoSha +} + +var HostItem_ZoneName_DEFAULT []byte + +func (p *HostItem) GetZoneName() []byte { + return p.ZoneName +} + +var HostItem_Version_DEFAULT []byte + +func (p *HostItem) GetVersion() []byte { + return p.Version +} +func (p *HostItem) IsSetHostAddr() bool { + return p != nil && p.HostAddr != nil +} + +func (p *HostItem) IsSetZoneName() bool { + return p != nil && p.ZoneName != nil +} + +func (p *HostItem) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HostItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostItem) ReadField1(iprot thrift.Protocol) error { + p.HostAddr = nebula0.NewHostAddr() + if err := p.HostAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostAddr), err) + } + return nil +} + +func (p *HostItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := HostStatus(v) + p.Status = temp + } + return nil +} + +func (p *HostItem) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i++ { + var _key3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key3 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val4 := tSlice + for i := 0; i < size; i++ { + var _elem5 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem5 = temp + } + _val4 = append(_val4, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.AllParts = tMap + for i := 0; i < size; i++ { + var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key6 = v + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val7 := tSlice + for i := 0; i < size; i++ { + var _elem8 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem8 = temp + } + _val7 = append(_val7, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.AllParts[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := HostRole(v) + p.Role = temp + } + return nil +} + +func (p *HostItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.GitInfoSha = v + } + return nil +} + +func (p *HostItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *HostItem) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.Version = v + } + return nil +} + +func (p *HostItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HostItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hostAddr", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hostAddr: ", p), err) + } + if err := p.HostAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostAddr: ", p), err) + } + return err +} + +func (p *HostItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *HostItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:leader_parts: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:leader_parts: ", p), err) + } + return err +} + +func (p *HostItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("all_parts", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:all_parts: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.AllParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.AllParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 4:all_parts: ", p), err) + } + return err +} + +func (p *HostItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:role: ", p), err) + } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:role: ", p), err) + } + return err +} + +func (p *HostItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:git_info_sha: ", p), err) + } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:git_info_sha: ", p), err) + } + return err +} + +func (p *HostItem) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetZoneName() { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_name: ", p), err) + } + } + return err +} + +func (p *HostItem) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:version: ", p), err) + } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:version: ", p), err) + } + } + return err +} + +func (p *HostItem) String() string { + if p == nil { + return "" + } + + var hostAddrVal string + if p.HostAddr == nil { + hostAddrVal = "" + } else { + hostAddrVal = fmt.Sprintf("%v", p.HostAddr) + } + statusVal := fmt.Sprintf("%v", p.Status) + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + allPartsVal := fmt.Sprintf("%v", p.AllParts) + roleVal := fmt.Sprintf("%v", p.Role) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HostItem({HostAddr:%s Status:%s LeaderParts:%s AllParts:%s Role:%s GitInfoSha:%s ZoneName:%s Version:%s})", hostAddrVal, statusVal, leaderPartsVal, allPartsVal, roleVal, gitInfoShaVal, zoneNameVal, versionVal) +} + +// Attributes: +// - Account +// - IsLock +// - MaxQueriesPerHour +// - MaxUpdatesPerHour +// - MaxConnectionsPerHour +// - MaxUserConnections +type UserItem struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IsLock bool `thrift:"is_lock,2" db:"is_lock" json:"is_lock"` + MaxQueriesPerHour int32 `thrift:"max_queries_per_hour,3" db:"max_queries_per_hour" json:"max_queries_per_hour"` + MaxUpdatesPerHour int32 `thrift:"max_updates_per_hour,4" db:"max_updates_per_hour" json:"max_updates_per_hour"` + MaxConnectionsPerHour int32 `thrift:"max_connections_per_hour,5" db:"max_connections_per_hour" json:"max_connections_per_hour"` + MaxUserConnections int32 `thrift:"max_user_connections,6" db:"max_user_connections" json:"max_user_connections"` +} + +func NewUserItem() *UserItem { + return &UserItem{} +} + +func (p *UserItem) GetAccount() []byte { + return p.Account +} + +func (p *UserItem) GetIsLock() bool { + return p.IsLock +} + +func (p *UserItem) GetMaxQueriesPerHour() int32 { + return p.MaxQueriesPerHour +} + +func (p *UserItem) GetMaxUpdatesPerHour() int32 { + return p.MaxUpdatesPerHour +} + +func (p *UserItem) GetMaxConnectionsPerHour() int32 { + return p.MaxConnectionsPerHour +} + +func (p *UserItem) GetMaxUserConnections() int32 { + return p.MaxUserConnections +} +func (p *UserItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UserItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *UserItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IsLock = v + } + return nil +} + +func (p *UserItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxQueriesPerHour = v + } + return nil +} + +func (p *UserItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.MaxUpdatesPerHour = v + } + return nil +} + +func (p *UserItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.MaxConnectionsPerHour = v + } + return nil +} + +func (p *UserItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.MaxUserConnections = v + } + return nil +} + +func (p *UserItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UserItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *UserItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *UserItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_lock", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_lock: ", p), err) + } + if err := oprot.WriteBool(bool(p.IsLock)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_lock (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_lock: ", p), err) + } + return err +} + +func (p *UserItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_queries_per_hour", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_queries_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxQueriesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_queries_per_hour (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_queries_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_updates_per_hour", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_updates_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxUpdatesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_updates_per_hour (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_updates_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_connections_per_hour", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_connections_per_hour: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxConnectionsPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_connections_per_hour (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_connections_per_hour: ", p), err) + } + return err +} + +func (p *UserItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_user_connections", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:max_user_connections: ", p), err) + } + if err := oprot.WriteI32(int32(p.MaxUserConnections)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_user_connections (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_user_connections: ", p), err) + } + return err +} + +func (p *UserItem) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + isLockVal := fmt.Sprintf("%v", p.IsLock) + maxQueriesPerHourVal := fmt.Sprintf("%v", p.MaxQueriesPerHour) + maxUpdatesPerHourVal := fmt.Sprintf("%v", p.MaxUpdatesPerHour) + maxConnectionsPerHourVal := fmt.Sprintf("%v", p.MaxConnectionsPerHour) + maxUserConnectionsVal := fmt.Sprintf("%v", p.MaxUserConnections) + return fmt.Sprintf("UserItem({Account:%s IsLock:%s MaxQueriesPerHour:%s MaxUpdatesPerHour:%s MaxConnectionsPerHour:%s MaxUserConnections:%s})", accountVal, isLockVal, maxQueriesPerHourVal, maxUpdatesPerHourVal, maxConnectionsPerHourVal, maxUserConnectionsVal) +} + +// Attributes: +// - UserID +// - SpaceID +// - RoleType +type RoleItem struct { + UserID []byte `thrift:"user_id,1" db:"user_id" json:"user_id"` + SpaceID nebula0.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` + RoleType RoleType `thrift:"role_type,3" db:"role_type" json:"role_type"` +} + +func NewRoleItem() *RoleItem { + return &RoleItem{} +} + +func (p *RoleItem) GetUserID() []byte { + return p.UserID +} + +func (p *RoleItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RoleItem) GetRoleType() RoleType { + return p.RoleType +} +func (p *RoleItem) 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 *RoleItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.UserID = v + } + return nil +} + +func (p *RoleItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp + } + return nil +} + +func (p *RoleItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := RoleType(v) + p.RoleType = temp + } + return nil +} + +func (p *RoleItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RoleItem"); 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 *RoleItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user_id: ", p), err) + } + if err := oprot.WriteBinary(p.UserID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user_id: ", p), err) + } + return err +} + +func (p *RoleItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) + } + return err +} + +func (p *RoleItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role_type: ", p), err) + } + if err := oprot.WriteI32(int32(p.RoleType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role_type: ", p), err) + } + return err +} + +func (p *RoleItem) String() string { + if p == nil { + return "" + } + + userIDVal := fmt.Sprintf("%v", p.UserID) + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + roleTypeVal := fmt.Sprintf("%v", p.RoleType) + return fmt.Sprintf("RoleItem({UserID:%s SpaceID:%s RoleType:%s})", userIDVal, spaceIDVal, roleTypeVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +type ExecResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id *ID `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` +} + +func NewExecResp() *ExecResp { + return &ExecResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ExecResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ExecResp_Id_DEFAULT *ID + +func (p *ExecResp) GetId() *ID { + if !p.IsSetId() { + return ExecResp_Id_DEFAULT + } + return p.Id +} + +var ExecResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ExecResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ExecResp_Leader_DEFAULT + } + return p.Leader +} +func (p *ExecResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *ExecResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ExecResp) 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 *ExecResp) 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 *ExecResp) ReadField2(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *ExecResp) ReadField3(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 *ExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResp"); 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 *ExecResp) 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 *ExecResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + return err +} + +func (p *ExecResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) + } + return err +} + +func (p *ExecResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("ExecResp({Code:%s Id:%s Leader:%s})", codeVal, idVal, leaderVal) +} + +// Attributes: +// - Op +// - Cmd +// - Paras +type AdminJobReq struct { + Op AdminJobOp `thrift:"op,1" db:"op" json:"op"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` +} + +func NewAdminJobReq() *AdminJobReq { + return &AdminJobReq{} +} + +func (p *AdminJobReq) GetOp() AdminJobOp { + return p.Op +} + +func (p *AdminJobReq) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *AdminJobReq) GetParas() [][]byte { + return p.Paras +} +func (p *AdminJobReq) 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 *AdminJobReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := AdminJobOp(v) + p.Op = temp + } + return nil +} + +func (p *AdminJobReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := AdminCmd(v) + p.Cmd = temp + } + return nil +} + +func (p *AdminJobReq) ReadField3(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.Paras = tSlice + for i := 0; i < size; i++ { + var _elem9 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem9 = v + } + p.Paras = append(p.Paras, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobReq"); 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 *AdminJobReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) + } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) + } + return err +} + +func (p *AdminJobReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) + } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) + } + return err +} + +func (p *AdminJobReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) + } + return err +} + +func (p *AdminJobReq) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + return fmt.Sprintf("AdminJobReq({Op:%s Cmd:%s Paras:%s})", opVal, cmdVal, parasVal) +} + +// Attributes: +// - Id +// - Cmd +// - Paras +// - Status +// - StartTime +// - StopTime +type JobDesc struct { + Id int32 `thrift:"id,1" db:"id" json:"id"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras []string `thrift:"paras,3" db:"paras" json:"paras"` + Status JobStatus `thrift:"status,4" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,5" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,6" db:"stop_time" json:"stop_time"` +} + +func NewJobDesc() *JobDesc { + return &JobDesc{} +} + +func (p *JobDesc) GetId() int32 { + return p.Id +} + +func (p *JobDesc) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *JobDesc) GetParas() []string { + return p.Paras +} + +func (p *JobDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *JobDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *JobDesc) GetStopTime() int64 { + return p.StopTime +} +func (p *JobDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JobDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *JobDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := AdminCmd(v) + p.Cmd = temp + } + return nil +} + +func (p *JobDesc) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Paras = tSlice + for i := 0; i < size; i++ { + var _elem10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem10 = v + } + p.Paras = append(p.Paras, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *JobDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *JobDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *JobDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StopTime = v + } + return nil +} + +func (p *JobDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("JobDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *JobDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := oprot.WriteI32(int32(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *JobDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) + } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) + } + return err +} + +func (p *JobDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) + } + return err +} + +func (p *JobDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *JobDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) + } + return err +} + +func (p *JobDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:stop_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:stop_time: ", p), err) + } + return err +} + +func (p *JobDesc) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + return fmt.Sprintf("JobDesc({Id:%s Cmd:%s Paras:%s Status:%s StartTime:%s StopTime:%s})", idVal, cmdVal, parasVal, statusVal, startTimeVal, stopTimeVal) +} + +// Attributes: +// - TaskID +// - Host +// - Status +// - StartTime +// - StopTime +// - JobID +type TaskDesc struct { + TaskID int32 `thrift:"task_id,1" db:"task_id" json:"task_id"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + Status JobStatus `thrift:"status,3" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` + JobID int32 `thrift:"job_id,6" db:"job_id" json:"job_id"` +} + +func NewTaskDesc() *TaskDesc { + return &TaskDesc{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *TaskDesc) GetTaskID() int32 { + return p.TaskID +} + +var TaskDesc_Host_DEFAULT *nebula0.HostAddr + +func (p *TaskDesc) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return TaskDesc_Host_DEFAULT + } + return p.Host +} + +func (p *TaskDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *TaskDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *TaskDesc) GetStopTime() int64 { + return p.StopTime +} + +func (p *TaskDesc) GetJobID() int32 { + return p.JobID +} +func (p *TaskDesc) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *TaskDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TaskID = v + } + return nil +} + +func (p *TaskDesc) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *TaskDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *TaskDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *TaskDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.StopTime = v + } + return nil +} + +func (p *TaskDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.JobID = v + } + return nil +} + +func (p *TaskDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskDesc"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *TaskDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:task_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:task_id: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:start_time: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:stop_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stop_time: ", p), err) + } + return err +} + +func (p *TaskDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:job_id: ", p), err) + } + return err +} + +func (p *TaskDesc) String() string { + if p == nil { + return "" + } + + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + jobIDVal := fmt.Sprintf("%v", p.JobID) + return fmt.Sprintf("TaskDesc({TaskID:%s Host:%s Status:%s StartTime:%s StopTime:%s JobID:%s})", taskIDVal, hostVal, statusVal, startTimeVal, stopTimeVal, jobIDVal) +} + +// Attributes: +// - JobID +// - JobDesc +// - TaskDesc +// - RecoveredJobNum +type AdminJobResult_ struct { + JobID *int32 `thrift:"job_id,1" db:"job_id" json:"job_id,omitempty"` + JobDesc []*JobDesc `thrift:"job_desc,2" db:"job_desc" json:"job_desc,omitempty"` + TaskDesc []*TaskDesc `thrift:"task_desc,3" db:"task_desc" json:"task_desc,omitempty"` + RecoveredJobNum *int32 `thrift:"recovered_job_num,4" db:"recovered_job_num" json:"recovered_job_num,omitempty"` +} + +func NewAdminJobResult_() *AdminJobResult_ { + return &AdminJobResult_{} +} + +var AdminJobResult__JobID_DEFAULT int32 + +func (p *AdminJobResult_) GetJobID() int32 { + if !p.IsSetJobID() { + return AdminJobResult__JobID_DEFAULT + } + return *p.JobID +} + +var AdminJobResult__JobDesc_DEFAULT []*JobDesc + +func (p *AdminJobResult_) GetJobDesc() []*JobDesc { + return p.JobDesc +} + +var AdminJobResult__TaskDesc_DEFAULT []*TaskDesc + +func (p *AdminJobResult_) GetTaskDesc() []*TaskDesc { + return p.TaskDesc +} + +var AdminJobResult__RecoveredJobNum_DEFAULT int32 + +func (p *AdminJobResult_) GetRecoveredJobNum() int32 { + if !p.IsSetRecoveredJobNum() { + return AdminJobResult__RecoveredJobNum_DEFAULT + } + return *p.RecoveredJobNum +} +func (p *AdminJobResult_) IsSetJobID() bool { + return p != nil && p.JobID != nil +} + +func (p *AdminJobResult_) IsSetJobDesc() bool { + return p != nil && p.JobDesc != nil +} + +func (p *AdminJobResult_) IsSetTaskDesc() bool { + return p != nil && p.TaskDesc != nil +} + +func (p *AdminJobResult_) IsSetRecoveredJobNum() bool { + return p != nil && p.RecoveredJobNum != nil +} + +func (p *AdminJobResult_) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResult_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.JobID = &v + } + return nil +} + +func (p *AdminJobResult_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*JobDesc, 0, size) + p.JobDesc = tSlice + for i := 0; i < size; i++ { + _elem11 := NewJobDesc() + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.JobDesc = append(p.JobDesc, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TaskDesc, 0, size) + p.TaskDesc = tSlice + for i := 0; i < size; i++ { + _elem12 := NewTaskDesc() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.TaskDesc = append(p.TaskDesc, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RecoveredJobNum = &v + } + return nil +} + +func (p *AdminJobResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResult"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AdminJobResult_) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetJobID() { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(*p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetJobDesc() { + if err := oprot.WriteFieldBegin("job_desc", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_desc: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.JobDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.JobDesc { + 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:job_desc: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskDesc() { + if err := oprot.WriteFieldBegin("task_desc", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_desc: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TaskDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskDesc { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_desc: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetRecoveredJobNum() { + if err := oprot.WriteFieldBegin("recovered_job_num", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:recovered_job_num: ", p), err) + } + if err := oprot.WriteI32(int32(*p.RecoveredJobNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.recovered_job_num (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:recovered_job_num: ", p), err) + } + } + return err +} + +func (p *AdminJobResult_) String() string { + if p == nil { + return "" + } + + var jobIDVal string + if p.JobID == nil { + jobIDVal = "" + } else { + jobIDVal = fmt.Sprintf("%v", *p.JobID) + } + jobDescVal := fmt.Sprintf("%v", p.JobDesc) + taskDescVal := fmt.Sprintf("%v", p.TaskDesc) + var recoveredJobNumVal string + if p.RecoveredJobNum == nil { + recoveredJobNumVal = "" + } else { + recoveredJobNumVal = fmt.Sprintf("%v", *p.RecoveredJobNum) + } + return fmt.Sprintf("AdminJobResult_({JobID:%s JobDesc:%s TaskDesc:%s RecoveredJobNum:%s})", jobIDVal, jobDescVal, taskDescVal, recoveredJobNumVal) +} + +// Attributes: +// - Code +// - Leader +// - Result_ +type AdminJobResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Result_ *AdminJobResult_ `thrift:"result,3" db:"result" json:"result"` +} + +func NewAdminJobResp() *AdminJobResp { + return &AdminJobResp{ + Leader: nebula0.NewHostAddr(), + Result_: NewAdminJobResult_(), + } +} + +func (p *AdminJobResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var AdminJobResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *AdminJobResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return AdminJobResp_Leader_DEFAULT + } + return p.Leader +} + +var AdminJobResp_Result__DEFAULT *AdminJobResult_ + +func (p *AdminJobResp) GetResult_() *AdminJobResult_ { + if !p.IsSetResult_() { + return AdminJobResp_Result__DEFAULT + } + return p.Result_ +} +func (p *AdminJobResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *AdminJobResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) ReadField3(iprot thrift.Protocol) error { + p.Result_ = NewAdminJobResult_() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminJobResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResp"); 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:result: ", p), err) + } + return err +} + +func (p *AdminJobResp) 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) + } + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("AdminJobResp({Code:%s Leader:%s Result_:%s})", codeVal, leaderVal, resultVal) +} + +// Attributes: +// - PartID +// - Proportion +type Correlativity struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Proportion float64 `thrift:"proportion,2" db:"proportion" json:"proportion"` +} + +func NewCorrelativity() *Correlativity { + return &Correlativity{} +} + +func (p *Correlativity) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *Correlativity) GetProportion() float64 { + return p.Proportion +} +func (p *Correlativity) 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 *Correlativity) 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 *Correlativity) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Proportion = v + } + return nil +} + +func (p *Correlativity) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Correlativity"); 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 *Correlativity) 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 *Correlativity) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("proportion", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:proportion: ", p), err) + } + if err := oprot.WriteDouble(float64(p.Proportion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.proportion (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:proportion: ", p), err) + } + return err +} + +func (p *Correlativity) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + proportionVal := fmt.Sprintf("%v", p.Proportion) + return fmt.Sprintf("Correlativity({PartID:%s Proportion:%s})", partIDVal, proportionVal) +} + +// Attributes: +// - TagVertices +// - Edges +// - SpaceVertices +// - SpaceEdges +// - PositivePartCorrelativity +// - NegativePartCorrelativity +// - Status +type StatisItem struct { + TagVertices map[string]int64 `thrift:"tag_vertices,1" db:"tag_vertices" json:"tag_vertices"` + Edges map[string]int64 `thrift:"edges,2" db:"edges" json:"edges"` + SpaceVertices int64 `thrift:"space_vertices,3" db:"space_vertices" json:"space_vertices"` + SpaceEdges int64 `thrift:"space_edges,4" db:"space_edges" json:"space_edges"` + PositivePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"positive_part_correlativity,5" db:"positive_part_correlativity" json:"positive_part_correlativity"` + NegativePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"negative_part_correlativity,6" db:"negative_part_correlativity" json:"negative_part_correlativity"` + Status JobStatus `thrift:"status,7" db:"status" json:"status"` +} + +func NewStatisItem() *StatisItem { + return &StatisItem{} +} + +func (p *StatisItem) GetTagVertices() map[string]int64 { + return p.TagVertices +} + +func (p *StatisItem) GetEdges() map[string]int64 { + return p.Edges +} + +func (p *StatisItem) GetSpaceVertices() int64 { + return p.SpaceVertices +} + +func (p *StatisItem) GetSpaceEdges() int64 { + return p.SpaceEdges +} + +func (p *StatisItem) GetPositivePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.PositivePartCorrelativity +} + +func (p *StatisItem) GetNegativePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.NegativePartCorrelativity +} + +func (p *StatisItem) GetStatus() JobStatus { + return p.Status +} +func (p *StatisItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatisItem) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.TagVertices = tMap + for i := 0; i < size; i++ { + var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key13 = v + } + var _val14 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val14 = v + } + p.TagVertices[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.Edges = tMap + for i := 0; i < size; i++ { + var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key15 = v + } + var _val16 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val16 = v + } + p.Edges[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SpaceVertices = v + } + return nil +} + +func (p *StatisItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SpaceEdges = v + } + return nil +} + +func (p *StatisItem) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.PositivePartCorrelativity = tMap + for i := 0; i < size; i++ { + var _key17 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key17 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val18 := tSlice + for i := 0; i < size; i++ { + _elem19 := NewCorrelativity() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + _val18 = append(_val18, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PositivePartCorrelativity[_key17] = _val18 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.NegativePartCorrelativity = tMap + for i := 0; i < size; i++ { + var _key20 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key20 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val21 := tSlice + for i := 0; i < size; i++ { + _elem22 := NewCorrelativity() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + _val21 = append(_val21, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.NegativePartCorrelativity[_key20] = _val21 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatisItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := JobStatus(v) + p.Status = temp + } + return nil +} + +func (p *StatisItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatisItem"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *StatisItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_vertices", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_vertices: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.TagVertices)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.TagVertices { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_vertices: ", p), err) + } + return err +} + +func (p *StatisItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edges: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.Edges)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Edges { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edges: ", p), err) + } + return err +} + +func (p *StatisItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_vertices", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:space_vertices: ", p), err) + } + if err := oprot.WriteI64(int64(p.SpaceVertices)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_vertices (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:space_vertices: ", p), err) + } + return err +} + +func (p *StatisItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_edges", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_edges: ", p), err) + } + if err := oprot.WriteI64(int64(p.SpaceEdges)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_edges (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_edges: ", p), err) + } + return err +} + +func (p *StatisItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("positive_part_correlativity", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:positive_part_correlativity: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PositivePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PositivePartCorrelativity { + 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 5:positive_part_correlativity: ", p), err) + } + return err +} + +func (p *StatisItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("negative_part_correlativity", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:negative_part_correlativity: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.NegativePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NegativePartCorrelativity { + 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 6:negative_part_correlativity: ", p), err) + } + return err +} + +func (p *StatisItem) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:status: ", p), err) + } + return err +} + +func (p *StatisItem) String() string { + if p == nil { + return "" + } + + tagVerticesVal := fmt.Sprintf("%v", p.TagVertices) + edgesVal := fmt.Sprintf("%v", p.Edges) + spaceVerticesVal := fmt.Sprintf("%v", p.SpaceVertices) + spaceEdgesVal := fmt.Sprintf("%v", p.SpaceEdges) + positivePartCorrelativityVal := fmt.Sprintf("%v", p.PositivePartCorrelativity) + negativePartCorrelativityVal := fmt.Sprintf("%v", p.NegativePartCorrelativity) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("StatisItem({TagVertices:%s Edges:%s SpaceVertices:%s SpaceEdges:%s PositivePartCorrelativity:%s NegativePartCorrelativity:%s Status:%s})", tagVerticesVal, edgesVal, spaceVerticesVal, spaceEdgesVal, positivePartCorrelativityVal, negativePartCorrelativityVal, statusVal) +} + +// Attributes: +// - Properties +// - IfNotExists +type CreateSpaceReq struct { + Properties *SpaceDesc `thrift:"properties,1" db:"properties" json:"properties"` + IfNotExists bool `thrift:"if_not_exists,2" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateSpaceReq() *CreateSpaceReq { + return &CreateSpaceReq{ + Properties: NewSpaceDesc(), + } +} + +var CreateSpaceReq_Properties_DEFAULT *SpaceDesc + +func (p *CreateSpaceReq) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return CreateSpaceReq_Properties_DEFAULT + } + return p.Properties +} + +func (p *CreateSpaceReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateSpaceReq) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *CreateSpaceReq) 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 *CreateSpaceReq) ReadField1(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSpaceReq"); 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 *CreateSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:properties: ", p), err) + } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:properties: ", p), err) + } + return err +} + +func (p *CreateSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateSpaceReq) String() string { + if p == nil { + return "" + } + + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateSpaceReq({Properties:%s IfNotExists:%s})", propertiesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceName +// - IfExists +type DropSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropSpaceReq() *DropSpaceReq { + return &DropSpaceReq{} +} + +func (p *DropSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *DropSpaceReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropSpaceReq) 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 *DropSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *DropSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSpaceReq"); 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 *DropSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *DropSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) + } + return err +} + +func (p *DropSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropSpaceReq({SpaceName:%s IfExists:%s})", spaceNameVal, ifExistsVal) +} + +type ListSpacesReq struct { +} + +func NewListSpacesReq() *ListSpacesReq { + return &ListSpacesReq{} +} + +func (p *ListSpacesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSpacesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSpacesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Spaces +type ListSpacesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Spaces []*IdName `thrift:"spaces,3" db:"spaces" json:"spaces"` +} + +func NewListSpacesResp() *ListSpacesResp { + return &ListSpacesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSpacesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSpacesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSpacesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSpacesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSpacesResp) GetSpaces() []*IdName { + return p.Spaces +} +func (p *ListSpacesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IdName, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i++ { + _elem23 := NewIdName() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Spaces = append(p.Spaces, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSpacesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesResp"); 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spaces: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spaces: ", p), err) + } + return err +} + +func (p *ListSpacesResp) 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) + } + spacesVal := fmt.Sprintf("%v", p.Spaces) + return fmt.Sprintf("ListSpacesResp({Code:%s Leader:%s Spaces:%s})", codeVal, leaderVal, spacesVal) +} + +// Attributes: +// - SpaceName +type GetSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` +} + +func NewGetSpaceReq() *GetSpaceReq { + return &GetSpaceReq{} +} + +func (p *GetSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} +func (p *GetSpaceReq) 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 *GetSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *GetSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceReq"); 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 *GetSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) + } + return err +} + +func (p *GetSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + return fmt.Sprintf("GetSpaceReq({SpaceName:%s})", spaceNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetSpaceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *SpaceItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetSpaceResp() *GetSpaceResp { + return &GetSpaceResp{ + Leader: nebula0.NewHostAddr(), + Item: NewSpaceItem(), + } +} + +func (p *GetSpaceResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetSpaceResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetSpaceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSpaceResp_Leader_DEFAULT + } + return p.Leader +} + +var GetSpaceResp_Item_DEFAULT *SpaceItem + +func (p *GetSpaceResp) GetItem() *SpaceItem { + if !p.IsSetItem() { + return GetSpaceResp_Item_DEFAULT + } + return p.Item +} +func (p *GetSpaceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSpaceResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewSpaceItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetSpaceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceResp"); 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetSpaceResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetSpaceResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Schema +// - IfNotExists +type CreateTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateTagReq() *CreateTagReq { + return &CreateTagReq{ + Schema: NewSchema(), + } +} + +func (p *CreateTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagReq) GetTagName() []byte { + return p.TagName +} + +var CreateTagReq_Schema_DEFAULT *Schema + +func (p *CreateTagReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateTagReq_Schema_DEFAULT + } + return p.Schema +} + +func (p *CreateTagReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateTagReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *CreateTagReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateTagReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *CreateTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *CreateTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateTagReq({SpaceID:%s TagName:%s Schema:%s IfNotExists:%s})", spaceIDVal, tagNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - TagItems +// - SchemaProp +type AlterTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + TagItems []*AlterSchemaItem `thrift:"tag_items,3" db:"tag_items" json:"tag_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterTagReq() *AlterTagReq { + return &AlterTagReq{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *AlterTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *AlterTagReq) GetTagItems() []*AlterSchemaItem { + return p.TagItems +} + +var AlterTagReq_SchemaProp_DEFAULT *SchemaProp + +func (p *AlterTagReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterTagReq_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *AlterTagReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *AlterTagReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.TagItems = tSlice + for i := 0; i < size; i++ { + _elem24 := NewAlterSchemaItem() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + } + p.TagItems = append(p.TagItems, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterTagReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *AlterTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TagItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TagItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_items: ", p), err) + } + return err +} + +func (p *AlterTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) + } + return err +} + +func (p *AlterTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + tagItemsVal := fmt.Sprintf("%v", p.TagItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterTagReq({SpaceID:%s TagName:%s TagItems:%s SchemaProp:%s})", spaceIDVal, tagNameVal, tagItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - IfExists +type DropTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagReq() *DropTagReq { + return &DropTagReq{} +} + +func (p *DropTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *DropTagReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagReq) 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 *DropTagReq) 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 *DropTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *DropTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagReq"); 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 *DropTagReq) 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 *DropTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *DropTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagReq({SpaceID:%s TagName:%s IfExists:%s})", spaceIDVal, tagNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListTagsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagsReq() *ListTagsReq { + return &ListTagsReq{} +} + +func (p *ListTagsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagsReq) 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 *ListTagsReq) 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 *ListTagsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsReq"); 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 *ListTagsReq) 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 *ListTagsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagsReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Tags +type ListTagsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Tags []*TagItem `thrift:"tags,3" db:"tags" json:"tags"` +} + +func NewListTagsResp() *ListTagsResp { + return &ListTagsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListTagsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListTagsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListTagsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListTagsResp) GetTags() []*TagItem { + return p.Tags +} +func (p *ListTagsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TagItem, 0, size) + p.Tags = tSlice + for i := 0; i < size; i++ { + _elem25 := NewTagItem() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + } + p.Tags = append(p.Tags, _elem25) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsResp"); 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tags: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tags: ", p), err) + } + return err +} + +func (p *ListTagsResp) 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) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("ListTagsResp({Code:%s Leader:%s Tags:%s})", codeVal, leaderVal, tagsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Version +type GetTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetTagReq() *GetTagReq { + return &GetTagReq{} +} + +func (p *GetTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *GetTagReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetTagReq) 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 *GetTagReq) 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 *GetTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *GetTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *GetTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagReq"); 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 *GetTagReq) 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 *GetTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) + } + return err +} + +func (p *GetTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *GetTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetTagReq({SpaceID:%s TagName:%s Version:%s})", spaceIDVal, tagNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetTagResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetTagResp() *GetTagResp { + return &GetTagResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + +func (p *GetTagResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetTagResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetTagResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagResp_Leader_DEFAULT + } + return p.Leader +} + +var GetTagResp_Schema_DEFAULT *Schema + +func (p *GetTagResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetTagResp_Schema_DEFAULT + } + return p.Schema +} +func (p *GetTagResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetTagResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagResp"); 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *GetTagResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetTagResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Schema +// - IfNotExists +type CreateEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateEdgeReq() *CreateEdgeReq { + return &CreateEdgeReq{ + Schema: NewSchema(), + } +} + +func (p *CreateEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +var CreateEdgeReq_Schema_DEFAULT *Schema + +func (p *CreateEdgeReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateEdgeReq_Schema_DEFAULT + } + return p.Schema +} + +func (p *CreateEdgeReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateEdgeReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *CreateEdgeReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateEdgeReq({SpaceID:%s EdgeName:%s Schema:%s IfNotExists:%s})", spaceIDVal, edgeNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - EdgeItems +// - SchemaProp +type AlterEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + EdgeItems []*AlterSchemaItem `thrift:"edge_items,3" db:"edge_items" json:"edge_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterEdgeReq() *AlterEdgeReq { + return &AlterEdgeReq{ + SchemaProp: NewSchemaProp(), + } +} + +func (p *AlterEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *AlterEdgeReq) GetEdgeItems() []*AlterSchemaItem { + return p.EdgeItems +} + +var AlterEdgeReq_SchemaProp_DEFAULT *SchemaProp + +func (p *AlterEdgeReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterEdgeReq_SchemaProp_DEFAULT + } + return p.SchemaProp +} +func (p *AlterEdgeReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *AlterEdgeReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.EdgeItems = tSlice + for i := 0; i < size; i++ { + _elem26 := NewAlterSchemaItem() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + } + p.EdgeItems = append(p.EdgeItems, _elem26) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_items: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) + } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) + } + return err +} + +func (p *AlterEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + edgeItemsVal := fmt.Sprintf("%v", p.EdgeItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterEdgeReq({SpaceID:%s EdgeName:%s EdgeItems:%s SchemaProp:%s})", spaceIDVal, edgeNameVal, edgeItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Version +type GetEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetEdgeReq() *GetEdgeReq { + return &GetEdgeReq{} +} + +func (p *GetEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *GetEdgeReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetEdgeReq) 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 *GetEdgeReq) 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 *GetEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *GetEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := SchemaVer(v) + p.Version = temp + } + return nil +} + +func (p *GetEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeReq"); 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 *GetEdgeReq) 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 *GetEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *GetEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) + } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) + } + return err +} + +func (p *GetEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetEdgeReq({SpaceID:%s EdgeName:%s Version:%s})", spaceIDVal, edgeNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetEdgeResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetEdgeResp() *GetEdgeResp { + return &GetEdgeResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + +func (p *GetEdgeResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetEdgeResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetEdgeResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeResp_Leader_DEFAULT + } + return p.Leader +} + +var GetEdgeResp_Schema_DEFAULT *Schema + +func (p *GetEdgeResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetEdgeResp_Schema_DEFAULT + } + return p.Schema +} +func (p *GetEdgeResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetEdgeResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeResp"); 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) + } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) + } + return err +} + +func (p *GetEdgeResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetEdgeResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - IfExists +type DropEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeReq() *DropEdgeReq { + return &DropEdgeReq{} +} + +func (p *DropEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *DropEdgeReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeReq) 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 *DropEdgeReq) 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 *DropEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *DropEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeReq"); 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 *DropEdgeReq) 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 *DropEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) + } + return err +} + +func (p *DropEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeReq({SpaceID:%s EdgeName:%s IfExists:%s})", spaceIDVal, edgeNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListEdgesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgesReq() *ListEdgesReq { + return &ListEdgesReq{} +} + +func (p *ListEdgesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgesReq) 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 *ListEdgesReq) 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 *ListEdgesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesReq"); 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 *ListEdgesReq) 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 *ListEdgesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Edges +type ListEdgesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Edges []*EdgeItem `thrift:"edges,3" db:"edges" json:"edges"` +} + +func NewListEdgesResp() *ListEdgesResp { + return &ListEdgesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListEdgesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListEdgesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListEdgesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListEdgesResp) GetEdges() []*EdgeItem { + return p.Edges +} +func (p *ListEdgesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeItem, 0, size) + p.Edges = tSlice + for i := 0; i < size; i++ { + _elem27 := NewEdgeItem() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + p.Edges = append(p.Edges, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesResp"); 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 *ListEdgesResp) 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 *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) + } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) + } + return err +} + +func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edges: ", p), err) + } + return err +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + edgesVal := fmt.Sprintf("%v", p.Edges) + return fmt.Sprintf("ListEdgesResp({Code:%s Leader:%s Edges:%s})", codeVal, leaderVal, edgesVal) +} + +// Attributes: +// - Type +type ListHostsReq struct { + Type ListHostType `thrift:"type,1" db:"type" json:"type"` +} + +func NewListHostsReq() *ListHostsReq { + return &ListHostsReq{} +} + +func (p *ListHostsReq) GetType() ListHostType { + return p.Type +} +func (p *ListHostsReq) 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 *ListHostsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ListHostType(v) + p.Type = temp + } + return nil +} + +func (p *ListHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsReq"); 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 *ListHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ListHostsReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("ListHostsReq({Type:%s})", typeVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type ListHostsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*HostItem `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewListHostsResp() *ListHostsResp { + return &ListHostsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListHostsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListHostsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListHostsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListHostsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListHostsResp) GetHosts() []*HostItem { + return p.Hosts +} +func (p *ListHostsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostItem, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i++ { + _elem28 := NewHostItem() + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + } + p.Hosts = append(p.Hosts, _elem28) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListHostsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsResp"); 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *ListHostsResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("ListHostsResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +// Attributes: +// - PartID +// - Leader +// - Peers +// - Losts +type PartItem struct { + PartID nebula0.PartitionID `thrift:"part_id,1,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader,omitempty"` + Peers []*nebula0.HostAddr `thrift:"peers,3,required" db:"peers" json:"peers"` + Losts []*nebula0.HostAddr `thrift:"losts,4,required" db:"losts" json:"losts"` +} + +func NewPartItem() *PartItem { + return &PartItem{} +} + +func (p *PartItem) GetPartID() nebula0.PartitionID { + return p.PartID +} + +var PartItem_Leader_DEFAULT *nebula0.HostAddr + +func (p *PartItem) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartItem_Leader_DEFAULT + } + return p.Leader +} + +func (p *PartItem) GetPeers() []*nebula0.HostAddr { + return p.Peers +} + +func (p *PartItem) GetLosts() []*nebula0.HostAddr { + return p.Losts +} +func (p *PartItem) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPartID bool = false + var issetPeers bool = false + var issetLosts 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 + } + issetPartID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetPeers = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetLosts = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPartID { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")) + } + if !issetPeers { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Peers is not set")) + } + if !issetLosts { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Losts is not set")) + } + return nil +} + +func (p *PartItem) 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 *PartItem) 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 *PartItem) ReadField3(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.Peers = tSlice + for i := 0; i < size; i++ { + _elem29 := nebula0.NewHostAddr() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.Peers = append(p.Peers, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) ReadField4(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.Losts = tSlice + for i := 0; i < size; i++ { + _elem30 := nebula0.NewHostAddr() + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.Losts = append(p.Losts, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *PartItem) 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 *PartItem) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + 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 *PartItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) + } + return err +} + +func (p *PartItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("losts", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:losts: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Losts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Losts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:losts: ", p), err) + } + return err +} + +func (p *PartItem) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + peersVal := fmt.Sprintf("%v", p.Peers) + lostsVal := fmt.Sprintf("%v", p.Losts) + return fmt.Sprintf("PartItem({PartID:%s Leader:%s Peers:%s Losts:%s})", partIDVal, leaderVal, peersVal, lostsVal) +} + +// Attributes: +// - SpaceID +// - PartIds +type ListPartsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartIds []nebula0.PartitionID `thrift:"part_ids,2" db:"part_ids" json:"part_ids"` +} + +func NewListPartsReq() *ListPartsReq { + return &ListPartsReq{} +} + +func (p *ListPartsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ListPartsReq) GetPartIds() []nebula0.PartitionID { + return p.PartIds +} +func (p *ListPartsReq) 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 *ListPartsReq) 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 *ListPartsReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.PartIds = tSlice + for i := 0; i < size; i++ { + var _elem31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _elem31 = temp + } + p.PartIds = append(p.PartIds, _elem31) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsReq"); 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 *ListPartsReq) 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 *ListPartsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_ids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_ids: ", p), err) + } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_ids: ", p), err) + } + return err +} + +func (p *ListPartsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIdsVal := fmt.Sprintf("%v", p.PartIds) + return fmt.Sprintf("ListPartsReq({SpaceID:%s PartIds:%s})", spaceIDVal, partIdsVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +type ListPartsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts []*PartItem `thrift:"parts,3" db:"parts" json:"parts"` +} + +func NewListPartsResp() *ListPartsResp { + return &ListPartsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListPartsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListPartsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListPartsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListPartsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListPartsResp) GetParts() []*PartItem { + return p.Parts +} +func (p *ListPartsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartItem, 0, size) + p.Parts = tSlice + for i := 0; i < size; i++ { + _elem32 := NewPartItem() + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + } + p.Parts = append(p.Parts, _elem32) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsResp"); 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) + } + return err +} + +func (p *ListPartsResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("ListPartsResp({Code:%s Leader:%s Parts:%s})", codeVal, leaderVal, partsVal) +} + +// Attributes: +// - SpaceID +type GetPartsAllocReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetPartsAllocReq() *GetPartsAllocReq { + return &GetPartsAllocReq{} +} + +func (p *GetPartsAllocReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetPartsAllocReq) 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocReq"); 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetPartsAllocReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +// - Terms +type GetPartsAllocResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts map[nebula0.PartitionID][]*nebula0.HostAddr `thrift:"parts,3" db:"parts" json:"parts"` + Terms map[nebula0.PartitionID]int64 `thrift:"terms,4" db:"terms" json:"terms,omitempty"` +} + +func NewGetPartsAllocResp() *GetPartsAllocResp { + return &GetPartsAllocResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetPartsAllocResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetPartsAllocResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetPartsAllocResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetPartsAllocResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetPartsAllocResp) GetParts() map[nebula0.PartitionID][]*nebula0.HostAddr { + return p.Parts +} + +var GetPartsAllocResp_Terms_DEFAULT map[nebula0.PartitionID]int64 + +func (p *GetPartsAllocResp) GetTerms() map[nebula0.PartitionID]int64 { + return p.Terms +} +func (p *GetPartsAllocResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetPartsAllocResp) IsSetTerms() bool { + return p != nil && p.Terms != nil +} + +func (p *GetPartsAllocResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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.HostAddr, size) + p.Parts = tMap + for i := 0; i < size; i++ { + var _key33 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key33 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + _val34 := tSlice + for i := 0; i < size; i++ { + _elem35 := nebula0.NewHostAddr() + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + _val34 = append(_val34, _elem35) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key33] = _val34 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID]int64, size) + p.Terms = tMap + for i := 0; i < size; i++ { + var _key36 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.PartitionID(v) + _key36 = temp + } + var _val37 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val37 = v + } + p.Terms[_key36] = _val37 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTerms() { + if err := oprot.WriteFieldBegin("terms", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:terms: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I64, len(p.Terms)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Terms { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:terms: ", p), err) + } + } + return err +} + +func (p *GetPartsAllocResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + termsVal := fmt.Sprintf("%v", p.Terms) + return fmt.Sprintf("GetPartsAllocResp({Code:%s Leader:%s Parts:%s Terms:%s})", codeVal, leaderVal, partsVal, termsVal) +} + +// Attributes: +// - Segment +// - Pairs +type MultiPutReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Pairs []*nebula0.KeyValue `thrift:"pairs,2" db:"pairs" json:"pairs"` +} + +func NewMultiPutReq() *MultiPutReq { + return &MultiPutReq{} +} + +func (p *MultiPutReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiPutReq) GetPairs() []*nebula0.KeyValue { + return p.Pairs +} +func (p *MultiPutReq) 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 *MultiPutReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *MultiPutReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + p.Pairs = tSlice + for i := 0; i < size; i++ { + _elem38 := nebula0.NewKeyValue() + if err := _elem38.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + } + p.Pairs = append(p.Pairs, _elem38) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiPutReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiPutReq"); 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 *MultiPutReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *MultiPutReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("pairs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pairs: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Pairs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Pairs { + 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:pairs: ", p), err) + } + return err +} + +func (p *MultiPutReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + pairsVal := fmt.Sprintf("%v", p.Pairs) + return fmt.Sprintf("MultiPutReq({Segment:%s Pairs:%s})", segmentVal, pairsVal) +} + +// Attributes: +// - Segment +// - Key +type GetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewGetReq() *GetReq { + return &GetReq{} +} + +func (p *GetReq) GetSegment() []byte { + return p.Segment +} + +func (p *GetReq) GetKey() []byte { + return p.Key +} +func (p *GetReq) 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 *GetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *GetReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *GetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetReq"); 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 *GetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *GetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) + } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) + } + return err +} + +func (p *GetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("GetReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Code +// - Leader +// - Value +type GetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Value []byte `thrift:"value,3" db:"value" json:"value"` +} + +func NewGetResp() *GetResp { + return &GetResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetResp) GetValue() []byte { + return p.Value +} +func (p *GetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetResp) 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 *GetResp) 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 *GetResp) 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 *GetResp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Value = v + } + return nil +} + +func (p *GetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetResp"); 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 *GetResp) 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 *GetResp) 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 *GetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) + } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) + } + return err +} + +func (p *GetResp) 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) + } + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("GetResp({Code:%s Leader:%s Value:%s})", codeVal, leaderVal, valueVal) +} + +// Attributes: +// - Segment +// - Keys +type MultiGetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Keys [][]byte `thrift:"keys,2" db:"keys" json:"keys"` +} + +func NewMultiGetReq() *MultiGetReq { + return &MultiGetReq{} +} + +func (p *MultiGetReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiGetReq) GetKeys() [][]byte { + return p.Keys +} +func (p *MultiGetReq) 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 *MultiGetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *MultiGetReq) 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.Keys = tSlice + for i := 0; i < size; i++ { + var _elem39 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem39 = v + } + p.Keys = append(p.Keys, _elem39) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetReq"); 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 *MultiGetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *MultiGetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:keys: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.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:keys: ", p), err) + } + return err +} + +func (p *MultiGetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keysVal := fmt.Sprintf("%v", p.Keys) + return fmt.Sprintf("MultiGetReq({Segment:%s Keys:%s})", segmentVal, keysVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type MultiGetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewMultiGetResp() *MultiGetResp { + return &MultiGetResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *MultiGetResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var MultiGetResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *MultiGetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return MultiGetResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *MultiGetResp) GetValues() [][]byte { + return p.Values +} +func (p *MultiGetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i++ { + var _elem40 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem40 = v + } + p.Values = append(p.Values, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetResp"); 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) + } + return err +} + +func (p *MultiGetResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("MultiGetResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Segment +// - Key +type RemoveReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewRemoveReq() *RemoveReq { + return &RemoveReq{} +} + +func (p *RemoveReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveReq) GetKey() []byte { + return p.Key +} +func (p *RemoveReq) 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 *RemoveReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *RemoveReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *RemoveReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveReq"); 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 *RemoveReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *RemoveReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) + } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) + } + return err +} + +func (p *RemoveReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("RemoveReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type RemoveRangeReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewRemoveRangeReq() *RemoveRangeReq { + return &RemoveRangeReq{} +} + +func (p *RemoveRangeReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveRangeReq) GetStart() []byte { + return p.Start +} + +func (p *RemoveRangeReq) GetEnd() []byte { + return p.End +} +func (p *RemoveRangeReq) 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 *RemoveRangeReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *RemoveRangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Start = v + } + return nil +} + +func (p *RemoveRangeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.End = v + } + return nil +} + +func (p *RemoveRangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveRangeReq"); 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 *RemoveRangeReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) + } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) + } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) + } + return err +} + +func (p *RemoveRangeReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("RemoveRangeReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type ScanReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewScanReq() *ScanReq { + return &ScanReq{} +} + +func (p *ScanReq) GetSegment() []byte { + return p.Segment +} + +func (p *ScanReq) GetStart() []byte { + return p.Start +} + +func (p *ScanReq) GetEnd() []byte { + return p.End +} +func (p *ScanReq) 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 *ScanReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Segment = v + } + return nil +} + +func (p *ScanReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Start = v + } + return nil +} + +func (p *ScanReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.End = v + } + return nil +} + +func (p *ScanReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanReq"); 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 *ScanReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) + } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) + } + return err +} + +func (p *ScanReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) + } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) + } + return err +} + +func (p *ScanReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) + } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) + } + return err +} + +func (p *ScanReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("ScanReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type ScanResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewScanResp() *ScanResp { + return &ScanResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ScanResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ScanResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ScanResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ScanResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ScanResp) GetValues() [][]byte { + return p.Values +} +func (p *ScanResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ScanResp) 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i++ { + var _elem41 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem41 = v + } + p.Values = append(p.Values, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanResp"); 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) + } + return err +} + +func (p *ScanResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("ScanResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Code +// - Leader +// - ClusterID +// - LastUpdateTimeInMs +type HBResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LastUpdateTimeInMs int64 `thrift:"last_update_time_in_ms,4" db:"last_update_time_in_ms" json:"last_update_time_in_ms"` +} + +func NewHBResp() *HBResp { + return &HBResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *HBResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var HBResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *HBResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return HBResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *HBResp) GetClusterID() ClusterID { + return p.ClusterID +} + +func (p *HBResp) GetLastUpdateTimeInMs() int64 { + return p.LastUpdateTimeInMs +} +func (p *HBResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *HBResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) 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 *HBResp) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.LastUpdateTimeInMs = v + } + return nil +} + +func (p *HBResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HBResp) 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 *HBResp) 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 *HBResp) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("last_update_time_in_ms", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:last_update_time_in_ms: ", p), err) + } + if err := oprot.WriteI64(int64(p.LastUpdateTimeInMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_update_time_in_ms (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:last_update_time_in_ms: ", p), err) + } + return err +} + +func (p *HBResp) 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) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + lastUpdateTimeInMsVal := fmt.Sprintf("%v", p.LastUpdateTimeInMs) + return fmt.Sprintf("HBResp({Code:%s Leader:%s ClusterID:%s LastUpdateTimeInMs:%s})", codeVal, leaderVal, clusterIDVal, lastUpdateTimeInMsVal) +} + +// Attributes: +// - PartID +// - Term +type LeaderInfo struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Term int64 `thrift:"term,2" db:"term" json:"term"` +} + +func NewLeaderInfo() *LeaderInfo { + return &LeaderInfo{} +} + +func (p *LeaderInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *LeaderInfo) GetTerm() int64 { + return p.Term +} +func (p *LeaderInfo) 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 *LeaderInfo) 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 *LeaderInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Term = v + } + return nil +} + +func (p *LeaderInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderInfo"); 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 *LeaderInfo) 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 *LeaderInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) + } + if err := oprot.WriteI64(int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) + } + return err +} + +func (p *LeaderInfo) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + termVal := fmt.Sprintf("%v", p.Term) + return fmt.Sprintf("LeaderInfo({PartID:%s Term:%s})", partIDVal, termVal) +} + +// Attributes: +// - Role +// - Host +// - ClusterID +// - LeaderPartIds +// - GitInfoSha +// - Version +type HBReq struct { + Role HostRole `thrift:"role,1" db:"role" json:"role"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LeaderPartIds map[nebula0.GraphSpaceID][]*LeaderInfo `thrift:"leader_partIds,4" db:"leader_partIds" json:"leader_partIds,omitempty"` + GitInfoSha []byte `thrift:"git_info_sha,5" db:"git_info_sha" json:"git_info_sha"` + Version []byte `thrift:"version,6" db:"version" json:"version,omitempty"` +} + +func NewHBReq() *HBReq { + return &HBReq{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *HBReq) GetRole() HostRole { + return p.Role +} + +var HBReq_Host_DEFAULT *nebula0.HostAddr + +func (p *HBReq) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return HBReq_Host_DEFAULT + } + return p.Host +} + +func (p *HBReq) GetClusterID() ClusterID { + return p.ClusterID +} + +var HBReq_LeaderPartIds_DEFAULT map[nebula0.GraphSpaceID][]*LeaderInfo + +func (p *HBReq) GetLeaderPartIds() map[nebula0.GraphSpaceID][]*LeaderInfo { + return p.LeaderPartIds +} + +func (p *HBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} + +var HBReq_Version_DEFAULT []byte + +func (p *HBReq) GetVersion() []byte { + return p.Version +} +func (p *HBReq) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *HBReq) IsSetLeaderPartIds() bool { + return p != nil && p.LeaderPartIds != nil +} + +func (p *HBReq) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HBReq) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := HostRole(v) + p.Role = temp + } + return nil +} + +func (p *HBReq) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HBReq) 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 *HBReq) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]*LeaderInfo, size) + p.LeaderPartIds = tMap + for i := 0; i < size; i++ { + var _key42 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + _key42 = temp + } + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*LeaderInfo, 0, size) + _val43 := tSlice + for i := 0; i < size; i++ { + _elem44 := NewLeaderInfo() + if err := _elem44.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + } + _val43 = append(_val43, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderPartIds[_key42] = _val43 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.GitInfoSha = v + } + return nil +} + +func (p *HBReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Version = v + } + return nil +} + +func (p *HBReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBReq"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HBReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) + } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) + } + return err +} + +func (p *HBReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *HBReq) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetLeaderPartIds() { + if err := oprot.WriteFieldBegin("leader_partIds", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:leader_partIds: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderPartIds)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderPartIds { + 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 4:leader_partIds: ", p), err) + } + } + return err +} + +func (p *HBReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:git_info_sha: ", p), err) + } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:git_info_sha: ", p), err) + } + return err +} + +func (p *HBReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:version: ", p), err) + } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:version: ", p), err) + } + } + return err +} + +func (p *HBReq) String() string { + if p == nil { + return "" + } + + roleVal := fmt.Sprintf("%v", p.Role) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + leaderPartIdsVal := fmt.Sprintf("%v", p.LeaderPartIds) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HBReq({Role:%s Host:%s ClusterID:%s LeaderPartIds:%s GitInfoSha:%s Version:%s})", roleVal, hostVal, clusterIDVal, leaderPartIdsVal, gitInfoShaVal, versionVal) +} + +// Attributes: +// - Name +// - TypeLength +type IndexFieldDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + TypeLength *int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewIndexFieldDef() *IndexFieldDef { + return &IndexFieldDef{} +} + +func (p *IndexFieldDef) GetName() []byte { + return p.Name +} + +var IndexFieldDef_TypeLength_DEFAULT int16 + +func (p *IndexFieldDef) GetTypeLength() int16 { + if !p.IsSetTypeLength() { + return IndexFieldDef_TypeLength_DEFAULT + } + return *p.TypeLength +} +func (p *IndexFieldDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != nil +} + +func (p *IndexFieldDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName 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 + } + issetName = 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 !issetName { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")) + } + return nil +} + +func (p *IndexFieldDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IndexFieldDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TypeLength = &v + } + return nil +} + +func (p *IndexFieldDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexFieldDef"); 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 *IndexFieldDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *IndexFieldDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) + } + if err := oprot.WriteI16(int16(*p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) + } + } + return err +} + +func (p *IndexFieldDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeLengthVal string + if p.TypeLength == nil { + typeLengthVal = "" + } else { + typeLengthVal = fmt.Sprintf("%v", *p.TypeLength) + } + return fmt.Sprintf("IndexFieldDef({Name:%s TypeLength:%s})", nameVal, typeLengthVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - TagName +// - Fields +// - IfNotExists +// - Comment +type CreateTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + TagName []byte `thrift:"tag_name,3" db:"tag_name" json:"tag_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateTagIndexReq() *CreateTagIndexReq { + return &CreateTagIndexReq{} +} + +func (p *CreateTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateTagIndexReq) GetTagName() []byte { + return p.TagName +} + +func (p *CreateTagIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateTagIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} + +var CreateTagIndexReq_Comment_DEFAULT []byte + +func (p *CreateTagIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateTagIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateTagIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TagName = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem45 := NewIndexFieldDef() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.Fields = append(p.Fields, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateTagIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_name: ", p), err) + } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_name: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateTagIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *CreateTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + tagNameVal := fmt.Sprintf("%v", p.TagName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagIndexReq() *DropTagIndexReq { + return &DropTagIndexReq{} +} + +func (p *DropTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropTagIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagIndexReq) 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 *DropTagIndexReq) 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 *DropTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *DropTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagIndexReq"); 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 *DropTagIndexReq) 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 *DropTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *DropTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetTagIndexReq() *GetTagIndexReq { + return &GetTagIndexReq{} +} + +func (p *GetTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetTagIndexReq) 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 *GetTagIndexReq) 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 *GetTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *GetTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexReq"); 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 *GetTagIndexReq) 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 *GetTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *GetTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetTagIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetTagIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetTagIndexResp() *GetTagIndexResp { + return &GetTagIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + +func (p *GetTagIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetTagIndexResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetTagIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagIndexResp_Leader_DEFAULT + } + return p.Leader +} + +var GetTagIndexResp_Item_DEFAULT *IndexItem + +func (p *GetTagIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetTagIndexResp_Item_DEFAULT + } + return p.Item +} +func (p *GetTagIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetTagIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexResp"); 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetTagIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetTagIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListTagIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagIndexesReq() *ListTagIndexesReq { + return &ListTagIndexesReq{} +} + +func (p *ListTagIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagIndexesReq) 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesReq"); 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListTagIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListTagIndexesResp() *ListTagIndexesResp { + return &ListTagIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListTagIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListTagIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListTagIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListTagIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListTagIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem46 := NewIndexItem() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Items = append(p.Items, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesResp"); 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListTagIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListTagIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - EdgeName +// - Fields +// - IfNotExists +// - Comment +type CreateEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + EdgeName []byte `thrift:"edge_name,3" db:"edge_name" json:"edge_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { + return &CreateEdgeIndexReq{} +} + +func (p *CreateEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateEdgeIndexReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *CreateEdgeIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateEdgeIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} + +var CreateEdgeIndexReq_Comment_DEFAULT []byte + +func (p *CreateEdgeIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateEdgeIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateEdgeIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.EdgeName = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem47 := NewIndexFieldDef() + if err := _elem47.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + } + p.Fields = append(p.Fields, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Comment = v + } + return nil +} + +func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_name: ", p), err) + } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_name: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateEdgeIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) + } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) + } + } + return err +} + +func (p *CreateEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeIndexReq() *DropEdgeIndexReq { + return &DropEdgeIndexReq{} +} + +func (p *DropEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropEdgeIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeIndexReq) 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *DropEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeIndexReq"); 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *DropEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) + } + return err +} + +func (p *DropEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetEdgeIndexReq() *GetEdgeIndexReq { + return &GetEdgeIndexReq{} +} + +func (p *GetEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetEdgeIndexReq) 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *GetEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexReq"); 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *GetEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetEdgeIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetEdgeIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetEdgeIndexResp() *GetEdgeIndexResp { + return &GetEdgeIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + +func (p *GetEdgeIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetEdgeIndexResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetEdgeIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeIndexResp_Leader_DEFAULT + } + return p.Leader +} + +var GetEdgeIndexResp_Item_DEFAULT *IndexItem + +func (p *GetEdgeIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetEdgeIndexResp_Item_DEFAULT + } + return p.Item +} +func (p *GetEdgeIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetEdgeIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexResp"); 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) + } + return err +} + +func (p *GetEdgeIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetEdgeIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListEdgeIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgeIndexesReq() *ListEdgeIndexesReq { + return &ListEdgeIndexesReq{} +} + +func (p *ListEdgeIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesReq"); 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgeIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListEdgeIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListEdgeIndexesResp() *ListEdgeIndexesResp { + return &ListEdgeIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListEdgeIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListEdgeIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListEdgeIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgeIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListEdgeIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListEdgeIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem48 := NewIndexItem() + if err := _elem48.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.Items = append(p.Items, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgeIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesResp"); 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListEdgeIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListEdgeIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type RebuildIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewRebuildIndexReq() *RebuildIndexReq { + return &RebuildIndexReq{} +} + +func (p *RebuildIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *RebuildIndexReq) 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 *RebuildIndexReq) 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 *RebuildIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IndexName = v + } + return nil +} + +func (p *RebuildIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexReq"); 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 *RebuildIndexReq) 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 *RebuildIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) + } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) + } + return err +} + +func (p *RebuildIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("RebuildIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Account +// - EncodedPwd +// - IfNotExists +type CreateUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` + IfNotExists bool `thrift:"if_not_exists,3" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateUserReq() *CreateUserReq { + return &CreateUserReq{} +} + +func (p *CreateUserReq) GetAccount() []byte { + return p.Account +} + +func (p *CreateUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} + +func (p *CreateUserReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateUserReq) 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 *CreateUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *CreateUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EncodedPwd = v + } + return nil +} + +func (p *CreateUserReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IfNotExists = v + } + return nil +} + +func (p *CreateUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateUserReq"); 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 *CreateUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *CreateUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) + } + return err +} + +func (p *CreateUserReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_not_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) + } + return err +} + +func (p *CreateUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateUserReq({Account:%s EncodedPwd:%s IfNotExists:%s})", accountVal, encodedPwdVal, ifNotExistsVal) +} + +// Attributes: +// - Account +// - IfExists +type DropUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropUserReq() *DropUserReq { + return &DropUserReq{} +} + +func (p *DropUserReq) GetAccount() []byte { + return p.Account +} + +func (p *DropUserReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropUserReq) 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 *DropUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *DropUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.IfExists = v + } + return nil +} + +func (p *DropUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropUserReq"); 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 *DropUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *DropUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) + } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) + } + return err +} + +func (p *DropUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropUserReq({Account:%s IfExists:%s})", accountVal, ifExistsVal) +} + +// Attributes: +// - Account +// - EncodedPwd +type AlterUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` +} + +func NewAlterUserReq() *AlterUserReq { + return &AlterUserReq{} +} + +func (p *AlterUserReq) GetAccount() []byte { + return p.Account +} + +func (p *AlterUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} +func (p *AlterUserReq) 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 *AlterUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *AlterUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.EncodedPwd = v + } + return nil +} + +func (p *AlterUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterUserReq"); 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 *AlterUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *AlterUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) + } + return err +} + +func (p *AlterUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + return fmt.Sprintf("AlterUserReq({Account:%s EncodedPwd:%s})", accountVal, encodedPwdVal) +} + +// Attributes: +// - RoleItem +type GrantRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewGrantRoleReq() *GrantRoleReq { + return &GrantRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var GrantRoleReq_RoleItem_DEFAULT *RoleItem + +func (p *GrantRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return GrantRoleReq_RoleItem_DEFAULT + } + return p.RoleItem +} +func (p *GrantRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *GrantRoleReq) 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 *GrantRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *GrantRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GrantRoleReq"); 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 *GrantRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) + } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) + } + return err +} + +func (p *GrantRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("GrantRoleReq({RoleItem:%s})", roleItemVal) +} + +// Attributes: +// - RoleItem +type RevokeRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewRevokeRoleReq() *RevokeRoleReq { + return &RevokeRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var RevokeRoleReq_RoleItem_DEFAULT *RoleItem + +func (p *RevokeRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return RevokeRoleReq_RoleItem_DEFAULT + } + return p.RoleItem +} +func (p *RevokeRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *RevokeRoleReq) 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 *RevokeRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *RevokeRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RevokeRoleReq"); 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 *RevokeRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) + } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) + } + return err +} + +func (p *RevokeRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("RevokeRoleReq({RoleItem:%s})", roleItemVal) +} + +type ListUsersReq struct { +} + +func NewListUsersReq() *ListUsersReq { + return &ListUsersReq{} +} + +func (p *ListUsersReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListUsersReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListUsersReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Users +type ListUsersResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Users map[string][]byte `thrift:"users,3" db:"users" json:"users"` +} + +func NewListUsersResp() *ListUsersResp { + return &ListUsersResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListUsersResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListUsersResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListUsersResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListUsersResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListUsersResp) GetUsers() map[string][]byte { + return p.Users +} +func (p *ListUsersResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.Users = tMap + for i := 0; i < size; i++ { + var _key49 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key49 = v + } + var _val50 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val50 = v + } + p.Users[_key49] = _val50 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListUsersResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersResp"); 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("users", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:users: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Users)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Users { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:users: ", p), err) + } + return err +} + +func (p *ListUsersResp) 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) + } + usersVal := fmt.Sprintf("%v", p.Users) + return fmt.Sprintf("ListUsersResp({Code:%s Leader:%s Users:%s})", codeVal, leaderVal, usersVal) +} + +// Attributes: +// - SpaceID +type ListRolesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListRolesReq() *ListRolesReq { + return &ListRolesReq{} +} + +func (p *ListRolesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListRolesReq) 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 *ListRolesReq) 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 *ListRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesReq"); 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 *ListRolesReq) 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 *ListRolesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListRolesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Roles +type ListRolesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Roles []*RoleItem `thrift:"roles,3" db:"roles" json:"roles"` +} + +func NewListRolesResp() *ListRolesResp { + return &ListRolesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListRolesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListRolesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListRolesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListRolesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListRolesResp) GetRoles() []*RoleItem { + return p.Roles +} +func (p *ListRolesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*RoleItem, 0, size) + p.Roles = tSlice + for i := 0; i < size; i++ { + _elem51 := NewRoleItem() + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + } + p.Roles = append(p.Roles, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListRolesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesResp"); 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("roles", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:roles: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Roles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Roles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:roles: ", p), err) + } + return err +} + +func (p *ListRolesResp) 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) + } + rolesVal := fmt.Sprintf("%v", p.Roles) + return fmt.Sprintf("ListRolesResp({Code:%s Leader:%s Roles:%s})", codeVal, leaderVal, rolesVal) +} + +// Attributes: +// - Account +type GetUserRolesReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` +} + +func NewGetUserRolesReq() *GetUserRolesReq { + return &GetUserRolesReq{} +} + +func (p *GetUserRolesReq) GetAccount() []byte { + return p.Account +} +func (p *GetUserRolesReq) 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 *GetUserRolesReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *GetUserRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUserRolesReq"); 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 *GetUserRolesReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *GetUserRolesReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + return fmt.Sprintf("GetUserRolesReq({Account:%s})", accountVal) +} + +// Attributes: +// - Account +// - NewEncodedPwd_ +// - OldEncodedPwd +type ChangePasswordReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + NewEncodedPwd_ []byte `thrift:"new_encoded_pwd,2" db:"new_encoded_pwd" json:"new_encoded_pwd"` + OldEncodedPwd []byte `thrift:"old_encoded_pwd,3" db:"old_encoded_pwd" json:"old_encoded_pwd"` +} + +func NewChangePasswordReq() *ChangePasswordReq { + return &ChangePasswordReq{} +} + +func (p *ChangePasswordReq) GetAccount() []byte { + return p.Account +} + +func (p *ChangePasswordReq) GetNewEncodedPwd_() []byte { + return p.NewEncodedPwd_ +} + +func (p *ChangePasswordReq) GetOldEncodedPwd() []byte { + return p.OldEncodedPwd +} +func (p *ChangePasswordReq) 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 *ChangePasswordReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Account = v + } + return nil +} + +func (p *ChangePasswordReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.NewEncodedPwd_ = v + } + return nil +} + +func (p *ChangePasswordReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.OldEncodedPwd = v + } + return nil +} + +func (p *ChangePasswordReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChangePasswordReq"); 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 *ChangePasswordReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) + } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.NewEncodedPwd_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_encoded_pwd (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_encoded_pwd: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("old_encoded_pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:old_encoded_pwd: ", p), err) + } + if err := oprot.WriteBinary(p.OldEncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_encoded_pwd (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:old_encoded_pwd: ", p), err) + } + return err +} + +func (p *ChangePasswordReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + newEncodedPwdVal := fmt.Sprintf("%v", p.NewEncodedPwd_) + oldEncodedPwdVal := fmt.Sprintf("%v", p.OldEncodedPwd) + return fmt.Sprintf("ChangePasswordReq({Account:%s NewEncodedPwd_:%s OldEncodedPwd:%s})", accountVal, newEncodedPwdVal, oldEncodedPwdVal) +} + +// Attributes: +// - SpaceID +// - Id +// - HostDel +// - Stop +// - Reset +type BalanceReq struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + Id *int64 `thrift:"id,2" db:"id" json:"id,omitempty"` + HostDel []*nebula0.HostAddr `thrift:"host_del,3" db:"host_del" json:"host_del,omitempty"` + Stop *bool `thrift:"stop,4" db:"stop" json:"stop,omitempty"` + Reset *bool `thrift:"reset,5" db:"reset" json:"reset,omitempty"` +} + +func NewBalanceReq() *BalanceReq { + return &BalanceReq{} +} + +var BalanceReq_SpaceID_DEFAULT nebula0.GraphSpaceID + +func (p *BalanceReq) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return BalanceReq_SpaceID_DEFAULT + } + return *p.SpaceID +} + +var BalanceReq_Id_DEFAULT int64 + +func (p *BalanceReq) GetId() int64 { + if !p.IsSetId() { + return BalanceReq_Id_DEFAULT + } + return *p.Id +} + +var BalanceReq_HostDel_DEFAULT []*nebula0.HostAddr + +func (p *BalanceReq) GetHostDel() []*nebula0.HostAddr { + return p.HostDel +} + +var BalanceReq_Stop_DEFAULT bool + +func (p *BalanceReq) GetStop() bool { + if !p.IsSetStop() { + return BalanceReq_Stop_DEFAULT + } + return *p.Stop +} + +var BalanceReq_Reset_DEFAULT bool + +func (p *BalanceReq) GetReset() bool { + if !p.IsSetReset() { + return BalanceReq_Reset_DEFAULT + } + return *p.Reset +} +func (p *BalanceReq) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *BalanceReq) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *BalanceReq) IsSetHostDel() bool { + return p != nil && p.HostDel != nil +} + +func (p *BalanceReq) IsSetStop() bool { + return p != nil && p.Stop != nil +} + +func (p *BalanceReq) IsSetReset() bool { + return p != nil && p.Reset != nil +} + +func (p *BalanceReq) 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 + } + 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 *BalanceReq) 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 *BalanceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Id = &v + } + return nil +} + +func (p *BalanceReq) ReadField3(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.HostDel = tSlice + for i := 0; i < size; i++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.HostDel = append(p.HostDel, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Stop = &v + } + return nil +} + +func (p *BalanceReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.Reset = &v + } + return nil +} + +func (p *BalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceReq"); 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 *BalanceReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *BalanceReq) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetId() { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := oprot.WriteI64(int64(*p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetHostDel() { + if err := oprot.WriteFieldBegin("host_del", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_del: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HostDel)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HostDel { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host_del: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStop() { + if err := oprot.WriteFieldBegin("stop", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop: ", p), err) + } + if err := oprot.WriteBool(bool(*p.Stop)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop: ", p), err) + } + } + return err +} + +func (p *BalanceReq) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetReset() { + if err := oprot.WriteFieldBegin("reset", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:reset: ", p), err) + } + if err := oprot.WriteBool(bool(*p.Reset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reset (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:reset: ", p), err) + } + } + return err +} + +func (p *BalanceReq) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", *p.Id) + } + hostDelVal := fmt.Sprintf("%v", p.HostDel) + var stopVal string + if p.Stop == nil { + stopVal = "" + } else { + stopVal = fmt.Sprintf("%v", *p.Stop) + } + var resetVal string + if p.Reset == nil { + resetVal = "" + } else { + resetVal = fmt.Sprintf("%v", *p.Reset) + } + return fmt.Sprintf("BalanceReq({SpaceID:%s Id:%s HostDel:%s Stop:%s Reset:%s})", spaceIDVal, idVal, hostDelVal, stopVal, resetVal) +} + +// Attributes: +// - Id +// - Result_ +type BalanceTask struct { + Id []byte `thrift:"id,1" db:"id" json:"id"` + Result_ TaskResult_ `thrift:"result,2" db:"result" json:"result"` +} + +func NewBalanceTask() *BalanceTask { + return &BalanceTask{} +} + +func (p *BalanceTask) GetId() []byte { + return p.Id +} + +func (p *BalanceTask) GetResult_() TaskResult_ { + return p.Result_ +} +func (p *BalanceTask) 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 *BalanceTask) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *BalanceTask) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TaskResult_(v) + p.Result_ = temp + } + return nil +} + +func (p *BalanceTask) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceTask"); 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 *BalanceTask) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) + } + if err := oprot.WriteBinary(p.Id); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) + } + return err +} + +func (p *BalanceTask) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:result: ", p), err) + } + if err := oprot.WriteI32(int32(p.Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.result (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:result: ", p), err) + } + return err +} + +func (p *BalanceTask) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + resultVal := fmt.Sprintf("%v", p.Result_) + return fmt.Sprintf("BalanceTask({Id:%s Result_:%s})", idVal, resultVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +// - Tasks +type BalanceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id int64 `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` + Tasks []*BalanceTask `thrift:"tasks,4" db:"tasks" json:"tasks"` +} + +func NewBalanceResp() *BalanceResp { + return &BalanceResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *BalanceResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *BalanceResp) GetId() int64 { + return p.Id +} + +var BalanceResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *BalanceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return BalanceResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *BalanceResp) GetTasks() []*BalanceTask { + return p.Tasks +} +func (p *BalanceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *BalanceResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Id = v + } + return nil +} + +func (p *BalanceResp) ReadField3(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 *BalanceResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BalanceTask, 0, size) + p.Tasks = tSlice + for i := 0; i < size; i++ { + _elem53 := NewBalanceTask() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) + } + p.Tasks = append(p.Tasks, _elem53) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) + } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) + } + return err +} + +func (p *BalanceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) + } + return err +} + +func (p *BalanceResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tasks", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tasks: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tasks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tasks { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tasks: ", p), err) + } + return err +} + +func (p *BalanceResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + idVal := fmt.Sprintf("%v", p.Id) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + tasksVal := fmt.Sprintf("%v", p.Tasks) + return fmt.Sprintf("BalanceResp({Code:%s Id:%s Leader:%s Tasks:%s})", codeVal, idVal, leaderVal, tasksVal) +} + +type LeaderBalanceReq struct { +} + +func NewLeaderBalanceReq() *LeaderBalanceReq { + return &LeaderBalanceReq{} +} + +func (p *LeaderBalanceReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LeaderBalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderBalanceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *LeaderBalanceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("LeaderBalanceReq({})") +} + +// Attributes: +// - Module +// - Name +// - Mode +// - Value +type ConfigItem struct { + Module ConfigModule `thrift:"module,1" db:"module" json:"module"` + Name []byte `thrift:"name,2" db:"name" json:"name"` + Mode ConfigMode `thrift:"mode,3" db:"mode" json:"mode"` + Value *nebula0.Value `thrift:"value,4" db:"value" json:"value"` +} + +func NewConfigItem() *ConfigItem { + return &ConfigItem{} +} + +func (p *ConfigItem) GetModule() ConfigModule { + return p.Module +} + +func (p *ConfigItem) GetName() []byte { + return p.Name +} + +func (p *ConfigItem) GetMode() ConfigMode { + return p.Mode +} + +var ConfigItem_Value_DEFAULT *nebula0.Value + +func (p *ConfigItem) GetValue() *nebula0.Value { + if !p.IsSetValue() { + return ConfigItem_Value_DEFAULT + } + return p.Value +} +func (p *ConfigItem) IsSetValue() bool { + return p != nil && p.Value != nil +} + +func (p *ConfigItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ConfigItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ConfigModule(v) + p.Module = temp + } + return nil +} + +func (p *ConfigItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *ConfigItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := ConfigMode(v) + p.Mode = temp + } + return nil +} + +func (p *ConfigItem) ReadField4(iprot thrift.Protocol) error { + p.Value = nebula0.NewValue() + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ConfigItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ConfigItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ConfigItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:module: ", p), err) + } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:module: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) + } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err) + } + if err := oprot.WriteI32(int32(p.Mode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err) + } + return err +} + +func (p *ConfigItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) + } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) + } + return err +} + +func (p *ConfigItem) String() string { + if p == nil { + return "" + } + + moduleVal := fmt.Sprintf("%v", p.Module) + nameVal := fmt.Sprintf("%v", p.Name) + modeVal := fmt.Sprintf("%v", p.Mode) + var valueVal string + if p.Value == nil { + valueVal = "" + } else { + valueVal = fmt.Sprintf("%v", p.Value) + } + return fmt.Sprintf("ConfigItem({Module:%s Name:%s Mode:%s Value:%s})", moduleVal, nameVal, modeVal, valueVal) +} + +// Attributes: +// - Items +type RegConfigReq struct { + Items []*ConfigItem `thrift:"items,1" db:"items" json:"items"` +} + +func NewRegConfigReq() *RegConfigReq { + return &RegConfigReq{} +} + +func (p *RegConfigReq) GetItems() []*ConfigItem { + return p.Items +} +func (p *RegConfigReq) 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 *RegConfigReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem54 := NewConfigItem() + if err := _elem54.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.Items = append(p.Items, _elem54) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RegConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RegConfigReq"); 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 *RegConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:items: ", p), err) + } + return err +} + +func (p *RegConfigReq) String() string { + if p == nil { + return "" + } + + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("RegConfigReq({Items:%s})", itemsVal) +} + +// Attributes: +// - Item +type GetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewGetConfigReq() *GetConfigReq { + return &GetConfigReq{ + Item: NewConfigItem(), + } +} + +var GetConfigReq_Item_DEFAULT *ConfigItem + +func (p *GetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return GetConfigReq_Item_DEFAULT + } + return p.Item +} +func (p *GetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetConfigReq) 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 *GetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigReq"); 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 *GetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) + } + return err +} + +func (p *GetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type GetConfigResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewGetConfigResp() *GetConfigResp { + return &GetConfigResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetConfigResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetConfigResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetConfigResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetConfigResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetConfigResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *GetConfigResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem55 := NewConfigItem() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) + } + p.Items = append(p.Items, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetConfigResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigResp"); 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *GetConfigResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("GetConfigResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - Item +type SetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewSetConfigReq() *SetConfigReq { + return &SetConfigReq{ + Item: NewConfigItem(), + } +} + +var SetConfigReq_Item_DEFAULT *ConfigItem + +func (p *SetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return SetConfigReq_Item_DEFAULT + } + return p.Item +} +func (p *SetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *SetConfigReq) 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 *SetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *SetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SetConfigReq"); 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 *SetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) + } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) + } + return err +} + +func (p *SetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("SetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Space +// - Module +type ListConfigsReq struct { + Space []byte `thrift:"space,1" db:"space" json:"space"` + Module ConfigModule `thrift:"module,2" db:"module" json:"module"` +} + +func NewListConfigsReq() *ListConfigsReq { + return &ListConfigsReq{} +} + +func (p *ListConfigsReq) GetSpace() []byte { + return p.Space +} + +func (p *ListConfigsReq) GetModule() ConfigModule { + return p.Module +} +func (p *ListConfigsReq) 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 *ListConfigsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Space = v + } + return nil +} + +func (p *ListConfigsReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ConfigModule(v) + p.Module = temp + } + return nil +} + +func (p *ListConfigsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsReq"); 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 *ListConfigsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) + } + if err := oprot.WriteBinary(p.Space); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) + } + return err +} + +func (p *ListConfigsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:module: ", p), err) + } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:module: ", p), err) + } + return err +} + +func (p *ListConfigsReq) String() string { + if p == nil { + return "" + } + + spaceVal := fmt.Sprintf("%v", p.Space) + moduleVal := fmt.Sprintf("%v", p.Module) + return fmt.Sprintf("ListConfigsReq({Space:%s Module:%s})", spaceVal, moduleVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListConfigsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListConfigsResp() *ListConfigsResp { + return &ListConfigsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListConfigsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListConfigsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListConfigsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListConfigsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListConfigsResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *ListConfigsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i++ { + _elem56 := NewConfigItem() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Items = append(p.Items, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListConfigsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsResp"); 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) + } + return err +} + +func (p *ListConfigsResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListConfigsResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +type CreateSnapshotReq struct { +} + +func NewCreateSnapshotReq() *CreateSnapshotReq { + return &CreateSnapshotReq{} +} + +func (p *CreateSnapshotReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateSnapshotReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("CreateSnapshotReq({})") +} + +// Attributes: +// - Name +type DropSnapshotReq struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` +} + +func NewDropSnapshotReq() *DropSnapshotReq { + return &DropSnapshotReq{} +} + +func (p *DropSnapshotReq) GetName() []byte { + return p.Name +} +func (p *DropSnapshotReq) 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 *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 + } + return nil +} + +func (p *DropSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSnapshotReq"); 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 *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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *DropSnapshotReq) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropSnapshotReq({Name:%s})", nameVal) +} + +type ListSnapshotsReq struct { +} + +func NewListSnapshotsReq() *ListSnapshotsReq { + return &ListSnapshotsReq{} +} + +func (p *ListSnapshotsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSnapshotsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSnapshotsReq({})") +} + +// Attributes: +// - Name +// - Status +// - Hosts +type Snapshot struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status SnapshotStatus `thrift:"status,2" db:"status" json:"status"` + Hosts []byte `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewSnapshot() *Snapshot { + return &Snapshot{} +} + +func (p *Snapshot) GetName() []byte { + return p.Name +} + +func (p *Snapshot) GetStatus() SnapshotStatus { + return p.Status +} + +func (p *Snapshot) GetHosts() []byte { + return p.Hosts +} +func (p *Snapshot) 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 *Snapshot) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *Snapshot) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := SnapshotStatus(v) + p.Status = temp + } + return nil +} + +func (p *Snapshot) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Hosts = v + } + return nil +} + +func (p *Snapshot) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Snapshot"); 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 *Snapshot) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *Snapshot) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *Snapshot) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) + } + if err := oprot.WriteBinary(p.Hosts); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hosts (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) + } + return err +} + +func (p *Snapshot) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("Snapshot({Name:%s Status:%s Hosts:%s})", nameVal, statusVal, hostsVal) +} + +// Attributes: +// - Code +// - Leader +// - Snapshots +type ListSnapshotsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Snapshots []*Snapshot `thrift:"snapshots,3" db:"snapshots" json:"snapshots"` +} + +func NewListSnapshotsResp() *ListSnapshotsResp { + return &ListSnapshotsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSnapshotsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSnapshotsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSnapshotsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSnapshotsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSnapshotsResp) GetSnapshots() []*Snapshot { + return p.Snapshots +} +func (p *ListSnapshotsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Snapshot, 0, size) + p.Snapshots = tSlice + for i := 0; i < size; i++ { + _elem57 := NewSnapshot() + if err := _elem57.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) + } + p.Snapshots = append(p.Snapshots, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSnapshotsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsResp"); 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("snapshots", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:snapshots: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Snapshots)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Snapshots { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:snapshots: ", p), err) + } + return err +} + +func (p *ListSnapshotsResp) 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) + } + snapshotsVal := fmt.Sprintf("%v", p.Snapshots) + return fmt.Sprintf("ListSnapshotsResp({Code:%s Leader:%s Snapshots:%s})", codeVal, leaderVal, snapshotsVal) +} + +// Attributes: +// - SpaceID +type ListIndexStatusReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListIndexStatusReq() *ListIndexStatusReq { + return &ListIndexStatusReq{} +} + +func (p *ListIndexStatusReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListIndexStatusReq) 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusReq"); 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListIndexStatusReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Name +// - Status +type IndexStatus struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status []byte `thrift:"status,2" db:"status" json:"status"` +} + +func NewIndexStatus() *IndexStatus { + return &IndexStatus{} +} + +func (p *IndexStatus) GetName() []byte { + return p.Name +} + +func (p *IndexStatus) GetStatus() []byte { + return p.Status +} +func (p *IndexStatus) 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 *IndexStatus) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *IndexStatus) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Status = v + } + return nil +} + +func (p *IndexStatus) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexStatus"); 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 *IndexStatus) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) + } + return err +} + +func (p *IndexStatus) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteBinary(p.Status); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *IndexStatus) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("IndexStatus({Name:%s Status:%s})", nameVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Statuses +type ListIndexStatusResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statuses []*IndexStatus `thrift:"statuses,3" db:"statuses" json:"statuses"` +} + +func NewListIndexStatusResp() *ListIndexStatusResp { + return &ListIndexStatusResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListIndexStatusResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListIndexStatusResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListIndexStatusResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListIndexStatusResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListIndexStatusResp) GetStatuses() []*IndexStatus { + return p.Statuses +} +func (p *ListIndexStatusResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexStatus, 0, size) + p.Statuses = tSlice + for i := 0; i < size; i++ { + _elem58 := NewIndexStatus() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Statuses = append(p.Statuses, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) + } + if err := oprot.WriteI32(int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) + } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) + } + return err +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + statusesVal := fmt.Sprintf("%v", p.Statuses) + return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) +} + +// Attributes: +// - ZoneName +// - Nodes +type AddZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewAddZoneReq() *AddZoneReq { + return &AddZoneReq{} +} + +func (p *AddZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneReq) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *AddZoneReq) 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 *AddZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddZoneReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i++ { + _elem59 := nebula0.NewHostAddr() + if err := _elem59.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Nodes = append(p.Nodes, _elem59) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneReq"); err != nil { + 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 *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *AddZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) + } + return err +} + +func (p *AddZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("AddZoneReq({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - ZoneName +type DropZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewDropZoneReq() *DropZoneReq { + return &DropZoneReq{} +} + +func (p *DropZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropZoneReq) 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 *DropZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *DropZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type AddHostIntoZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewAddHostIntoZoneReq() *AddHostIntoZoneReq { + return &AddHostIntoZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var AddHostIntoZoneReq_Node_DEFAULT *nebula0.HostAddr + +func (p *AddHostIntoZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return AddHostIntoZoneReq_Node_DEFAULT + } + return p.Node +} + +func (p *AddHostIntoZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *AddHostIntoZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *AddHostIntoZoneReq) 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 *AddHostIntoZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostIntoZoneReq"); 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 *AddHostIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) + } + return err +} + +func (p *AddHostIntoZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("AddHostIntoZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type DropHostFromZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewDropHostFromZoneReq() *DropHostFromZoneReq { + return &DropHostFromZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var DropHostFromZoneReq_Node_DEFAULT *nebula0.HostAddr + +func (p *DropHostFromZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return DropHostFromZoneReq_Node_DEFAULT + } + return p.Node +} + +func (p *DropHostFromZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropHostFromZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *DropHostFromZoneReq) 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 *DropHostFromZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropHostFromZoneReq"); 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 *DropHostFromZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) + } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) + } + return err +} + +func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) + } + return err +} + +func (p *DropHostFromZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropHostFromZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - ZoneName +type GetZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewGetZoneReq() *GetZoneReq { + return &GetZoneReq{} +} + +func (p *GetZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *GetZoneReq) 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 *GetZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *GetZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneReq"); 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 *GetZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *GetZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("GetZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type GetZoneResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewGetZoneResp() *GetZoneResp { + return &GetZoneResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetZoneResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetZoneResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetZoneResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetZoneResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetZoneResp) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *GetZoneResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) ReadField3(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++ { + _elem60 := nebula0.NewHostAddr() + if err := _elem60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) + } + p.Hosts = append(p.Hosts, _elem60) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetZoneResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneResp"); 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *GetZoneResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("GetZoneResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +type ListZonesReq struct { +} + +func NewListZonesReq() *ListZonesReq { + return &ListZonesReq{} +} + +func (p *ListZonesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListZonesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListZonesReq({})") +} + +// Attributes: +// - ZoneName +// - Nodes +type Zone struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewZone() *Zone { + return &Zone{} +} + +func (p *Zone) GetZoneName() []byte { + return p.ZoneName +} + +func (p *Zone) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *Zone) 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 *Zone) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *Zone) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i++ { + _elem61 := nebula0.NewHostAddr() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + } + p.Nodes = append(p.Nodes, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Zone) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Zone"); 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 *Zone) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *Zone) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) + } + return err +} + +func (p *Zone) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("Zone({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - Code +// - Leader +// - Zones +type ListZonesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Zones []*Zone `thrift:"zones,3" db:"zones" json:"zones"` +} + +func NewListZonesResp() *ListZonesResp { + return &ListZonesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListZonesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListZonesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListZonesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListZonesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListZonesResp) GetZones() []*Zone { + return p.Zones +} +func (p *ListZonesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Zone, 0, size) + p.Zones = tSlice + for i := 0; i < size; i++ { + _elem62 := NewZone() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Zones = append(p.Zones, _elem62) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListZonesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesResp"); 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zones", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zones: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zones: ", p), err) + } + return err +} + +func (p *ListZonesResp) 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) + } + zonesVal := fmt.Sprintf("%v", p.Zones) + return fmt.Sprintf("ListZonesResp({Code:%s Leader:%s Zones:%s})", codeVal, leaderVal, zonesVal) +} + +// Attributes: +// - GroupName +// - ZoneNames +type AddGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewAddGroupReq() *AddGroupReq { + return &AddGroupReq{} +} + +func (p *AddGroupReq) GetGroupName() []byte { + return p.GroupName +} + +func (p *AddGroupReq) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *AddGroupReq) 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 *AddGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *AddGroupReq) 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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem63 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem63 = v + } + p.ZoneNames = append(p.ZoneNames, _elem63) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddGroupReq"); 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 *AddGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *AddGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) + } + return err +} + +func (p *AddGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("AddGroupReq({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - GroupName +type DropGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewDropGroupReq() *DropGroupReq { + return &DropGroupReq{} +} + +func (p *DropGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropGroupReq) 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 *DropGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *DropGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropGroupReq"); 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 *DropGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *DropGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type AddZoneIntoGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewAddZoneIntoGroupReq() *AddZoneIntoGroupReq { + return &AddZoneIntoGroupReq{} +} + +func (p *AddZoneIntoGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneIntoGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *AddZoneIntoGroupReq) 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 *AddZoneIntoGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *AddZoneIntoGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *AddZoneIntoGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneIntoGroupReq"); 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 *AddZoneIntoGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *AddZoneIntoGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) + } + return err +} + +func (p *AddZoneIntoGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("AddZoneIntoGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type DropZoneFromGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewDropZoneFromGroupReq() *DropZoneFromGroupReq { + return &DropZoneFromGroupReq{} +} + +func (p *DropZoneFromGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *DropZoneFromGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropZoneFromGroupReq) 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 *DropZoneFromGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ZoneName = v + } + return nil +} + +func (p *DropZoneFromGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *DropZoneFromGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneFromGroupReq"); 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 *DropZoneFromGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) + } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) + } + return err +} + +func (p *DropZoneFromGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) + } + return err +} + +func (p *DropZoneFromGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropZoneFromGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - GroupName +type GetGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewGetGroupReq() *GetGroupReq { + return &GetGroupReq{} +} + +func (p *GetGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *GetGroupReq) 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 *GetGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *GetGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupReq"); 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 *GetGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *GetGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("GetGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - Code +// - Leader +// - ZoneNames +type GetGroupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ZoneNames [][]byte `thrift:"zone_names,3" db:"zone_names" json:"zone_names"` +} + +func NewGetGroupResp() *GetGroupResp { + return &GetGroupResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *GetGroupResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetGroupResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetGroupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetGroupResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *GetGroupResp) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *GetGroupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) ReadField3(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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem64 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem64 = v + } + p.ZoneNames = append(p.ZoneNames, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetGroupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupResp"); 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zone_names: ", p), err) + } + return err +} + +func (p *GetGroupResp) 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) + } + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("GetGroupResp({Code:%s Leader:%s ZoneNames:%s})", codeVal, leaderVal, zoneNamesVal) +} + +type ListGroupsReq struct { +} + +func NewListGroupsReq() *ListGroupsReq { + return &ListGroupsReq{} +} + +func (p *ListGroupsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListGroupsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListGroupsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListGroupsReq({})") +} + +// Attributes: +// - GroupName +// - ZoneNames +type Group struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewGroup() *Group { + return &Group{} +} + +func (p *Group) GetGroupName() []byte { + return p.GroupName +} + +func (p *Group) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *Group) 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 *Group) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GroupName = v + } + return nil +} + +func (p *Group) 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.ZoneNames = tSlice + for i := 0; i < size; i++ { + var _elem65 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem65 = v + } + p.ZoneNames = append(p.ZoneNames, _elem65) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Group) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Group"); 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 *Group) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) + } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) + } + return err +} + +func (p *Group) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) + } + return err +} + +func (p *Group) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("Group({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - Code +// - Leader +// - Groups +type ListGroupsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Groups []*Group `thrift:"groups,3" db:"groups" json:"groups"` +} + +func NewListGroupsResp() *ListGroupsResp { + return &ListGroupsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListGroupsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListGroupsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListGroupsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListGroupsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListGroupsResp) GetGroups() []*Group { + return p.Groups +} +func (p *ListGroupsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Group, 0, size) + p.Groups = tSlice + for i := 0; i < size; i++ { + _elem66 := NewGroup() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + p.Groups = append(p.Groups, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListGroupsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsResp"); 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("groups", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:groups: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Groups)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Groups { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:groups: ", p), err) + } + return err +} + +func (p *ListGroupsResp) 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) + } + groupsVal := fmt.Sprintf("%v", p.Groups) + return fmt.Sprintf("ListGroupsResp({Code:%s Leader:%s Groups:%s})", codeVal, leaderVal, groupsVal) +} + +// Attributes: +// - SpaceID +// - Type +// - Hosts +type AddListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewAddListenerReq() *AddListenerReq { + return &AddListenerReq{} +} + +func (p *AddListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddListenerReq) GetType() ListenerType { + return p.Type +} + +func (p *AddListenerReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *AddListenerReq) 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 *AddListenerReq) 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 *AddListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *AddListenerReq) ReadField3(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++ { + _elem67 := nebula0.NewHostAddr() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) + } + p.Hosts = append(p.Hosts, _elem67) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddListenerReq"); 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 *AddListenerReq) 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 *AddListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *AddListenerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) + } + return err +} + +func (p *AddListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("AddListenerReq({SpaceID:%s Type:%s Hosts:%s})", spaceIDVal, typeVal, hostsVal) +} + +// Attributes: +// - SpaceID +// - Type +type RemoveListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` +} + +func NewRemoveListenerReq() *RemoveListenerReq { + return &RemoveListenerReq{} +} + +func (p *RemoveListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemoveListenerReq) GetType() ListenerType { + return p.Type +} +func (p *RemoveListenerReq) 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 *RemoveListenerReq) 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 *RemoveListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *RemoveListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveListenerReq"); 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 *RemoveListenerReq) 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 *RemoveListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) + } + return err +} + +func (p *RemoveListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("RemoveListenerReq({SpaceID:%s Type:%s})", spaceIDVal, typeVal) +} + +// Attributes: +// - SpaceID +type ListListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListListenerReq() *ListListenerReq { + return &ListListenerReq{} +} + +func (p *ListListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListListenerReq) 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 *ListListenerReq) 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 *ListListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerReq"); 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 *ListListenerReq) 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 *ListListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListListenerReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Type +// - Host +// - PartID +// - Status +type ListenerInfo struct { + Type ListenerType `thrift:"type,1" db:"type" json:"type"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + PartID nebula0.PartitionID `thrift:"part_id,3" db:"part_id" json:"part_id"` + Status HostStatus `thrift:"status,4" db:"status" json:"status"` +} + +func NewListenerInfo() *ListenerInfo { + return &ListenerInfo{ + Host: nebula0.NewHostAddr(), + } +} + +func (p *ListenerInfo) GetType() ListenerType { + return p.Type +} + +var ListenerInfo_Host_DEFAULT *nebula0.HostAddr + +func (p *ListenerInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return ListenerInfo_Host_DEFAULT + } + return p.Host +} + +func (p *ListenerInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *ListenerInfo) GetStatus() HostStatus { + return p.Status +} +func (p *ListenerInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *ListenerInfo) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListenerInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := ListenerType(v) + p.Type = temp + } + return nil +} + +func (p *ListenerInfo) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ListenerInfo) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.PartitionID(v) + p.PartID = temp + } + return nil +} + +func (p *ListenerInfo) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := HostStatus(v) + p.Status = temp + } + return nil +} + +func (p *ListenerInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListenerInfo"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListenerInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) + } + return err +} + +func (p *ListenerInfo) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *ListenerInfo) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + partIDVal := fmt.Sprintf("%v", p.PartID) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("ListenerInfo({Type:%s Host:%s PartID:%s Status:%s})", typeVal, hostVal, partIDVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Listeners +type ListListenerResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Listeners []*ListenerInfo `thrift:"listeners,3" db:"listeners" json:"listeners"` +} + +func NewListListenerResp() *ListListenerResp { + return &ListListenerResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListListenerResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListListenerResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListListenerResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListListenerResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListListenerResp) GetListeners() []*ListenerInfo { + return p.Listeners +} +func (p *ListListenerResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ListenerInfo, 0, size) + p.Listeners = tSlice + for i := 0; i < size; i++ { + _elem68 := NewListenerInfo() + if err := _elem68.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + } + p.Listeners = append(p.Listeners, _elem68) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListListenerResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerResp"); 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("listeners", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:listeners: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Listeners { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:listeners: ", p), err) + } + return err +} + +func (p *ListListenerResp) 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) + } + listenersVal := fmt.Sprintf("%v", p.Listeners) + return fmt.Sprintf("ListListenerResp({Code:%s Leader:%s Listeners:%s})", codeVal, leaderVal, listenersVal) +} + +// Attributes: +// - SpaceID +type GetStatisReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetStatisReq() *GetStatisReq { + return &GetStatisReq{} +} + +func (p *GetStatisReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetStatisReq) 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 *GetStatisReq) 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 *GetStatisReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisReq"); 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 *GetStatisReq) 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 *GetStatisReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetStatisReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Statis +type GetStatisResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statis *StatisItem `thrift:"statis,3" db:"statis" json:"statis"` +} + +func NewGetStatisResp() *GetStatisResp { + return &GetStatisResp{ + Leader: nebula0.NewHostAddr(), + Statis: NewStatisItem(), + } +} + +func (p *GetStatisResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetStatisResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetStatisResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetStatisResp_Leader_DEFAULT + } + return p.Leader +} + +var GetStatisResp_Statis_DEFAULT *StatisItem + +func (p *GetStatisResp) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return GetStatisResp_Statis_DEFAULT + } + return p.Statis +} +func (p *GetStatisResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetStatisResp) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) ReadField3(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *GetStatisResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatisResp"); 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 *GetStatisResp) 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 *GetStatisResp) 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 *GetStatisResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statis: ", p), err) + } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statis: ", p), err) + } + return err +} + +func (p *GetStatisResp) 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) + } + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("GetStatisResp({Code:%s Leader:%s Statis:%s})", codeVal, leaderVal, statisVal) +} + +// Attributes: +// - Host +// - Info +type BackupInfo struct { + Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewBackupInfo() *BackupInfo { + return &BackupInfo{ + Host: nebula0.NewHostAddr(), + } +} + +var BackupInfo_Host_DEFAULT *nebula0.HostAddr + +func (p *BackupInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return BackupInfo_Host_DEFAULT + } + return p.Host +} + +func (p *BackupInfo) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *BackupInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *BackupInfo) 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 *BackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *BackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i++ { + _elem69 := nebula0.NewCheckpointInfo() + if err := _elem69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) + } + p.Info = append(p.Info, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BackupInfo"); 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 *BackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) + } + return err +} + +func (p *BackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) + } + return err +} + +func (p *BackupInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("BackupInfo({Host:%s Info:%s})", hostVal, infoVal) +} + +// Attributes: +// - Space +// - Info +type SpaceBackupInfo struct { + Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` + Info []*BackupInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewSpaceBackupInfo() *SpaceBackupInfo { + return &SpaceBackupInfo{ + Space: NewSpaceDesc(), + } +} + +var SpaceBackupInfo_Space_DEFAULT *SpaceDesc + +func (p *SpaceBackupInfo) GetSpace() *SpaceDesc { + if !p.IsSetSpace() { + return SpaceBackupInfo_Space_DEFAULT + } + return p.Space +} + +func (p *SpaceBackupInfo) GetInfo() []*BackupInfo { + return p.Info +} +func (p *SpaceBackupInfo) IsSetSpace() bool { + return p != nil && p.Space != nil +} + +func (p *SpaceBackupInfo) 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 *SpaceBackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Space = NewSpaceDesc() + if err := p.Space.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Space), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BackupInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i++ { + _elem70 := NewBackupInfo() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) + } + p.Info = append(p.Info, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceBackupInfo"); 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 *SpaceBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) + } + if err := p.Space.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Space), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) + } + return err +} + +func (p *SpaceBackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) + } + return err +} + +func (p *SpaceBackupInfo) String() string { + if p == nil { + return "" + } + + var spaceVal string + if p.Space == nil { + spaceVal = "" + } else { + spaceVal = fmt.Sprintf("%v", p.Space) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("SpaceBackupInfo({Space:%s Info:%s})", spaceVal, infoVal) +} + +// Attributes: +// - BackupInfo +// - MetaFiles +// - BackupName +// - Full +// - IncludeSystemSpace +// - CreateTime +type BackupMeta struct { + BackupInfo map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"backup_info,1" db:"backup_info" json:"backup_info"` + MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` + BackupName []byte `thrift:"backup_name,3" db:"backup_name" json:"backup_name"` + Full bool `thrift:"full,4" db:"full" json:"full"` + IncludeSystemSpace bool `thrift:"include_system_space,5" db:"include_system_space" json:"include_system_space"` + CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` +} + +func NewBackupMeta() *BackupMeta { + return &BackupMeta{} +} + +func (p *BackupMeta) GetBackupInfo() map[nebula0.GraphSpaceID]*SpaceBackupInfo { + return p.BackupInfo +} + +func (p *BackupMeta) GetMetaFiles() [][]byte { + return p.MetaFiles +} + +func (p *BackupMeta) GetBackupName() []byte { + return p.BackupName +} + +func (p *BackupMeta) GetFull() bool { + return p.Full +} + +func (p *BackupMeta) GetIncludeSystemSpace() bool { + return p.IncludeSystemSpace +} + +func (p *BackupMeta) GetCreateTime() int64 { + return p.CreateTime +} +func (p *BackupMeta) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BackupMeta) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) + p.BackupInfo = tMap + for i := 0; i < size; i++ { + var _key71 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.GraphSpaceID(v) + _key71 = temp + } + _val72 := NewSpaceBackupInfo() + if err := _val72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val72), err) + } + p.BackupInfo[_key71] = _val72 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BackupMeta) 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.MetaFiles = tSlice + for i := 0; i < size; i++ { + var _elem73 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem73 = v + } + p.MetaFiles = append(p.MetaFiles, _elem73) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BackupName = v + } + return nil +} + +func (p *BackupMeta) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Full = v + } + return nil +} + +func (p *BackupMeta) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.IncludeSystemSpace = v + } + return nil +} + +func (p *BackupMeta) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.CreateTime = v + } + 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) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := p.writeField5(oprot); err != nil { + return err + } + if err := p.writeField6(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *BackupMeta) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_info: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.BackupInfo)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.BackupInfo { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_info: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_files", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:meta_files: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.MetaFiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaFiles { + 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:meta_files: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_name: ", p), err) + } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_name: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("full", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:full: ", p), err) + } + if err := oprot.WriteBool(bool(p.Full)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:full: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("include_system_space", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:include_system_space: ", p), err) + } + if err := oprot.WriteBool(bool(p.IncludeSystemSpace)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.include_system_space (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:include_system_space: ", p), err) + } + return err +} + +func (p *BackupMeta) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:create_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:create_time: ", p), err) + } + return err +} + +func (p *BackupMeta) String() string { + if p == nil { + return "" + } + + backupInfoVal := fmt.Sprintf("%v", p.BackupInfo) + metaFilesVal := fmt.Sprintf("%v", p.MetaFiles) + backupNameVal := fmt.Sprintf("%v", p.BackupName) + fullVal := fmt.Sprintf("%v", p.Full) + includeSystemSpaceVal := fmt.Sprintf("%v", p.IncludeSystemSpace) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + return fmt.Sprintf("BackupMeta({BackupInfo:%s MetaFiles:%s BackupName:%s Full:%s IncludeSystemSpace:%s CreateTime:%s})", backupInfoVal, metaFilesVal, backupNameVal, fullVal, includeSystemSpaceVal, createTimeVal) +} + +// Attributes: +// - Spaces +type CreateBackupReq struct { + Spaces [][]byte `thrift:"spaces,1" db:"spaces" json:"spaces,omitempty"` +} + +func NewCreateBackupReq() *CreateBackupReq { + return &CreateBackupReq{} +} + +var CreateBackupReq_Spaces_DEFAULT [][]byte + +func (p *CreateBackupReq) GetSpaces() [][]byte { + return p.Spaces +} +func (p *CreateBackupReq) IsSetSpaces() bool { + return p != nil && p.Spaces != nil +} + +func (p *CreateBackupReq) 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 *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i++ { + var _elem74 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem74 = v + } + p.Spaces = append(p.Spaces, _elem74) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CreateBackupReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaces() { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spaces: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + 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:spaces: ", 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) +} + +// Attributes: +// - Code +// - Leader +// - Meta +type CreateBackupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Meta *BackupMeta `thrift:"meta,3" db:"meta" json:"meta"` +} + +func NewCreateBackupResp() *CreateBackupResp { + return &CreateBackupResp{ + Leader: nebula0.NewHostAddr(), + Meta: NewBackupMeta(), + } +} + +func (p *CreateBackupResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var CreateBackupResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *CreateBackupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateBackupResp_Leader_DEFAULT + } + return p.Leader +} + +var CreateBackupResp_Meta_DEFAULT *BackupMeta + +func (p *CreateBackupResp) GetMeta() *BackupMeta { + if !p.IsSetMeta() { + return CreateBackupResp_Meta_DEFAULT + } + return p.Meta +} +func (p *CreateBackupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateBackupResp) IsSetMeta() bool { + return p != nil && p.Meta != nil +} + +func (p *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) ReadField3(iprot thrift.Protocol) error { + p.Meta = NewBackupMeta() + if err := p.Meta.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Meta), err) + } + return nil +} + +func (p *CreateBackupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateBackupResp"); 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta: ", p), err) + } + if err := p.Meta.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Meta), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta: ", p), err) + } + return err +} + +func (p *CreateBackupResp) 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) + } + var metaVal string + if p.Meta == nil { + metaVal = "" + } else { + metaVal = fmt.Sprintf("%v", p.Meta) + } + return fmt.Sprintf("CreateBackupResp({Code:%s Leader:%s Meta:%s})", codeVal, leaderVal, metaVal) +} + +// Attributes: +// - FromHost +// - ToHost +type HostPair struct { + FromHost *nebula0.HostAddr `thrift:"from_host,1" db:"from_host" json:"from_host"` + ToHost *nebula0.HostAddr `thrift:"to_host,2" db:"to_host" json:"to_host"` +} + +func NewHostPair() *HostPair { + return &HostPair{ + FromHost: nebula0.NewHostAddr(), + ToHost: nebula0.NewHostAddr(), + } +} + +var HostPair_FromHost_DEFAULT *nebula0.HostAddr + +func (p *HostPair) GetFromHost() *nebula0.HostAddr { + if !p.IsSetFromHost() { + return HostPair_FromHost_DEFAULT + } + return p.FromHost +} + +var HostPair_ToHost_DEFAULT *nebula0.HostAddr + +func (p *HostPair) GetToHost() *nebula0.HostAddr { + if !p.IsSetToHost() { + return HostPair_ToHost_DEFAULT + } + return p.ToHost +} +func (p *HostPair) IsSetFromHost() bool { + return p != nil && p.FromHost != nil +} + +func (p *HostPair) IsSetToHost() bool { + return p != nil && p.ToHost != nil +} + +func (p *HostPair) 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 *HostPair) ReadField1(iprot thrift.Protocol) error { + p.FromHost = nebula0.NewHostAddr() + if err := p.FromHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.FromHost), err) + } + return nil +} + +func (p *HostPair) ReadField2(iprot thrift.Protocol) error { + p.ToHost = nebula0.NewHostAddr() + if err := p.ToHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ToHost), err) + } + return nil +} + +func (p *HostPair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostPair"); 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 *HostPair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("from_host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:from_host: ", p), err) + } + if err := p.FromHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.FromHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:from_host: ", p), err) + } + return err +} + +func (p *HostPair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("to_host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:to_host: ", p), err) + } + if err := p.ToHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ToHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:to_host: ", p), err) + } + return err +} + +func (p *HostPair) String() string { + if p == nil { + return "" + } + + var fromHostVal string + if p.FromHost == nil { + fromHostVal = "" + } else { + fromHostVal = fmt.Sprintf("%v", p.FromHost) + } + var toHostVal string + if p.ToHost == nil { + toHostVal = "" + } else { + toHostVal = fmt.Sprintf("%v", p.ToHost) + } + return fmt.Sprintf("HostPair({FromHost:%s ToHost:%s})", fromHostVal, toHostVal) +} + +// Attributes: +// - Files +// - Hosts +type RestoreMetaReq struct { + Files [][]byte `thrift:"files,1" db:"files" json:"files"` + Hosts []*HostPair `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewRestoreMetaReq() *RestoreMetaReq { + return &RestoreMetaReq{} +} + +func (p *RestoreMetaReq) GetFiles() [][]byte { + return p.Files +} + +func (p *RestoreMetaReq) GetHosts() []*HostPair { + return p.Hosts +} +func (p *RestoreMetaReq) 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 *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Files = tSlice + for i := 0; i < size; i++ { + var _elem75 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem75 = v + } + p.Files = append(p.Files, _elem75) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostPair, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i++ { + _elem76 := NewHostPair() + if err := _elem76.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem76), err) + } + p.Hosts = append(p.Hosts, _elem76) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RestoreMetaReq"); 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 *RestoreMetaReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + 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:files: ", p), err) + } + return err +} + +func (p *RestoreMetaReq) 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 *RestoreMetaReq) String() string { + if p == nil { + return "" + } + + filesVal := fmt.Sprintf("%v", p.Files) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("RestoreMetaReq({Files:%s Hosts:%s})", filesVal, hostsVal) +} + +// Attributes: +// - Host +// - User +// - Pwd +type FTClient struct { + Host *nebula0.HostAddr `thrift:"host,1,required" db:"host" json:"host"` + User []byte `thrift:"user,2" db:"user" json:"user,omitempty"` + Pwd []byte `thrift:"pwd,3" db:"pwd" json:"pwd,omitempty"` +} + +func NewFTClient() *FTClient { + return &FTClient{ + Host: nebula0.NewHostAddr(), + } +} + +var FTClient_Host_DEFAULT *nebula0.HostAddr + +func (p *FTClient) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return FTClient_Host_DEFAULT + } + return p.Host +} + +var FTClient_User_DEFAULT []byte + +func (p *FTClient) GetUser() []byte { + return p.User +} + +var FTClient_Pwd_DEFAULT []byte + +func (p *FTClient) GetPwd() []byte { + return p.Pwd +} +func (p *FTClient) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *FTClient) IsSetUser() bool { + return p != nil && p.User != nil +} + +func (p *FTClient) IsSetPwd() bool { + return p != nil && p.Pwd != nil +} + +func (p *FTClient) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHost 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 + } + issetHost = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHost { + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")) + } + return nil +} + +func (p *FTClient) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *FTClient) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.User = v + } + return nil +} + +func (p *FTClient) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Pwd = v + } + return nil +} + +func (p *FTClient) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTClient"); 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 *FTClient) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) + } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) + } + return err +} + +func (p *FTClient) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetUser() { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err) + } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err) + } + } + return err +} + +func (p *FTClient) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetPwd() { + if err := oprot.WriteFieldBegin("pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pwd: ", p), err) + } + if err := oprot.WriteBinary(p.Pwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pwd (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pwd: ", p), err) + } + } + return err +} + +func (p *FTClient) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + userVal := fmt.Sprintf("%v", p.User) + pwdVal := fmt.Sprintf("%v", p.Pwd) + return fmt.Sprintf("FTClient({Host:%s User:%s Pwd:%s})", hostVal, userVal, pwdVal) +} + +// Attributes: +// - Type +// - Clients +type SignInFTServiceReq struct { + Type FTServiceType `thrift:"type,1" db:"type" json:"type"` + Clients []*FTClient `thrift:"clients,2" db:"clients" json:"clients"` +} + +func NewSignInFTServiceReq() *SignInFTServiceReq { + return &SignInFTServiceReq{} +} + +func (p *SignInFTServiceReq) GetType() FTServiceType { + return p.Type +} + +func (p *SignInFTServiceReq) GetClients() []*FTClient { + return p.Clients +} +func (p *SignInFTServiceReq) 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 *SignInFTServiceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := FTServiceType(v) + p.Type = temp + } + return nil +} + +func (p *SignInFTServiceReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i++ { + _elem77 := NewFTClient() + if err := _elem77.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem77), err) + } + p.Clients = append(p.Clients, _elem77) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SignInFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignInFTServiceReq"); 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 *SignInFTServiceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err +} + +func (p *SignInFTServiceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:clients: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + 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:clients: ", p), err) + } + return err +} + +func (p *SignInFTServiceReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("SignInFTServiceReq({Type:%s Clients:%s})", typeVal, clientsVal) +} + +type SignOutFTServiceReq struct { +} + +func NewSignOutFTServiceReq() *SignOutFTServiceReq { + return &SignOutFTServiceReq{} +} + +func (p *SignOutFTServiceReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignOutFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignOutFTServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *SignOutFTServiceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("SignOutFTServiceReq({})") +} + +type ListFTClientsReq struct { +} + +func NewListFTClientsReq() *ListFTClientsReq { + return &ListFTClientsReq{} +} + +func (p *ListFTClientsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTClientsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListFTClientsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTClientsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Clients +type ListFTClientsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Clients []*FTClient `thrift:"clients,3" db:"clients" json:"clients"` +} + +func NewListFTClientsResp() *ListFTClientsResp { + return &ListFTClientsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListFTClientsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListFTClientsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListFTClientsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTClientsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListFTClientsResp) GetClients() []*FTClient { + return p.Clients +} +func (p *ListFTClientsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i++ { + _elem78 := NewFTClient() + if err := _elem78.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + } + p.Clients = append(p.Clients, _elem78) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListFTClientsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsResp"); 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:clients: ", p), err) + } + return err +} + +func (p *ListFTClientsResp) 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) + } + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("ListFTClientsResp({Code:%s Leader:%s Clients:%s})", codeVal, leaderVal, clientsVal) +} + +// Attributes: +// - SpaceID +// - DependSchema +// - Fields +type FTIndex struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + DependSchema *SchemaID `thrift:"depend_schema,2" db:"depend_schema" json:"depend_schema"` + Fields [][]byte `thrift:"fields,3" db:"fields" json:"fields"` +} + +func NewFTIndex() *FTIndex { + return &FTIndex{} +} + +func (p *FTIndex) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +var FTIndex_DependSchema_DEFAULT *SchemaID + +func (p *FTIndex) GetDependSchema() *SchemaID { + if !p.IsSetDependSchema() { + return FTIndex_DependSchema_DEFAULT + } + return p.DependSchema +} + +func (p *FTIndex) GetFields() [][]byte { + return p.Fields +} +func (p *FTIndex) IsSetDependSchema() bool { + return p != nil && p.DependSchema != nil +} + +func (p *FTIndex) 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 *FTIndex) 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 *FTIndex) ReadField2(iprot thrift.Protocol) error { + p.DependSchema = NewSchemaID() + if err := p.DependSchema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DependSchema), err) + } + return nil +} + +func (p *FTIndex) ReadField3(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.Fields = tSlice + for i := 0; i < size; i++ { + var _elem79 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem79 = v + } + p.Fields = append(p.Fields, _elem79) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *FTIndex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTIndex"); 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 *FTIndex) 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 *FTIndex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("depend_schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:depend_schema: ", p), err) + } + if err := p.DependSchema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DependSchema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:depend_schema: ", p), err) + } + return err +} + +func (p *FTIndex) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fields: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fields: ", p), err) + } + return err +} + +func (p *FTIndex) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var dependSchemaVal string + if p.DependSchema == nil { + dependSchemaVal = "" + } else { + dependSchemaVal = fmt.Sprintf("%v", p.DependSchema) + } + fieldsVal := fmt.Sprintf("%v", p.Fields) + return fmt.Sprintf("FTIndex({SpaceID:%s DependSchema:%s Fields:%s})", spaceIDVal, dependSchemaVal, fieldsVal) +} + +// Attributes: +// - FulltextIndexName +// - Index +type CreateFTIndexReq struct { + FulltextIndexName []byte `thrift:"fulltext_index_name,1" db:"fulltext_index_name" json:"fulltext_index_name"` + Index *FTIndex `thrift:"index,2" db:"index" json:"index"` +} + +func NewCreateFTIndexReq() *CreateFTIndexReq { + return &CreateFTIndexReq{ + Index: NewFTIndex(), + } +} + +func (p *CreateFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} + +var CreateFTIndexReq_Index_DEFAULT *FTIndex + +func (p *CreateFTIndexReq) GetIndex() *FTIndex { + if !p.IsSetIndex() { + return CreateFTIndexReq_Index_DEFAULT + } + return p.Index +} +func (p *CreateFTIndexReq) IsSetIndex() bool { + return p != nil && p.Index != nil +} + +func (p *CreateFTIndexReq) 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 *CreateFTIndexReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.FulltextIndexName = v + } + return nil +} + +func (p *CreateFTIndexReq) ReadField2(iprot thrift.Protocol) error { + p.Index = NewFTIndex() + if err := p.Index.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Index), err) + } + return nil +} + +func (p *CreateFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateFTIndexReq"); 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 *CreateFTIndexReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fulltext_index_name: ", p), err) + } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fulltext_index_name: ", p), err) + } + return err +} + +func (p *CreateFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index: ", p), err) + } + if err := p.Index.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Index), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index: ", p), err) + } + return err +} + +func (p *CreateFTIndexReq) String() string { + if p == nil { + return "" + } + + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + var indexVal string + if p.Index == nil { + indexVal = "" + } else { + indexVal = fmt.Sprintf("%v", p.Index) + } + return fmt.Sprintf("CreateFTIndexReq({FulltextIndexName:%s Index:%s})", fulltextIndexNameVal, indexVal) +} + +// Attributes: +// - SpaceID +// - FulltextIndexName +type DropFTIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + FulltextIndexName []byte `thrift:"fulltext_index_name,2" db:"fulltext_index_name" json:"fulltext_index_name"` +} + +func NewDropFTIndexReq() *DropFTIndexReq { + return &DropFTIndexReq{} +} + +func (p *DropFTIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} +func (p *DropFTIndexReq) 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 *DropFTIndexReq) 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 *DropFTIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.FulltextIndexName = v + } + return nil +} + +func (p *DropFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropFTIndexReq"); 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 *DropFTIndexReq) 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 *DropFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fulltext_index_name: ", p), err) + } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fulltext_index_name: ", p), err) + } + return err +} + +func (p *DropFTIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + return fmt.Sprintf("DropFTIndexReq({SpaceID:%s FulltextIndexName:%s})", spaceIDVal, fulltextIndexNameVal) +} + +type ListFTIndexesReq struct { +} + +func NewListFTIndexesReq() *ListFTIndexesReq { + return &ListFTIndexesReq{} +} + +func (p *ListFTIndexesReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListFTIndexesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTIndexesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Indexes +type ListFTIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Indexes map[string]*FTIndex `thrift:"indexes,3" db:"indexes" json:"indexes"` +} + +func NewListFTIndexesResp() *ListFTIndexesResp { + return &ListFTIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListFTIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListFTIndexesResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListFTIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTIndexesResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListFTIndexesResp) GetIndexes() map[string]*FTIndex { + return p.Indexes +} +func (p *ListFTIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*FTIndex, size) + p.Indexes = tMap + for i := 0; i < size; i++ { + var _key80 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key80 = v + } + _val81 := NewFTIndex() + if err := _val81.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val81), err) + } + p.Indexes[_key80] = _val81 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListFTIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesResp"); 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indexes", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indexes: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Indexes)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Indexes { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indexes: ", p), err) + } + return err +} + +func (p *ListFTIndexesResp) 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) + } + indexesVal := fmt.Sprintf("%v", p.Indexes) + return fmt.Sprintf("ListFTIndexesResp({Code:%s Leader:%s Indexes:%s})", codeVal, leaderVal, indexesVal) +} + +// Attributes: +// - StartTime +// - Status +// - Duration +// - Query +// - GraphAddr +type QueryDesc struct { + StartTime nebula0.Timestamp `thrift:"start_time,1" db:"start_time" json:"start_time"` + Status QueryStatus `thrift:"status,2" db:"status" json:"status"` + Duration int64 `thrift:"duration,3" db:"duration" json:"duration"` + Query []byte `thrift:"query,4" db:"query" json:"query"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,5" db:"graph_addr" json:"graph_addr"` +} + +func NewQueryDesc() *QueryDesc { + return &QueryDesc{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *QueryDesc) GetStartTime() nebula0.Timestamp { + return p.StartTime +} + +func (p *QueryDesc) GetStatus() QueryStatus { + return p.Status +} + +func (p *QueryDesc) GetDuration() int64 { + return p.Duration +} + +func (p *QueryDesc) GetQuery() []byte { + return p.Query +} + +var QueryDesc_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *QueryDesc) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return QueryDesc_GraphAddr_DEFAULT + } + return p.GraphAddr +} +func (p *QueryDesc) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *QueryDesc) 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 + } + 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 *QueryDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.Timestamp(v) + p.StartTime = temp + } + return nil +} + +func (p *QueryDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := QueryStatus(v) + p.Status = temp + } + return nil +} + +func (p *QueryDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Duration = v + } + return nil +} + +func (p *QueryDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Query = v + } + return nil +} + +func (p *QueryDesc) ReadField5(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *QueryDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("QueryDesc"); 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 *QueryDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:start_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_time: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("duration", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err) + } + if err := oprot.WriteI64(int64(p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:query: ", p), err) + } + if err := oprot.WriteBinary(p.Query); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.query (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:query: ", p), err) + } + return err +} + +func (p *QueryDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:graph_addr: ", p), err) + } + return err +} + +func (p *QueryDesc) String() string { + if p == nil { + return "" + } + + startTimeVal := fmt.Sprintf("%v", p.StartTime) + statusVal := fmt.Sprintf("%v", p.Status) + durationVal := fmt.Sprintf("%v", p.Duration) + queryVal := fmt.Sprintf("%v", p.Query) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + return fmt.Sprintf("QueryDesc({StartTime:%s Status:%s Duration:%s Query:%s GraphAddr:%s})", startTimeVal, statusVal, durationVal, queryVal, graphAddrVal) +} + +// Attributes: +// - SessionID +// - CreateTime +// - UpdateTime +// - UserName +// - SpaceName +// - GraphAddr +// - Timezone +// - ClientIP +// - Configs +// - Queries +type Session struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` + CreateTime nebula0.Timestamp `thrift:"create_time,2" db:"create_time" json:"create_time"` + UpdateTime nebula0.Timestamp `thrift:"update_time,3" db:"update_time" json:"update_time"` + UserName []byte `thrift:"user_name,4" db:"user_name" json:"user_name"` + SpaceName []byte `thrift:"space_name,5" db:"space_name" json:"space_name"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,6" db:"graph_addr" json:"graph_addr"` + Timezone int32 `thrift:"timezone,7" db:"timezone" json:"timezone"` + ClientIP []byte `thrift:"client_ip,8" db:"client_ip" json:"client_ip"` + Configs map[string]*nebula0.Value `thrift:"configs,9" db:"configs" json:"configs"` + Queries map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"queries,10" db:"queries" json:"queries"` +} + +func NewSession() *Session { + return &Session{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *Session) GetSessionID() nebula0.SessionID { + return p.SessionID +} + +func (p *Session) GetCreateTime() nebula0.Timestamp { + return p.CreateTime +} + +func (p *Session) GetUpdateTime() nebula0.Timestamp { + return p.UpdateTime +} + +func (p *Session) GetUserName() []byte { + return p.UserName +} + +func (p *Session) GetSpaceName() []byte { + return p.SpaceName +} + +var Session_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *Session) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return Session_GraphAddr_DEFAULT + } + return p.GraphAddr +} + +func (p *Session) GetTimezone() int32 { + return p.Timezone +} + +func (p *Session) GetClientIP() []byte { + return p.ClientIP +} + +func (p *Session) GetConfigs() map[string]*nebula0.Value { + return p.Configs +} + +func (p *Session) GetQueries() map[nebula0.ExecutionPlanID]*QueryDesc { + return p.Queries +} +func (p *Session) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *Session) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *Session) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *Session) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := nebula0.Timestamp(v) + p.CreateTime = temp + } + return nil +} + +func (p *Session) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := nebula0.Timestamp(v) + p.UpdateTime = temp + } + return nil +} + +func (p *Session) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.UserName = v + } + return nil +} + +func (p *Session) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.SpaceName = v + } + return nil +} + +func (p *Session) ReadField6(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *Session) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.Timezone = v + } + return nil +} + +func (p *Session) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.ClientIP = v + } + return nil +} + +func (p *Session) ReadField9(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula0.Value, size) + p.Configs = tMap + for i := 0; i < size; i++ { + var _key82 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key82 = v + } + _val83 := nebula0.NewValue() + if err := _val83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val83), err) + } + p.Configs[_key82] = _val83 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) ReadField10(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.Queries = tMap + for i := 0; i < size; i++ { + var _key84 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _key84 = temp + } + _val85 := NewQueryDesc() + if err := _val85.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val85), err) + } + p.Queries[_key84] = _val85 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Session"); 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 := p.writeField6(oprot); err != nil { + return err + } + if err := p.writeField7(oprot); err != nil { + return err + } + if err := p.writeField8(oprot); err != nil { + return err + } + if err := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *Session) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *Session) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:create_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:create_time: ", p), err) + } + return err +} + +func (p *Session) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("update_time", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:update_time: ", p), err) + } + if err := oprot.WriteI64(int64(p.UpdateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_time (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update_time: ", p), err) + } + return err +} + +func (p *Session) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) + } + if err := oprot.WriteBinary(p.UserName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) + } + return err +} + +func (p *Session) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:space_name: ", p), err) + } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:space_name: ", p), err) + } + return err +} + +func (p *Session) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:graph_addr: ", p), err) + } + return err +} + +func (p *Session) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("timezone", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timezone: ", p), err) + } + if err := oprot.WriteI32(int32(p.Timezone)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timezone (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timezone: ", p), err) + } + return err +} + +func (p *Session) writeField8(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:client_ip: ", p), err) + } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:client_ip: ", p), err) + } + return err +} + +func (p *Session) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("configs", thrift.MAP, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:configs: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Configs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:configs: ", p), err) + } + return err +} + +func (p *Session) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("queries", thrift.MAP, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.Queries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Queries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:queries: ", p), err) + } + return err +} + +func (p *Session) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + updateTimeVal := fmt.Sprintf("%v", p.UpdateTime) + userNameVal := fmt.Sprintf("%v", p.UserName) + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + timezoneVal := fmt.Sprintf("%v", p.Timezone) + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + configsVal := fmt.Sprintf("%v", p.Configs) + queriesVal := fmt.Sprintf("%v", p.Queries) + return fmt.Sprintf("Session({SessionID:%s CreateTime:%s UpdateTime:%s UserName:%s SpaceName:%s GraphAddr:%s Timezone:%s ClientIP:%s Configs:%s Queries:%s})", sessionIDVal, createTimeVal, updateTimeVal, userNameVal, spaceNameVal, graphAddrVal, timezoneVal, clientIPVal, configsVal, queriesVal) +} + +// Attributes: +// - User +// - GraphAddr +// - ClientIP +type CreateSessionReq struct { + User []byte `thrift:"user,1" db:"user" json:"user"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,2" db:"graph_addr" json:"graph_addr"` + ClientIP []byte `thrift:"client_ip,3" db:"client_ip" json:"client_ip"` +} + +func NewCreateSessionReq() *CreateSessionReq { + return &CreateSessionReq{ + GraphAddr: nebula0.NewHostAddr(), + } +} + +func (p *CreateSessionReq) GetUser() []byte { + return p.User +} + +var CreateSessionReq_GraphAddr_DEFAULT *nebula0.HostAddr + +func (p *CreateSessionReq) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return CreateSessionReq_GraphAddr_DEFAULT + } + return p.GraphAddr +} + +func (p *CreateSessionReq) GetClientIP() []byte { + return p.ClientIP +} +func (p *CreateSessionReq) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *CreateSessionReq) 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 *CreateSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.User = v + } + return nil +} + +func (p *CreateSessionReq) ReadField2(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ClientIP = v + } + return nil +} + +func (p *CreateSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionReq"); 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 *CreateSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user: ", p), err) + } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user: ", p), err) + } + return err +} + +func (p *CreateSessionReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:graph_addr: ", p), err) + } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:graph_addr: ", p), err) + } + return err +} + +func (p *CreateSessionReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_ip: ", p), err) + } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_ip: ", p), err) + } + return err +} + +func (p *CreateSessionReq) String() string { + if p == nil { + return "" + } + + userVal := fmt.Sprintf("%v", p.User) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + return fmt.Sprintf("CreateSessionReq({User:%s GraphAddr:%s ClientIP:%s})", userVal, graphAddrVal, clientIPVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type CreateSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewCreateSessionResp() *CreateSessionResp { + return &CreateSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + +func (p *CreateSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var CreateSessionResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *CreateSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateSessionResp_Leader_DEFAULT + } + return p.Leader +} + +var CreateSessionResp_Session_DEFAULT *Session + +func (p *CreateSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return CreateSessionResp_Session_DEFAULT + } + return p.Session +} +func (p *CreateSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *CreateSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionResp"); 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) + } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) + } + return err +} + +func (p *CreateSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("CreateSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - Sessions +type UpdateSessionsReq struct { + Sessions []*Session `thrift:"sessions,1" db:"sessions" json:"sessions"` +} + +func NewUpdateSessionsReq() *UpdateSessionsReq { + return &UpdateSessionsReq{} +} + +func (p *UpdateSessionsReq) GetSessions() []*Session { + return p.Sessions +} +func (p *UpdateSessionsReq) 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 *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i++ { + _elem86 := NewSession() + if err := _elem86.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem86), err) + } + p.Sessions = append(p.Sessions, _elem86) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsReq"); 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 *UpdateSessionsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessions: ", p), err) + } + return err +} + +func (p *UpdateSessionsReq) String() string { + if p == nil { + return "" + } + + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("UpdateSessionsReq({Sessions:%s})", sessionsVal) +} + +// Attributes: +// - Code +// - Leader +// - KilledQueries +type UpdateSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + KilledQueries map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"killed_queries,3" db:"killed_queries" json:"killed_queries"` +} + +func NewUpdateSessionsResp() *UpdateSessionsResp { + return &UpdateSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *UpdateSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var UpdateSessionsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *UpdateSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return UpdateSessionsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *UpdateSessionsResp) GetKilledQueries() map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc { + return p.KilledQueries +} +func (p *UpdateSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.KilledQueries = tMap + for i := 0; i < size; i++ { + var _key87 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.SessionID(v) + _key87 = temp + } + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + _val88 := tMap + for i := 0; i < size; i++ { + var _key89 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _key89 = temp + } + _val90 := NewQueryDesc() + if err := _val90.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val90), err) + } + _val88[_key89] = _val90 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.KilledQueries[_key87] = _val88 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *UpdateSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsResp"); 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("killed_queries", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:killed_queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.MAP, len(p.KilledQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KilledQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:killed_queries: ", p), err) + } + return err +} + +func (p *UpdateSessionsResp) 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) + } + killedQueriesVal := fmt.Sprintf("%v", p.KilledQueries) + return fmt.Sprintf("UpdateSessionsResp({Code:%s Leader:%s KilledQueries:%s})", codeVal, leaderVal, killedQueriesVal) +} + +type ListSessionsReq struct { +} + +func NewListSessionsReq() *ListSessionsReq { + return &ListSessionsReq{} +} + +func (p *ListSessionsReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListSessionsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSessionsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Sessions +type ListSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Sessions []*Session `thrift:"sessions,3" db:"sessions" json:"sessions"` +} + +func NewListSessionsResp() *ListSessionsResp { + return &ListSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListSessionsResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSessionsResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListSessionsResp) GetSessions() []*Session { + return p.Sessions +} +func (p *ListSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i++ { + _elem91 := NewSession() + if err := _elem91.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) + } + p.Sessions = append(p.Sessions, _elem91) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsResp"); 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessions: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessions: ", p), err) + } + return err +} + +func (p *ListSessionsResp) 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) + } + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("ListSessionsResp({Code:%s Leader:%s Sessions:%s})", codeVal, leaderVal, sessionsVal) +} + +// Attributes: +// - SessionID +type GetSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewGetSessionReq() *GetSessionReq { + return &GetSessionReq{} +} + +func (p *GetSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *GetSessionReq) 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 *GetSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *GetSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionReq"); 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 *GetSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *GetSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("GetSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type GetSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewGetSessionResp() *GetSessionResp { + return &GetSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + +func (p *GetSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetSessionResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *GetSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSessionResp_Leader_DEFAULT + } + return p.Leader +} + +var GetSessionResp_Session_DEFAULT *Session + +func (p *GetSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return GetSessionResp_Session_DEFAULT + } + return p.Session +} +func (p *GetSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *GetSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionResp"); 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) + } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) + } + return err +} + +func (p *GetSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("GetSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - SessionID +type RemoveSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewRemoveSessionReq() *RemoveSessionReq { + return &RemoveSessionReq{} +} + +func (p *RemoveSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *RemoveSessionReq) 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 *RemoveSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := nebula0.SessionID(v) + p.SessionID = temp + } + return nil +} + +func (p *RemoveSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveSessionReq"); 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 *RemoveSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) + } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) + } + return err +} + +func (p *RemoveSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("RemoveSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - KillQueries +type KillQueryReq struct { + KillQueries map[nebula0.SessionID][]nebula0.ExecutionPlanID `thrift:"kill_queries,1" db:"kill_queries" json:"kill_queries"` +} + +func NewKillQueryReq() *KillQueryReq { + return &KillQueryReq{} +} + +func (p *KillQueryReq) GetKillQueries() map[nebula0.SessionID][]nebula0.ExecutionPlanID { + return p.KillQueries +} +func (p *KillQueryReq) 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 *KillQueryReq) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID][]nebula0.ExecutionPlanID, size) + p.KillQueries = tMap + for i := 0; i < size; i++ { + var _key92 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.SessionID(v) + _key92 = temp + } + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]nebula0.ExecutionPlanID, 0, size) + _val93 := tSet + for i := 0; i < size; i++ { + var _elem94 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := nebula0.ExecutionPlanID(v) + _elem94 = temp + } + _val93 = append(_val93, _elem94) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.KillQueries[_key92] = _val93 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KillQueryReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KillQueryReq"); 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 *KillQueryReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kill_queries", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kill_queries: ", p), err) + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.SET, len(p.KillQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KillQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I64, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[nebula0.ExecutionPlanID]bool, len(v)) + for _, v := range v { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range v { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kill_queries: ", p), err) + } + return err +} + +func (p *KillQueryReq) String() string { + if p == nil { + return "" + } + + killQueriesVal := fmt.Sprintf("%v", p.KillQueries) + return fmt.Sprintf("KillQueryReq({KillQueries:%s})", killQueriesVal) +} + +// Attributes: +// - Code +// - JobID +// - TaskID +// - Statis +type ReportTaskReq struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Statis *StatisItem `thrift:"statis,4" db:"statis" json:"statis,omitempty"` +} + +func NewReportTaskReq() *ReportTaskReq { + return &ReportTaskReq{} +} + +func (p *ReportTaskReq) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *ReportTaskReq) GetJobID() int32 { + return p.JobID +} + +func (p *ReportTaskReq) GetTaskID() int32 { + return p.TaskID +} + +var ReportTaskReq_Statis_DEFAULT *StatisItem + +func (p *ReportTaskReq) GetStatis() *StatisItem { + if !p.IsSetStatis() { + return ReportTaskReq_Statis_DEFAULT + } + return p.Statis +} +func (p *ReportTaskReq) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *ReportTaskReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.JobID = v + } + return nil +} + +func (p *ReportTaskReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TaskID = v + } + return nil +} + +func (p *ReportTaskReq) ReadField4(iprot thrift.Protocol) error { + p.Statis = NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *ReportTaskReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ReportTaskReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) + } + return err +} + +func (p *ReportTaskReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) + } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) + } + return err +} + +func (p *ReportTaskReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:statis: ", p), err) + } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:statis: ", p), err) + } + } + return err +} + +func (p *ReportTaskReq) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("ReportTaskReq({Code:%s JobID:%s TaskID:%s Statis:%s})", codeVal, jobIDVal, taskIDVal, statisVal) +} + +// Attributes: +// - Code +// - Leader +// - MetaServers +// - StorageServers +type ListClusterInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + MetaServers []*nebula0.HostAddr `thrift:"meta_servers,3" db:"meta_servers" json:"meta_servers"` + StorageServers []*nebula0.NodeInfo `thrift:"storage_servers,4" db:"storage_servers" json:"storage_servers"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Leader: nebula0.NewHostAddr(), + } +} + +func (p *ListClusterInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var ListClusterInfoResp_Leader_DEFAULT *nebula0.HostAddr + +func (p *ListClusterInfoResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListClusterInfoResp_Leader_DEFAULT + } + return p.Leader +} + +func (p *ListClusterInfoResp) GetMetaServers() []*nebula0.HostAddr { + return p.MetaServers +} + +func (p *ListClusterInfoResp) GetStorageServers() []*nebula0.NodeInfo { + return p.StorageServers +} +func (p *ListClusterInfoResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListClusterInfoResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField3(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.MetaServers = tSlice + for i := 0; i < size; i++ { + _elem95 := nebula0.NewHostAddr() + if err := _elem95.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) + } + p.MetaServers = append(p.MetaServers, _elem95) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.NodeInfo, 0, size) + p.StorageServers = tSlice + for i := 0; i < size; i++ { + _elem96 := nebula0.NewNodeInfo() + if err := _elem96.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem96), err) + } + p.StorageServers = append(p.StorageServers, _elem96) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_servers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta_servers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MetaServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta_servers: ", p), err) + } + return err +} + +func (p *ListClusterInfoResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("storage_servers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:storage_servers: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorageServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorageServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:storage_servers: ", p), err) + } + return err +} + +func (p *ListClusterInfoResp) 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) + } + metaServersVal := fmt.Sprintf("%v", p.MetaServers) + storageServersVal := fmt.Sprintf("%v", p.StorageServers) + return fmt.Sprintf("ListClusterInfoResp({Code:%s Leader:%s MetaServers:%s StorageServers:%s})", codeVal, leaderVal, metaServersVal, storageServersVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - Code +// - Dir +type GetMetaDirInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewGetMetaDirInfoResp() *GetMetaDirInfoResp { + return &GetMetaDirInfoResp{ + Dir: nebula0.NewDirInfo(), + } +} + +func (p *GetMetaDirInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +var GetMetaDirInfoResp_Dir_DEFAULT *nebula0.DirInfo + +func (p *GetMetaDirInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return GetMetaDirInfoResp_Dir_DEFAULT + } + return p.Dir +} +func (p *GetMetaDirInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *GetMetaDirInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoResp"); 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) + } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) + } + return err +} + +func (p *GetMetaDirInfoResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("GetMetaDirInfoResp({Code:%s Dir:%s})", codeVal, dirVal) +} + +type GetMetaDirInfoReq struct { +} + +func NewGetMetaDirInfoReq() *GetMetaDirInfoReq { + return &GetMetaDirInfoReq{} +} + +func (p *GetMetaDirInfoReq) 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 + } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetMetaDirInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *GetMetaDirInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetMetaDirInfoReq({})") +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/constants.go b/ccore/nebula/internal/thrift/v2_5_1/storage/constants.go new file mode 100644 index 0000000..0faa820 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/constants.go @@ -0,0 +1,30 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/general_storage_service-remote/general_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_5_1/storage/general_storage_service-remote/general_storage_service-remote.go new file mode 100755 index 0000000..057ec9c --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/general_storage_service-remote/general_storage_service-remote.go @@ -0,0 +1,202 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " KVGetResponse get(KVGetRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse put(KVPutRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse remove(KVRemoveRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGeneralStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg258 := flag.Arg(1) + mbTrans259 := thrift.NewMemoryBufferLen(len(arg258)) + defer mbTrans259.Close() + _, err260 := mbTrans259.WriteString(arg258) + if err260 != nil { + Usage() + return + } + factory261 := thrift.NewSimpleJSONProtocolFactory() + jsProt262 := factory261.GetProtocol(mbTrans259) + argvalue0 := storage.NewKVGetRequest() + err263 := argvalue0.Read(jsProt262) + if err263 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "put": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg264 := flag.Arg(1) + mbTrans265 := thrift.NewMemoryBufferLen(len(arg264)) + defer mbTrans265.Close() + _, err266 := mbTrans265.WriteString(arg264) + if err266 != nil { + Usage() + return + } + factory267 := thrift.NewSimpleJSONProtocolFactory() + jsProt268 := factory267.GetProtocol(mbTrans265) + argvalue0 := storage.NewKVPutRequest() + err269 := argvalue0.Read(jsProt268) + if err269 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg270 := flag.Arg(1) + mbTrans271 := thrift.NewMemoryBufferLen(len(arg270)) + defer mbTrans271.Close() + _, err272 := mbTrans271.WriteString(arg270) + if err272 != nil { + Usage() + return + } + factory273 := thrift.NewSimpleJSONProtocolFactory() + jsProt274 := factory273.GetProtocol(mbTrans271) + argvalue0 := storage.NewKVRemoveRequest() + err275 := argvalue0.Read(jsProt274) + if err275 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/generalstorageservice.go b/ccore/nebula/internal/thrift/v2_5_1/storage/generalstorageservice.go new file mode 100644 index 0000000..12d7624 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/generalstorageservice.go @@ -0,0 +1,1086 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GeneralStorageService interface { + // Parameters: + // - Req + Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + Get(req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GeneralStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GeneralStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GeneralStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceClientProtocol(prot thrift.Protocol) *GeneralStorageServiceClient { + return NewGeneralStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceThreadsafeClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GeneralStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GeneralStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GeneralStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return NewGeneralStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GeneralStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GeneralStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GeneralStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGeneralStorageServiceChannelClient(channel thrift.RequestChannel) *GeneralStorageServiceChannelClient { + return &GeneralStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + var result GeneralStorageServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + var result GeneralStorageServicePutResult + err = p.RequestChannel.Call(ctx, "put", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + var result GeneralStorageServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GeneralStorageService +} + +func (p *GeneralStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GeneralStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GeneralStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGeneralStorageServiceProcessor(handler GeneralStorageService) *GeneralStorageServiceProcessor { + self256 := &GeneralStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self256.processorMap["get"] = &generalStorageServiceProcessorGet{handler:handler} + self256.processorMap["put"] = &generalStorageServiceProcessorPut{handler:handler} + self256.processorMap["remove"] = &generalStorageServiceProcessorRemove{handler:handler} + return self256 +} + +type generalStorageServiceProcessorGet struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceGetArgs) + var result GeneralStorageServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorPut struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServicePutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("put", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServicePutArgs) + var result GeneralStorageServicePutResult + if retval, err := p.handler.Put(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorRemove struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceRemoveArgs) + var result GeneralStorageServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GeneralStorageServiceGetArgs struct { + thrift.IRequest + Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceGetArgs() *GeneralStorageServiceGetArgs { + return &GeneralStorageServiceGetArgs{ + Req: NewKVGetRequest(), + } +} + +var GeneralStorageServiceGetArgs_Req_DEFAULT *KVGetRequest +func (p *GeneralStorageServiceGetArgs) GetReq() *KVGetRequest { + if !p.IsSetReq() { + return GeneralStorageServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceGetArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVGetRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceGetResult struct { + thrift.IResponse + Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceGetResult() *GeneralStorageServiceGetResult { + return &GeneralStorageServiceGetResult{} +} + +var GeneralStorageServiceGetResult_Success_DEFAULT *KVGetResponse +func (p *GeneralStorageServiceGetResult) GetSuccess() *KVGetResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceGetResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewKVGetResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServicePutArgs struct { + thrift.IRequest + Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServicePutArgs() *GeneralStorageServicePutArgs { + return &GeneralStorageServicePutArgs{ + Req: NewKVPutRequest(), + } +} + +var GeneralStorageServicePutArgs_Req_DEFAULT *KVPutRequest +func (p *GeneralStorageServicePutArgs) GetReq() *KVPutRequest { + if !p.IsSetReq() { + return GeneralStorageServicePutArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServicePutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServicePutArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVPutRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServicePutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServicePutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServicePutResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServicePutResult() *GeneralStorageServicePutResult { + return &GeneralStorageServicePutResult{} +} + +var GeneralStorageServicePutResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServicePutResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServicePutResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServicePutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServicePutResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServicePutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServicePutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServiceRemoveArgs struct { + thrift.IRequest + Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceRemoveArgs() *GeneralStorageServiceRemoveArgs { + return &GeneralStorageServiceRemoveArgs{ + Req: NewKVRemoveRequest(), + } +} + +var GeneralStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest +func (p *GeneralStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { + if !p.IsSetReq() { + return GeneralStorageServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVRemoveRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceRemoveResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceRemoveResult() *GeneralStorageServiceRemoveResult { + return &GeneralStorageServiceRemoveResult{} +} + +var GeneralStorageServiceRemoveResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServiceRemoveResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceRemoveResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/graph_storage_service-remote/graph_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_5_1/storage/graph_storage_service-remote/graph_storage_service-remote.go new file mode 100755 index 0000000..021e3c9 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -0,0 +1,488 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse getNeighbors(GetNeighborsRequest req)") + fmt.Fprintln(os.Stderr, " GetPropResponse getProps(GetPropRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addVertices(AddVerticesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteEdges(DeleteEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteVertices(DeleteVerticesRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateVertex(UpdateVertexRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ScanVertexResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanEdgeResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") + fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdgesAtomic(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGraphStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "getNeighbors": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") + flag.Usage() + } + arg74 := flag.Arg(1) + mbTrans75 := thrift.NewMemoryBufferLen(len(arg74)) + defer mbTrans75.Close() + _, err76 := mbTrans75.WriteString(arg74) + if err76 != nil { + Usage() + return + } + factory77 := thrift.NewSimpleJSONProtocolFactory() + jsProt78 := factory77.GetProtocol(mbTrans75) + argvalue0 := storage.NewGetNeighborsRequest() + err79 := argvalue0.Read(jsProt78) + if err79 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetNeighbors(value0)) + fmt.Print("\n") + break + case "getProps": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetProps requires 1 args") + flag.Usage() + } + arg80 := flag.Arg(1) + mbTrans81 := thrift.NewMemoryBufferLen(len(arg80)) + defer mbTrans81.Close() + _, err82 := mbTrans81.WriteString(arg80) + if err82 != nil { + Usage() + return + } + factory83 := thrift.NewSimpleJSONProtocolFactory() + jsProt84 := factory83.GetProtocol(mbTrans81) + argvalue0 := storage.NewGetPropRequest() + err85 := argvalue0.Read(jsProt84) + if err85 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetProps(value0)) + fmt.Print("\n") + break + case "addVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") + flag.Usage() + } + arg86 := flag.Arg(1) + mbTrans87 := thrift.NewMemoryBufferLen(len(arg86)) + defer mbTrans87.Close() + _, err88 := mbTrans87.WriteString(arg86) + if err88 != nil { + Usage() + return + } + factory89 := thrift.NewSimpleJSONProtocolFactory() + jsProt90 := factory89.GetProtocol(mbTrans87) + argvalue0 := storage.NewAddVerticesRequest() + err91 := argvalue0.Read(jsProt90) + if err91 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddVertices(value0)) + fmt.Print("\n") + break + case "addEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") + flag.Usage() + } + arg92 := flag.Arg(1) + mbTrans93 := thrift.NewMemoryBufferLen(len(arg92)) + defer mbTrans93.Close() + _, err94 := mbTrans93.WriteString(arg92) + if err94 != nil { + Usage() + return + } + factory95 := thrift.NewSimpleJSONProtocolFactory() + jsProt96 := factory95.GetProtocol(mbTrans93) + argvalue0 := storage.NewAddEdgesRequest() + err97 := argvalue0.Read(jsProt96) + if err97 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdges(value0)) + fmt.Print("\n") + break + case "deleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") + flag.Usage() + } + arg98 := flag.Arg(1) + mbTrans99 := thrift.NewMemoryBufferLen(len(arg98)) + defer mbTrans99.Close() + _, err100 := mbTrans99.WriteString(arg98) + if err100 != nil { + Usage() + return + } + factory101 := thrift.NewSimpleJSONProtocolFactory() + jsProt102 := factory101.GetProtocol(mbTrans99) + argvalue0 := storage.NewDeleteEdgesRequest() + err103 := argvalue0.Read(jsProt102) + if err103 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteEdges(value0)) + fmt.Print("\n") + break + case "deleteVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") + flag.Usage() + } + arg104 := flag.Arg(1) + mbTrans105 := thrift.NewMemoryBufferLen(len(arg104)) + defer mbTrans105.Close() + _, err106 := mbTrans105.WriteString(arg104) + if err106 != nil { + Usage() + return + } + factory107 := thrift.NewSimpleJSONProtocolFactory() + jsProt108 := factory107.GetProtocol(mbTrans105) + argvalue0 := storage.NewDeleteVerticesRequest() + err109 := argvalue0.Read(jsProt108) + if err109 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteVertices(value0)) + fmt.Print("\n") + break + case "updateVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") + flag.Usage() + } + arg110 := flag.Arg(1) + mbTrans111 := thrift.NewMemoryBufferLen(len(arg110)) + defer mbTrans111.Close() + _, err112 := mbTrans111.WriteString(arg110) + if err112 != nil { + Usage() + return + } + factory113 := thrift.NewSimpleJSONProtocolFactory() + jsProt114 := factory113.GetProtocol(mbTrans111) + argvalue0 := storage.NewUpdateVertexRequest() + err115 := argvalue0.Read(jsProt114) + if err115 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateVertex(value0)) + fmt.Print("\n") + break + case "updateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") + flag.Usage() + } + arg116 := flag.Arg(1) + mbTrans117 := thrift.NewMemoryBufferLen(len(arg116)) + defer mbTrans117.Close() + _, err118 := mbTrans117.WriteString(arg116) + if err118 != nil { + Usage() + return + } + factory119 := thrift.NewSimpleJSONProtocolFactory() + jsProt120 := factory119.GetProtocol(mbTrans117) + argvalue0 := storage.NewUpdateEdgeRequest() + err121 := argvalue0.Read(jsProt120) + if err121 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateEdge(value0)) + fmt.Print("\n") + break + case "scanVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") + flag.Usage() + } + arg122 := flag.Arg(1) + mbTrans123 := thrift.NewMemoryBufferLen(len(arg122)) + defer mbTrans123.Close() + _, err124 := mbTrans123.WriteString(arg122) + if err124 != nil { + Usage() + return + } + factory125 := thrift.NewSimpleJSONProtocolFactory() + jsProt126 := factory125.GetProtocol(mbTrans123) + argvalue0 := storage.NewScanVertexRequest() + err127 := argvalue0.Read(jsProt126) + if err127 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanVertex(value0)) + fmt.Print("\n") + break + case "scanEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") + flag.Usage() + } + arg128 := flag.Arg(1) + mbTrans129 := thrift.NewMemoryBufferLen(len(arg128)) + defer mbTrans129.Close() + _, err130 := mbTrans129.WriteString(arg128) + if err130 != nil { + Usage() + return + } + factory131 := thrift.NewSimpleJSONProtocolFactory() + jsProt132 := factory131.GetProtocol(mbTrans129) + argvalue0 := storage.NewScanEdgeRequest() + err133 := argvalue0.Read(jsProt132) + if err133 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanEdge(value0)) + fmt.Print("\n") + break + case "getUUID": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") + flag.Usage() + } + arg134 := flag.Arg(1) + mbTrans135 := thrift.NewMemoryBufferLen(len(arg134)) + defer mbTrans135.Close() + _, err136 := mbTrans135.WriteString(arg134) + if err136 != nil { + Usage() + return + } + factory137 := thrift.NewSimpleJSONProtocolFactory() + jsProt138 := factory137.GetProtocol(mbTrans135) + argvalue0 := storage.NewGetUUIDReq() + err139 := argvalue0.Read(jsProt138) + if err139 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUUID(value0)) + fmt.Print("\n") + break + case "lookupIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") + flag.Usage() + } + arg140 := flag.Arg(1) + mbTrans141 := thrift.NewMemoryBufferLen(len(arg140)) + defer mbTrans141.Close() + _, err142 := mbTrans141.WriteString(arg140) + if err142 != nil { + Usage() + return + } + factory143 := thrift.NewSimpleJSONProtocolFactory() + jsProt144 := factory143.GetProtocol(mbTrans141) + argvalue0 := storage.NewLookupIndexRequest() + err145 := argvalue0.Read(jsProt144) + if err145 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupIndex(value0)) + fmt.Print("\n") + break + case "lookupAndTraverse": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") + flag.Usage() + } + arg146 := flag.Arg(1) + mbTrans147 := thrift.NewMemoryBufferLen(len(arg146)) + defer mbTrans147.Close() + _, err148 := mbTrans147.WriteString(arg146) + if err148 != nil { + Usage() + return + } + factory149 := thrift.NewSimpleJSONProtocolFactory() + jsProt150 := factory149.GetProtocol(mbTrans147) + argvalue0 := storage.NewLookupAndTraverseRequest() + err151 := argvalue0.Read(jsProt150) + if err151 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupAndTraverse(value0)) + fmt.Print("\n") + break + case "addEdgesAtomic": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdgesAtomic requires 1 args") + flag.Usage() + } + arg152 := flag.Arg(1) + mbTrans153 := thrift.NewMemoryBufferLen(len(arg152)) + defer mbTrans153.Close() + _, err154 := mbTrans153.WriteString(arg152) + if err154 != nil { + Usage() + return + } + factory155 := thrift.NewSimpleJSONProtocolFactory() + jsProt156 := factory155.GetProtocol(mbTrans153) + argvalue0 := storage.NewAddEdgesRequest() + err157 := argvalue0.Read(jsProt156) + if err157 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdgesAtomic(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/graphstorageservice.go b/ccore/nebula/internal/thrift/v2_5_1/storage/graphstorageservice.go new file mode 100644 index 0000000..3fac07c --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/graphstorageservice.go @@ -0,0 +1,4518 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GraphStorageService interface { + // Parameters: + // - Req + GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + AddEdgesAtomic(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceClientProtocol(prot thrift.Protocol) *GraphStorageServiceClient { + return NewGraphStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdgesAtomic", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdgesAtomic() +} + + +func (p *GraphStorageServiceClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesAtomicResult + err = p.CC.RecvMsg("addEdgesAtomic", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceThreadsafeClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return NewGraphStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdgesAtomic(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdgesAtomic", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdgesAtomic() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdgesAtomic() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesAtomicResult + err = p.CC.RecvMsg("addEdgesAtomic", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphStorageServiceChannelClient(channel thrift.RequestChannel) *GraphStorageServiceChannelClient { + return &GraphStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + var result GraphStorageServiceGetNeighborsResult + err = p.RequestChannel.Call(ctx, "getNeighbors", &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) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + var result GraphStorageServiceGetPropsResult + err = p.RequestChannel.Call(ctx, "getProps", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + var result GraphStorageServiceAddVerticesResult + err = p.RequestChannel.Call(ctx, "addVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + var result GraphStorageServiceAddEdgesResult + err = p.RequestChannel.Call(ctx, "addEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteEdgesResult + err = p.RequestChannel.Call(ctx, "deleteEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteVerticesResult + err = p.RequestChannel.Call(ctx, "deleteVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + var result GraphStorageServiceUpdateVertexResult + err = p.RequestChannel.Call(ctx, "updateVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + var result GraphStorageServiceUpdateEdgeResult + err = p.RequestChannel.Call(ctx, "updateEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + var result GraphStorageServiceScanVertexResult + err = p.RequestChannel.Call(ctx, "scanVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + var result GraphStorageServiceScanEdgeResult + err = p.RequestChannel.Call(ctx, "scanEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + var result GraphStorageServiceGetUUIDResult + err = p.RequestChannel.Call(ctx, "getUUID", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + var result GraphStorageServiceLookupIndexResult + err = p.RequestChannel.Call(ctx, "lookupIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + var result GraphStorageServiceLookupAndTraverseResult + err = p.RequestChannel.Call(ctx, "lookupAndTraverse", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddEdgesAtomic(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesAtomicArgs{ + Req : req, + } + var result GraphStorageServiceAddEdgesAtomicResult + err = p.RequestChannel.Call(ctx, "addEdgesAtomic", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphStorageService +} + +func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { + self72 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self72.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self72.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self72.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self72.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self72.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self72.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self72.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self72.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self72.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self72.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self72.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self72.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self72.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self72.processorMap["addEdgesAtomic"] = &graphStorageServiceProcessorAddEdgesAtomic{handler:handler} + return self72 +} + +type graphStorageServiceProcessorGetNeighbors struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetNeighbors) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetNeighborsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetNeighbors) 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("getNeighbors", 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 *graphStorageServiceProcessorGetNeighbors) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetNeighborsArgs) + var result GraphStorageServiceGetNeighborsResult + if retval, err := p.handler.GetNeighbors(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getNeighbors: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetProps struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetProps) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetPropsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetProps) 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("getProps", 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 *graphStorageServiceProcessorGetProps) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetPropsArgs) + var result GraphStorageServiceGetPropsResult + if retval, err := p.handler.GetProps(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProps: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddVertices) 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("addVertices", 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 *graphStorageServiceProcessorAddVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddVerticesArgs) + var result GraphStorageServiceAddVerticesResult + if retval, err := p.handler.AddVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdges) 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("addEdges", 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 *graphStorageServiceProcessorAddEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesArgs) + var result GraphStorageServiceAddEdgesResult + if retval, err := p.handler.AddEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteEdges) 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("deleteEdges", 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 *graphStorageServiceProcessorDeleteEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteEdgesArgs) + var result GraphStorageServiceDeleteEdgesResult + if retval, err := p.handler.DeleteEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteVertices) 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("deleteVertices", 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 *graphStorageServiceProcessorDeleteVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteVerticesArgs) + var result GraphStorageServiceDeleteVerticesResult + if retval, err := p.handler.DeleteVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateVertex) 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("updateVertex", 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 *graphStorageServiceProcessorUpdateVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateVertexArgs) + var result GraphStorageServiceUpdateVertexResult + if retval, err := p.handler.UpdateVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateEdge) 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("updateEdge", 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 *graphStorageServiceProcessorUpdateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateEdgeArgs) + var result GraphStorageServiceUpdateEdgeResult + if retval, err := p.handler.UpdateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanVertex) 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("scanVertex", 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 *graphStorageServiceProcessorScanVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanVertexArgs) + var result GraphStorageServiceScanVertexResult + if retval, err := p.handler.ScanVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanEdge) 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("scanEdge", 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 *graphStorageServiceProcessorScanEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanEdgeArgs) + var result GraphStorageServiceScanEdgeResult + if retval, err := p.handler.ScanEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetUUID struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetUUID) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetUUIDArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetUUID) 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("getUUID", 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 *graphStorageServiceProcessorGetUUID) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetUUIDArgs) + var result GraphStorageServiceGetUUIDResult + if retval, err := p.handler.GetUUID(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUUID: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupIndex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupIndex) 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("lookupIndex", 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 *graphStorageServiceProcessorLookupIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupIndexArgs) + var result GraphStorageServiceLookupIndexResult + if retval, err := p.handler.LookupIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupAndTraverse struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupAndTraverseArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) 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("lookupAndTraverse", 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 *graphStorageServiceProcessorLookupAndTraverse) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupAndTraverseArgs) + var result GraphStorageServiceLookupAndTraverseResult + if retval, err := p.handler.LookupAndTraverse(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupAndTraverse: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdgesAtomic struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesAtomicArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdgesAtomic) 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("addEdgesAtomic", 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 *graphStorageServiceProcessorAddEdgesAtomic) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesAtomicArgs) + var result GraphStorageServiceAddEdgesAtomicResult + if retval, err := p.handler.AddEdgesAtomic(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdgesAtomic: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GraphStorageServiceGetNeighborsArgs struct { + thrift.IRequest + Req *GetNeighborsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetNeighborsArgs() *GraphStorageServiceGetNeighborsArgs { + return &GraphStorageServiceGetNeighborsArgs{ + Req: NewGetNeighborsRequest(), + } +} + +var GraphStorageServiceGetNeighborsArgs_Req_DEFAULT *GetNeighborsRequest +func (p *GraphStorageServiceGetNeighborsArgs) GetReq() *GetNeighborsRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetNeighborsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetNeighborsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetNeighborsRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetNeighborsResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetNeighborsResult() *GraphStorageServiceGetNeighborsResult { + return &GraphStorageServiceGetNeighborsResult{} +} + +var GraphStorageServiceGetNeighborsResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceGetNeighborsResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetNeighborsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetNeighborsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetPropsArgs struct { + thrift.IRequest + Req *GetPropRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetPropsArgs() *GraphStorageServiceGetPropsArgs { + return &GraphStorageServiceGetPropsArgs{ + Req: NewGetPropRequest(), + } +} + +var GraphStorageServiceGetPropsArgs_Req_DEFAULT *GetPropRequest +func (p *GraphStorageServiceGetPropsArgs) GetReq() *GetPropRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetPropsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetPropsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPropRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetPropsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetPropsResult struct { + thrift.IResponse + Success *GetPropResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetPropsResult() *GraphStorageServiceGetPropsResult { + return &GraphStorageServiceGetPropsResult{} +} + +var GraphStorageServiceGetPropsResult_Success_DEFAULT *GetPropResponse +func (p *GraphStorageServiceGetPropsResult) GetSuccess() *GetPropResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetPropsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetPropsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPropResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetPropsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddVerticesArgs struct { + thrift.IRequest + Req *AddVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddVerticesArgs() *GraphStorageServiceAddVerticesArgs { + return &GraphStorageServiceAddVerticesArgs{ + Req: NewAddVerticesRequest(), + } +} + +var GraphStorageServiceAddVerticesArgs_Req_DEFAULT *AddVerticesRequest +func (p *GraphStorageServiceAddVerticesArgs) GetReq() *AddVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddVerticesResult() *GraphStorageServiceAddVerticesResult { + return &GraphStorageServiceAddVerticesResult{} +} + +var GraphStorageServiceAddVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesArgs() *GraphStorageServiceAddEdgesArgs { + return &GraphStorageServiceAddEdgesArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceAddEdgesArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesResult() *GraphStorageServiceAddEdgesResult { + return &GraphStorageServiceAddEdgesResult{} +} + +var GraphStorageServiceAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteEdgesArgs struct { + thrift.IRequest + Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteEdgesArgs() *GraphStorageServiceDeleteEdgesArgs { + return &GraphStorageServiceDeleteEdgesArgs{ + Req: NewDeleteEdgesRequest(), + } +} + +var GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest +func (p *GraphStorageServiceDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteEdgesResult() *GraphStorageServiceDeleteEdgesResult { + return &GraphStorageServiceDeleteEdgesResult{} +} + +var GraphStorageServiceDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteVerticesArgs struct { + thrift.IRequest + Req *DeleteVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteVerticesArgs() *GraphStorageServiceDeleteVerticesArgs { + return &GraphStorageServiceDeleteVerticesArgs{ + Req: NewDeleteVerticesRequest(), + } +} + +var GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT *DeleteVerticesRequest +func (p *GraphStorageServiceDeleteVerticesArgs) GetReq() *DeleteVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteVerticesResult() *GraphStorageServiceDeleteVerticesResult { + return &GraphStorageServiceDeleteVerticesResult{} +} + +var GraphStorageServiceDeleteVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateVertexArgs struct { + thrift.IRequest + Req *UpdateVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateVertexArgs() *GraphStorageServiceUpdateVertexArgs { + return &GraphStorageServiceUpdateVertexArgs{ + Req: NewUpdateVertexRequest(), + } +} + +var GraphStorageServiceUpdateVertexArgs_Req_DEFAULT *UpdateVertexRequest +func (p *GraphStorageServiceUpdateVertexArgs) GetReq() *UpdateVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateVertexResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateVertexResult() *GraphStorageServiceUpdateVertexResult { + return &GraphStorageServiceUpdateVertexResult{} +} + +var GraphStorageServiceUpdateVertexResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateVertexResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateEdgeArgs struct { + thrift.IRequest + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateEdgeArgs() *GraphStorageServiceUpdateEdgeArgs { + return &GraphStorageServiceUpdateEdgeArgs{ + Req: NewUpdateEdgeRequest(), + } +} + +var GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT *UpdateEdgeRequest +func (p *GraphStorageServiceUpdateEdgeArgs) GetReq() *UpdateEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateEdgeResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateEdgeResult() *GraphStorageServiceUpdateEdgeResult { + return &GraphStorageServiceUpdateEdgeResult{} +} + +var GraphStorageServiceUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanVertexArgs struct { + thrift.IRequest + Req *ScanVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanVertexArgs() *GraphStorageServiceScanVertexArgs { + return &GraphStorageServiceScanVertexArgs{ + Req: NewScanVertexRequest(), + } +} + +var GraphStorageServiceScanVertexArgs_Req_DEFAULT *ScanVertexRequest +func (p *GraphStorageServiceScanVertexArgs) GetReq() *ScanVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanVertexResult struct { + thrift.IResponse + Success *ScanVertexResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { + return &GraphStorageServiceScanVertexResult{} +} + +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanVertexResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanVertexResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanVertexResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanEdgeArgs struct { + thrift.IRequest + Req *ScanEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanEdgeArgs() *GraphStorageServiceScanEdgeArgs { + return &GraphStorageServiceScanEdgeArgs{ + Req: NewScanEdgeRequest(), + } +} + +var GraphStorageServiceScanEdgeArgs_Req_DEFAULT *ScanEdgeRequest +func (p *GraphStorageServiceScanEdgeArgs) GetReq() *ScanEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanEdgeResult struct { + thrift.IResponse + Success *ScanEdgeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { + return &GraphStorageServiceScanEdgeResult{} +} + +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanEdgeResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanEdgeResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanEdgeResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetUUIDArgs struct { + thrift.IRequest + Req *GetUUIDReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetUUIDArgs() *GraphStorageServiceGetUUIDArgs { + return &GraphStorageServiceGetUUIDArgs{ + Req: NewGetUUIDReq(), + } +} + +var GraphStorageServiceGetUUIDArgs_Req_DEFAULT *GetUUIDReq +func (p *GraphStorageServiceGetUUIDArgs) GetReq() *GetUUIDReq { + if !p.IsSetReq() { + return GraphStorageServiceGetUUIDArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetUUIDArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUUIDReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetUUIDResult struct { + thrift.IResponse + Success *GetUUIDResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetUUIDResult() *GraphStorageServiceGetUUIDResult { + return &GraphStorageServiceGetUUIDResult{} +} + +var GraphStorageServiceGetUUIDResult_Success_DEFAULT *GetUUIDResp +func (p *GraphStorageServiceGetUUIDResult) GetSuccess() *GetUUIDResp { + if !p.IsSetSuccess() { + return GraphStorageServiceGetUUIDResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetUUIDResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetUUIDResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupIndexArgs struct { + thrift.IRequest + Req *LookupIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupIndexArgs() *GraphStorageServiceLookupIndexArgs { + return &GraphStorageServiceLookupIndexArgs{ + Req: NewLookupIndexRequest(), + } +} + +var GraphStorageServiceLookupIndexArgs_Req_DEFAULT *LookupIndexRequest +func (p *GraphStorageServiceLookupIndexArgs) GetReq() *LookupIndexRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupIndexResult struct { + thrift.IResponse + Success *LookupIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupIndexResult() *GraphStorageServiceLookupIndexResult { + return &GraphStorageServiceLookupIndexResult{} +} + +var GraphStorageServiceLookupIndexResult_Success_DEFAULT *LookupIndexResp +func (p *GraphStorageServiceLookupIndexResult) GetSuccess() *LookupIndexResp { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewLookupIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupAndTraverseArgs struct { + thrift.IRequest + Req *LookupAndTraverseRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupAndTraverseArgs() *GraphStorageServiceLookupAndTraverseArgs { + return &GraphStorageServiceLookupAndTraverseArgs{ + Req: NewLookupAndTraverseRequest(), + } +} + +var GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT *LookupAndTraverseRequest +func (p *GraphStorageServiceLookupAndTraverseArgs) GetReq() *LookupAndTraverseRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupAndTraverseArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupAndTraverseRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupAndTraverseResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupAndTraverseResult() *GraphStorageServiceLookupAndTraverseResult { + return &GraphStorageServiceLookupAndTraverseResult{} +} + +var GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceLookupAndTraverseResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupAndTraverseResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesAtomicArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesAtomicArgs() *GraphStorageServiceAddEdgesAtomicArgs { + return &GraphStorageServiceAddEdgesAtomicArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesAtomicArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesAtomicArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesAtomicArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicArgs) 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 *GraphStorageServiceAddEdgesAtomicArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesAtomicResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesAtomicResult() *GraphStorageServiceAddEdgesAtomicResult { + return &GraphStorageServiceAddEdgesAtomicResult{} +} + +var GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesAtomicResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesAtomicResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesAtomicResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesAtomicResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdgesAtomic_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 *GraphStorageServiceAddEdgesAtomicResult) 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 *GraphStorageServiceAddEdgesAtomicResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesAtomicResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/storage_admin_service-remote/storage_admin_service-remote.go b/ccore/nebula/internal/thrift/v2_5_1/storage/storage_admin_service-remote/storage_admin_service-remote.go new file mode 100755 index 0000000..838a36f --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -0,0 +1,540 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AdminExecResp transLeader(TransLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addPart(AddPartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addLearner(AddLearnerReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp removePart(RemovePartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp memberChange(MemberChangeReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp waitingForCatchUpData(CatchUpDataReq req)") + fmt.Fprintln(os.Stderr, " CreateCPResp createCheckpoint(CreateCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp dropCheckpoint(DropCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp blockingWrites(BlockingSignRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildTagIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildEdgeIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetLeaderPartsResp getLeaderParts(GetLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp checkPeers(CheckPeersReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addAdminTask(AddAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp stopAdminTask(StopAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listClusterInfo(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewStorageAdminServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "transLeader": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") + flag.Usage() + } + arg160 := flag.Arg(1) + mbTrans161 := thrift.NewMemoryBufferLen(len(arg160)) + defer mbTrans161.Close() + _, err162 := mbTrans161.WriteString(arg160) + if err162 != nil { + Usage() + return + } + factory163 := thrift.NewSimpleJSONProtocolFactory() + jsProt164 := factory163.GetProtocol(mbTrans161) + argvalue0 := storage.NewTransLeaderReq() + err165 := argvalue0.Read(jsProt164) + if err165 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TransLeader(value0)) + fmt.Print("\n") + break + case "addPart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddPart requires 1 args") + flag.Usage() + } + arg166 := flag.Arg(1) + mbTrans167 := thrift.NewMemoryBufferLen(len(arg166)) + defer mbTrans167.Close() + _, err168 := mbTrans167.WriteString(arg166) + if err168 != nil { + Usage() + return + } + factory169 := thrift.NewSimpleJSONProtocolFactory() + jsProt170 := factory169.GetProtocol(mbTrans167) + argvalue0 := storage.NewAddPartReq() + err171 := argvalue0.Read(jsProt170) + if err171 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddPart(value0)) + fmt.Print("\n") + break + case "addLearner": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") + flag.Usage() + } + arg172 := flag.Arg(1) + mbTrans173 := thrift.NewMemoryBufferLen(len(arg172)) + defer mbTrans173.Close() + _, err174 := mbTrans173.WriteString(arg172) + if err174 != nil { + Usage() + return + } + factory175 := thrift.NewSimpleJSONProtocolFactory() + jsProt176 := factory175.GetProtocol(mbTrans173) + argvalue0 := storage.NewAddLearnerReq() + err177 := argvalue0.Read(jsProt176) + if err177 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddLearner(value0)) + fmt.Print("\n") + break + case "removePart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") + flag.Usage() + } + arg178 := flag.Arg(1) + mbTrans179 := thrift.NewMemoryBufferLen(len(arg178)) + defer mbTrans179.Close() + _, err180 := mbTrans179.WriteString(arg178) + if err180 != nil { + Usage() + return + } + factory181 := thrift.NewSimpleJSONProtocolFactory() + jsProt182 := factory181.GetProtocol(mbTrans179) + argvalue0 := storage.NewRemovePartReq() + err183 := argvalue0.Read(jsProt182) + if err183 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemovePart(value0)) + fmt.Print("\n") + break + case "memberChange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") + flag.Usage() + } + arg184 := flag.Arg(1) + mbTrans185 := thrift.NewMemoryBufferLen(len(arg184)) + defer mbTrans185.Close() + _, err186 := mbTrans185.WriteString(arg184) + if err186 != nil { + Usage() + return + } + factory187 := thrift.NewSimpleJSONProtocolFactory() + jsProt188 := factory187.GetProtocol(mbTrans185) + argvalue0 := storage.NewMemberChangeReq() + err189 := argvalue0.Read(jsProt188) + if err189 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MemberChange(value0)) + fmt.Print("\n") + break + case "waitingForCatchUpData": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") + flag.Usage() + } + arg190 := flag.Arg(1) + mbTrans191 := thrift.NewMemoryBufferLen(len(arg190)) + defer mbTrans191.Close() + _, err192 := mbTrans191.WriteString(arg190) + if err192 != nil { + Usage() + return + } + factory193 := thrift.NewSimpleJSONProtocolFactory() + jsProt194 := factory193.GetProtocol(mbTrans191) + argvalue0 := storage.NewCatchUpDataReq() + err195 := argvalue0.Read(jsProt194) + if err195 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.WaitingForCatchUpData(value0)) + fmt.Print("\n") + break + case "createCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") + flag.Usage() + } + arg196 := flag.Arg(1) + mbTrans197 := thrift.NewMemoryBufferLen(len(arg196)) + defer mbTrans197.Close() + _, err198 := mbTrans197.WriteString(arg196) + if err198 != nil { + Usage() + return + } + factory199 := thrift.NewSimpleJSONProtocolFactory() + jsProt200 := factory199.GetProtocol(mbTrans197) + argvalue0 := storage.NewCreateCPRequest() + err201 := argvalue0.Read(jsProt200) + if err201 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateCheckpoint(value0)) + fmt.Print("\n") + break + case "dropCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") + flag.Usage() + } + arg202 := flag.Arg(1) + mbTrans203 := thrift.NewMemoryBufferLen(len(arg202)) + defer mbTrans203.Close() + _, err204 := mbTrans203.WriteString(arg202) + if err204 != nil { + Usage() + return + } + factory205 := thrift.NewSimpleJSONProtocolFactory() + jsProt206 := factory205.GetProtocol(mbTrans203) + argvalue0 := storage.NewDropCPRequest() + err207 := argvalue0.Read(jsProt206) + if err207 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropCheckpoint(value0)) + fmt.Print("\n") + break + case "blockingWrites": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") + flag.Usage() + } + arg208 := flag.Arg(1) + mbTrans209 := thrift.NewMemoryBufferLen(len(arg208)) + defer mbTrans209.Close() + _, err210 := mbTrans209.WriteString(arg208) + if err210 != nil { + Usage() + return + } + factory211 := thrift.NewSimpleJSONProtocolFactory() + jsProt212 := factory211.GetProtocol(mbTrans209) + argvalue0 := storage.NewBlockingSignRequest() + err213 := argvalue0.Read(jsProt212) + if err213 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BlockingWrites(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg214 := flag.Arg(1) + mbTrans215 := thrift.NewMemoryBufferLen(len(arg214)) + defer mbTrans215.Close() + _, err216 := mbTrans215.WriteString(arg214) + if err216 != nil { + Usage() + return + } + factory217 := thrift.NewSimpleJSONProtocolFactory() + jsProt218 := factory217.GetProtocol(mbTrans215) + argvalue0 := storage.NewRebuildIndexRequest() + err219 := argvalue0.Read(jsProt218) + if err219 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg220 := flag.Arg(1) + mbTrans221 := thrift.NewMemoryBufferLen(len(arg220)) + defer mbTrans221.Close() + _, err222 := mbTrans221.WriteString(arg220) + if err222 != nil { + Usage() + return + } + factory223 := thrift.NewSimpleJSONProtocolFactory() + jsProt224 := factory223.GetProtocol(mbTrans221) + argvalue0 := storage.NewRebuildIndexRequest() + err225 := argvalue0.Read(jsProt224) + if err225 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "getLeaderParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") + flag.Usage() + } + arg226 := flag.Arg(1) + mbTrans227 := thrift.NewMemoryBufferLen(len(arg226)) + defer mbTrans227.Close() + _, err228 := mbTrans227.WriteString(arg226) + if err228 != nil { + Usage() + return + } + factory229 := thrift.NewSimpleJSONProtocolFactory() + jsProt230 := factory229.GetProtocol(mbTrans227) + argvalue0 := storage.NewGetLeaderReq() + err231 := argvalue0.Read(jsProt230) + if err231 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetLeaderParts(value0)) + fmt.Print("\n") + break + case "checkPeers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") + flag.Usage() + } + arg232 := flag.Arg(1) + mbTrans233 := thrift.NewMemoryBufferLen(len(arg232)) + defer mbTrans233.Close() + _, err234 := mbTrans233.WriteString(arg232) + if err234 != nil { + Usage() + return + } + factory235 := thrift.NewSimpleJSONProtocolFactory() + jsProt236 := factory235.GetProtocol(mbTrans233) + argvalue0 := storage.NewCheckPeersReq() + err237 := argvalue0.Read(jsProt236) + if err237 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckPeers(value0)) + fmt.Print("\n") + break + case "addAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") + flag.Usage() + } + arg238 := flag.Arg(1) + mbTrans239 := thrift.NewMemoryBufferLen(len(arg238)) + defer mbTrans239.Close() + _, err240 := mbTrans239.WriteString(arg238) + if err240 != nil { + Usage() + return + } + factory241 := thrift.NewSimpleJSONProtocolFactory() + jsProt242 := factory241.GetProtocol(mbTrans239) + argvalue0 := storage.NewAddAdminTaskRequest() + err243 := argvalue0.Read(jsProt242) + if err243 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddAdminTask(value0)) + fmt.Print("\n") + break + case "stopAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") + flag.Usage() + } + arg244 := flag.Arg(1) + mbTrans245 := thrift.NewMemoryBufferLen(len(arg244)) + defer mbTrans245.Close() + _, err246 := mbTrans245.WriteString(arg244) + if err246 != nil { + Usage() + return + } + factory247 := thrift.NewSimpleJSONProtocolFactory() + jsProt248 := factory247.GetProtocol(mbTrans245) + argvalue0 := storage.NewStopAdminTaskRequest() + err249 := argvalue0.Read(jsProt248) + if err249 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.StopAdminTask(value0)) + fmt.Print("\n") + break + case "listClusterInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListClusterInfo requires 1 args") + flag.Usage() + } + arg250 := flag.Arg(1) + mbTrans251 := thrift.NewMemoryBufferLen(len(arg250)) + defer mbTrans251.Close() + _, err252 := mbTrans251.WriteString(arg250) + if err252 != nil { + Usage() + return + } + factory253 := thrift.NewSimpleJSONProtocolFactory() + jsProt254 := factory253.GetProtocol(mbTrans251) + argvalue0 := storage.NewListClusterInfoReq() + err255 := argvalue0.Read(jsProt254) + if err255 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListClusterInfo(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/storageadminservice.go b/ccore/nebula/internal/thrift/v2_5_1/storage/storageadminservice.go new file mode 100644 index 0000000..599c92a --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/storageadminservice.go @@ -0,0 +1,5142 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type StorageAdminService interface { + // Parameters: + // - Req + TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn +} + +func(client *StorageAdminServiceClient) Open() error { + return client.CC.Open() +} + +func(client *StorageAdminServiceClient) Close() error { + return client.CC.Close() +} + +func(client *StorageAdminServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewStorageAdminServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceClientProtocol(prot thrift.Protocol) *StorageAdminServiceClient { + return NewStorageAdminServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceThreadsafeClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *StorageAdminServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *StorageAdminServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *StorageAdminServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewStorageAdminServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceThreadsafeClientProtocol(prot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return NewStorageAdminServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *StorageAdminServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *StorageAdminServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *StorageAdminServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewStorageAdminServiceChannelClient(channel thrift.RequestChannel) *StorageAdminServiceChannelClient { + return &StorageAdminServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + var result StorageAdminServiceTransLeaderResult + err = p.RequestChannel.Call(ctx, "transLeader", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + var result StorageAdminServiceAddPartResult + err = p.RequestChannel.Call(ctx, "addPart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + var result StorageAdminServiceAddLearnerResult + err = p.RequestChannel.Call(ctx, "addLearner", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + var result StorageAdminServiceRemovePartResult + err = p.RequestChannel.Call(ctx, "removePart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + var result StorageAdminServiceMemberChangeResult + err = p.RequestChannel.Call(ctx, "memberChange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.RequestChannel.Call(ctx, "waitingForCatchUpData", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceCreateCheckpointResult + err = p.RequestChannel.Call(ctx, "createCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceDropCheckpointResult + err = p.RequestChannel.Call(ctx, "dropCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + var result StorageAdminServiceBlockingWritesResult + err = p.RequestChannel.Call(ctx, "blockingWrites", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + var result StorageAdminServiceGetLeaderPartsResult + err = p.RequestChannel.Call(ctx, "getLeaderParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + var result StorageAdminServiceCheckPeersResult + err = p.RequestChannel.Call(ctx, "checkPeers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceAddAdminTaskResult + err = p.RequestChannel.Call(ctx, "addAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceStopAdminTaskResult + err = p.RequestChannel.Call(ctx, "stopAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + var result StorageAdminServiceListClusterInfoResult + err = p.RequestChannel.Call(ctx, "listClusterInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler StorageAdminService +} + +func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *StorageAdminServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { + self158 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self158.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self158.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self158.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self158.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self158.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self158.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self158.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self158.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self158.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self158.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} + self158.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} + self158.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self158.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self158.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self158.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self158.processorMap["listClusterInfo"] = &storageAdminServiceProcessorListClusterInfo{handler:handler} + return self158 +} + +type storageAdminServiceProcessorTransLeader struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorTransLeader) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceTransLeaderArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorTransLeader) 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("transLeader", 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 *storageAdminServiceProcessorTransLeader) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceTransLeaderArgs) + var result StorageAdminServiceTransLeaderResult + if retval, err := p.handler.TransLeader(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transLeader: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddPart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddPart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddPartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddPart) 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("addPart", 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 *storageAdminServiceProcessorAddPart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddPartArgs) + var result StorageAdminServiceAddPartResult + if retval, err := p.handler.AddPart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addPart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddLearner struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddLearner) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddLearnerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddLearner) 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("addLearner", 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 *storageAdminServiceProcessorAddLearner) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddLearnerArgs) + var result StorageAdminServiceAddLearnerResult + if retval, err := p.handler.AddLearner(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addLearner: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRemovePart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRemovePart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRemovePartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRemovePart) 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("removePart", 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 *storageAdminServiceProcessorRemovePart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRemovePartArgs) + var result StorageAdminServiceRemovePartResult + if retval, err := p.handler.RemovePart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removePart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorMemberChange struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorMemberChange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceMemberChangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorMemberChange) 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("memberChange", 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 *storageAdminServiceProcessorMemberChange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceMemberChangeArgs) + var result StorageAdminServiceMemberChangeResult + if retval, err := p.handler.MemberChange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing memberChange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorWaitingForCatchUpData struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) 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("waitingForCatchUpData", 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 *storageAdminServiceProcessorWaitingForCatchUpData) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceWaitingForCatchUpDataArgs) + var result StorageAdminServiceWaitingForCatchUpDataResult + if retval, err := p.handler.WaitingForCatchUpData(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing waitingForCatchUpData: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCreateCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCreateCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) 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("createCheckpoint", 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 *storageAdminServiceProcessorCreateCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCreateCheckpointArgs) + var result StorageAdminServiceCreateCheckpointResult + if retval, err := p.handler.CreateCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorDropCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorDropCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceDropCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorDropCheckpoint) 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("dropCheckpoint", 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 *storageAdminServiceProcessorDropCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceDropCheckpointArgs) + var result StorageAdminServiceDropCheckpointResult + if retval, err := p.handler.DropCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorBlockingWrites struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorBlockingWrites) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceBlockingWritesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorBlockingWrites) 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("blockingWrites", 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 *storageAdminServiceProcessorBlockingWrites) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceBlockingWritesArgs) + var result StorageAdminServiceBlockingWritesResult + if retval, err := p.handler.BlockingWrites(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing blockingWrites: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildTagIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *storageAdminServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildTagIndexArgs) + var result StorageAdminServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildEdgeIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *storageAdminServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildEdgeIndexArgs) + var result StorageAdminServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorGetLeaderParts struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorGetLeaderParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceGetLeaderPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorGetLeaderParts) 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("getLeaderParts", 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 *storageAdminServiceProcessorGetLeaderParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceGetLeaderPartsArgs) + var result StorageAdminServiceGetLeaderPartsResult + if retval, err := p.handler.GetLeaderParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getLeaderParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCheckPeers struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCheckPeers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCheckPeersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCheckPeers) 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("checkPeers", 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 *storageAdminServiceProcessorCheckPeers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCheckPeersArgs) + var result StorageAdminServiceCheckPeersResult + if retval, err := p.handler.CheckPeers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPeers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddAdminTask) 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("addAdminTask", 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 *storageAdminServiceProcessorAddAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddAdminTaskArgs) + var result StorageAdminServiceAddAdminTaskResult + if retval, err := p.handler.AddAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorStopAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorStopAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceStopAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorStopAdminTask) 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("stopAdminTask", 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 *storageAdminServiceProcessorStopAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceStopAdminTaskArgs) + var result StorageAdminServiceStopAdminTaskResult + if retval, err := p.handler.StopAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stopAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorListClusterInfo struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorListClusterInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceListClusterInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorListClusterInfo) 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("listClusterInfo", 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 *storageAdminServiceProcessorListClusterInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceListClusterInfoArgs) + var result StorageAdminServiceListClusterInfoResult + if retval, err := p.handler.ListClusterInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listClusterInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type StorageAdminServiceTransLeaderArgs struct { + thrift.IRequest + Req *TransLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceTransLeaderArgs() *StorageAdminServiceTransLeaderArgs { + return &StorageAdminServiceTransLeaderArgs{ + Req: NewTransLeaderReq(), + } +} + +var StorageAdminServiceTransLeaderArgs_Req_DEFAULT *TransLeaderReq +func (p *StorageAdminServiceTransLeaderArgs) GetReq() *TransLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceTransLeaderArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceTransLeaderArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewTransLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceTransLeaderResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceTransLeaderResult() *StorageAdminServiceTransLeaderResult { + return &StorageAdminServiceTransLeaderResult{} +} + +var StorageAdminServiceTransLeaderResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceTransLeaderResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceTransLeaderResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceTransLeaderResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddPartArgs struct { + thrift.IRequest + Req *AddPartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddPartArgs() *StorageAdminServiceAddPartArgs { + return &StorageAdminServiceAddPartArgs{ + Req: NewAddPartReq(), + } +} + +var StorageAdminServiceAddPartArgs_Req_DEFAULT *AddPartReq +func (p *StorageAdminServiceAddPartArgs) GetReq() *AddPartReq { + if !p.IsSetReq() { + return StorageAdminServiceAddPartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddPartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddPartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddPartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddPartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddPartResult() *StorageAdminServiceAddPartResult { + return &StorageAdminServiceAddPartResult{} +} + +var StorageAdminServiceAddPartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddPartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddPartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddPartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddPartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddLearnerArgs struct { + thrift.IRequest + Req *AddLearnerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddLearnerArgs() *StorageAdminServiceAddLearnerArgs { + return &StorageAdminServiceAddLearnerArgs{ + Req: NewAddLearnerReq(), + } +} + +var StorageAdminServiceAddLearnerArgs_Req_DEFAULT *AddLearnerReq +func (p *StorageAdminServiceAddLearnerArgs) GetReq() *AddLearnerReq { + if !p.IsSetReq() { + return StorageAdminServiceAddLearnerArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddLearnerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddLearnerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddLearnerResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddLearnerResult() *StorageAdminServiceAddLearnerResult { + return &StorageAdminServiceAddLearnerResult{} +} + +var StorageAdminServiceAddLearnerResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddLearnerResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddLearnerResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddLearnerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRemovePartArgs struct { + thrift.IRequest + Req *RemovePartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRemovePartArgs() *StorageAdminServiceRemovePartArgs { + return &StorageAdminServiceRemovePartArgs{ + Req: NewRemovePartReq(), + } +} + +var StorageAdminServiceRemovePartArgs_Req_DEFAULT *RemovePartReq +func (p *StorageAdminServiceRemovePartArgs) GetReq() *RemovePartReq { + if !p.IsSetReq() { + return StorageAdminServiceRemovePartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRemovePartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemovePartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRemovePartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRemovePartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRemovePartResult() *StorageAdminServiceRemovePartResult { + return &StorageAdminServiceRemovePartResult{} +} + +var StorageAdminServiceRemovePartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRemovePartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRemovePartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRemovePartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRemovePartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceMemberChangeArgs struct { + thrift.IRequest + Req *MemberChangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceMemberChangeArgs() *StorageAdminServiceMemberChangeArgs { + return &StorageAdminServiceMemberChangeArgs{ + Req: NewMemberChangeReq(), + } +} + +var StorageAdminServiceMemberChangeArgs_Req_DEFAULT *MemberChangeReq +func (p *StorageAdminServiceMemberChangeArgs) GetReq() *MemberChangeReq { + if !p.IsSetReq() { + return StorageAdminServiceMemberChangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceMemberChangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMemberChangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceMemberChangeResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceMemberChangeResult() *StorageAdminServiceMemberChangeResult { + return &StorageAdminServiceMemberChangeResult{} +} + +var StorageAdminServiceMemberChangeResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceMemberChangeResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceMemberChangeResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceMemberChangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceWaitingForCatchUpDataArgs struct { + thrift.IRequest + Req *CatchUpDataReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataArgs() *StorageAdminServiceWaitingForCatchUpDataArgs { + return &StorageAdminServiceWaitingForCatchUpDataArgs{ + Req: NewCatchUpDataReq(), + } +} + +var StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT *CatchUpDataReq +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) GetReq() *CatchUpDataReq { + if !p.IsSetReq() { + return StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCatchUpDataReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceWaitingForCatchUpDataResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataResult() *StorageAdminServiceWaitingForCatchUpDataResult { + return &StorageAdminServiceWaitingForCatchUpDataResult{} +} + +var StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceWaitingForCatchUpDataResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceWaitingForCatchUpDataResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCreateCheckpointArgs struct { + thrift.IRequest + Req *CreateCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCreateCheckpointArgs() *StorageAdminServiceCreateCheckpointArgs { + return &StorageAdminServiceCreateCheckpointArgs{ + Req: NewCreateCPRequest(), + } +} + +var StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT *CreateCPRequest +func (p *StorageAdminServiceCreateCheckpointArgs) GetReq() *CreateCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCreateCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCreateCheckpointResult struct { + thrift.IResponse + Success *CreateCPResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCreateCheckpointResult() *StorageAdminServiceCreateCheckpointResult { + return &StorageAdminServiceCreateCheckpointResult{} +} + +var StorageAdminServiceCreateCheckpointResult_Success_DEFAULT *CreateCPResp +func (p *StorageAdminServiceCreateCheckpointResult) GetSuccess() *CreateCPResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCreateCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCreateCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateCPResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceDropCheckpointArgs struct { + thrift.IRequest + Req *DropCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceDropCheckpointArgs() *StorageAdminServiceDropCheckpointArgs { + return &StorageAdminServiceDropCheckpointArgs{ + Req: NewDropCPRequest(), + } +} + +var StorageAdminServiceDropCheckpointArgs_Req_DEFAULT *DropCPRequest +func (p *StorageAdminServiceDropCheckpointArgs) GetReq() *DropCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceDropCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceDropCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceDropCheckpointResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { + return &StorageAdminServiceDropCheckpointResult{} +} + +var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceDropCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceBlockingWritesArgs struct { + thrift.IRequest + Req *BlockingSignRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceBlockingWritesArgs() *StorageAdminServiceBlockingWritesArgs { + return &StorageAdminServiceBlockingWritesArgs{ + Req: NewBlockingSignRequest(), + } +} + +var StorageAdminServiceBlockingWritesArgs_Req_DEFAULT *BlockingSignRequest +func (p *StorageAdminServiceBlockingWritesArgs) GetReq() *BlockingSignRequest { + if !p.IsSetReq() { + return StorageAdminServiceBlockingWritesArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceBlockingWritesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBlockingSignRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceBlockingWritesResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { + return &StorageAdminServiceBlockingWritesResult{} +} + +var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceBlockingWritesResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildTagIndexArgs() *StorageAdminServiceRebuildTagIndexArgs { + return &StorageAdminServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildTagIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildTagIndexResult() *StorageAdminServiceRebuildTagIndexResult { + return &StorageAdminServiceRebuildTagIndexResult{} +} + +var StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildTagIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildEdgeIndexArgs() *StorageAdminServiceRebuildEdgeIndexArgs { + return &StorageAdminServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildEdgeIndexResult() *StorageAdminServiceRebuildEdgeIndexResult { + return &StorageAdminServiceRebuildEdgeIndexResult{} +} + +var StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildEdgeIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceGetLeaderPartsArgs struct { + thrift.IRequest + Req *GetLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceGetLeaderPartsArgs() *StorageAdminServiceGetLeaderPartsArgs { + return &StorageAdminServiceGetLeaderPartsArgs{ + Req: NewGetLeaderReq(), + } +} + +var StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT *GetLeaderReq +func (p *StorageAdminServiceGetLeaderPartsArgs) GetReq() *GetLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceGetLeaderPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceGetLeaderPartsResult struct { + thrift.IResponse + Success *GetLeaderPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceGetLeaderPartsResult() *StorageAdminServiceGetLeaderPartsResult { + return &StorageAdminServiceGetLeaderPartsResult{} +} + +var StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT *GetLeaderPartsResp +func (p *StorageAdminServiceGetLeaderPartsResult) GetSuccess() *GetLeaderPartsResp { + if !p.IsSetSuccess() { + return StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceGetLeaderPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetLeaderPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCheckPeersArgs struct { + thrift.IRequest + Req *CheckPeersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCheckPeersArgs() *StorageAdminServiceCheckPeersArgs { + return &StorageAdminServiceCheckPeersArgs{ + Req: NewCheckPeersReq(), + } +} + +var StorageAdminServiceCheckPeersArgs_Req_DEFAULT *CheckPeersReq +func (p *StorageAdminServiceCheckPeersArgs) GetReq() *CheckPeersReq { + if !p.IsSetReq() { + return StorageAdminServiceCheckPeersArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCheckPeersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCheckPeersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCheckPeersResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCheckPeersResult() *StorageAdminServiceCheckPeersResult { + return &StorageAdminServiceCheckPeersResult{} +} + +var StorageAdminServiceCheckPeersResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceCheckPeersResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCheckPeersResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCheckPeersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddAdminTaskArgs struct { + thrift.IRequest + Req *AddAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { + return &StorageAdminServiceAddAdminTaskArgs{ + Req: NewAddAdminTaskRequest(), + } +} + +var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddAdminTaskRequest +func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { + return &StorageAdminServiceAddAdminTaskResult{} +} + +var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceStopAdminTaskArgs struct { + thrift.IRequest + Req *StopAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { + return &StorageAdminServiceStopAdminTaskArgs{ + Req: NewStopAdminTaskRequest(), + } +} + +var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopAdminTaskRequest +func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewStopAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceStopAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { + return &StorageAdminServiceStopAdminTaskResult{} +} + +var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceListClusterInfoArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceListClusterInfoArgs() *StorageAdminServiceListClusterInfoArgs { + return &StorageAdminServiceListClusterInfoArgs{ + Req: NewListClusterInfoReq(), + } +} + +var StorageAdminServiceListClusterInfoArgs_Req_DEFAULT *ListClusterInfoReq +func (p *StorageAdminServiceListClusterInfoArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return StorageAdminServiceListClusterInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceListClusterInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceListClusterInfoResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceListClusterInfoResult() *StorageAdminServiceListClusterInfoResult { + return &StorageAdminServiceListClusterInfoResult{} +} + +var StorageAdminServiceListClusterInfoResult_Success_DEFAULT *ListClusterInfoResp +func (p *StorageAdminServiceListClusterInfoResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return StorageAdminServiceListClusterInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceListClusterInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_5_1/storage/ttypes.go b/ccore/nebula/internal/thrift/v2_5_1/storage/ttypes.go new file mode 100644 index 0000000..6611954 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/storage/ttypes.go @@ -0,0 +1,12495 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_5_1/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type StatType int64 +const ( + StatType_SUM StatType = 1 + StatType_COUNT StatType = 2 + StatType_AVG StatType = 3 + StatType_MAX StatType = 4 + StatType_MIN StatType = 5 +) + +var StatTypeToName = map[StatType]string { + StatType_SUM: "SUM", + StatType_COUNT: "COUNT", + StatType_AVG: "AVG", + StatType_MAX: "MAX", + StatType_MIN: "MIN", +} + +var StatTypeToValue = map[string]StatType { + "SUM": StatType_SUM, + "COUNT": StatType_COUNT, + "AVG": StatType_AVG, + "MAX": StatType_MAX, + "MIN": StatType_MIN, +} + +var StatTypeNames = []string { + "SUM", + "COUNT", + "AVG", + "MAX", + "MIN", +} + +var StatTypeValues = []StatType { + StatType_SUM, + StatType_COUNT, + StatType_AVG, + StatType_MAX, + StatType_MIN, +} + +func (p StatType) String() string { + if v, ok := StatTypeToName[p]; ok { + return v + } + return "" +} + +func StatTypeFromString(s string) (StatType, error) { + if v, ok := StatTypeToValue[s]; ok { + return v, nil + } + return StatType(0), fmt.Errorf("not a valid StatType string") +} + +func StatTypePtr(v StatType) *StatType { return &v } + +type OrderDirection int64 +const ( + OrderDirection_ASCENDING OrderDirection = 1 + OrderDirection_DESCENDING OrderDirection = 2 +) + +var OrderDirectionToName = map[OrderDirection]string { + OrderDirection_ASCENDING: "ASCENDING", + OrderDirection_DESCENDING: "DESCENDING", +} + +var OrderDirectionToValue = map[string]OrderDirection { + "ASCENDING": OrderDirection_ASCENDING, + "DESCENDING": OrderDirection_DESCENDING, +} + +var OrderDirectionNames = []string { + "ASCENDING", + "DESCENDING", +} + +var OrderDirectionValues = []OrderDirection { + OrderDirection_ASCENDING, + OrderDirection_DESCENDING, +} + +func (p OrderDirection) String() string { + if v, ok := OrderDirectionToName[p]; ok { + return v + } + return "" +} + +func OrderDirectionFromString(s string) (OrderDirection, error) { + if v, ok := OrderDirectionToValue[s]; ok { + return v, nil + } + return OrderDirection(0), fmt.Errorf("not a valid OrderDirection string") +} + +func OrderDirectionPtr(v OrderDirection) *OrderDirection { return &v } + +type EdgeDirection int64 +const ( + EdgeDirection_BOTH EdgeDirection = 1 + EdgeDirection_IN_EDGE EdgeDirection = 2 + EdgeDirection_OUT_EDGE EdgeDirection = 3 +) + +var EdgeDirectionToName = map[EdgeDirection]string { + EdgeDirection_BOTH: "BOTH", + EdgeDirection_IN_EDGE: "IN_EDGE", + EdgeDirection_OUT_EDGE: "OUT_EDGE", +} + +var EdgeDirectionToValue = map[string]EdgeDirection { + "BOTH": EdgeDirection_BOTH, + "IN_EDGE": EdgeDirection_IN_EDGE, + "OUT_EDGE": EdgeDirection_OUT_EDGE, +} + +var EdgeDirectionNames = []string { + "BOTH", + "IN_EDGE", + "OUT_EDGE", +} + +var EdgeDirectionValues = []EdgeDirection { + EdgeDirection_BOTH, + EdgeDirection_IN_EDGE, + EdgeDirection_OUT_EDGE, +} + +func (p EdgeDirection) String() string { + if v, ok := EdgeDirectionToName[p]; ok { + return v + } + return "" +} + +func EdgeDirectionFromString(s string) (EdgeDirection, error) { + if v, ok := EdgeDirectionToValue[s]; ok { + return v, nil + } + return EdgeDirection(0), fmt.Errorf("not a valid EdgeDirection string") +} + +func EdgeDirectionPtr(v EdgeDirection) *EdgeDirection { return &v } + +type ScanType int64 +const ( + ScanType_PREFIX ScanType = 1 + ScanType_RANGE ScanType = 2 +) + +var ScanTypeToName = map[ScanType]string { + ScanType_PREFIX: "PREFIX", + ScanType_RANGE: "RANGE", +} + +var ScanTypeToValue = map[string]ScanType { + "PREFIX": ScanType_PREFIX, + "RANGE": ScanType_RANGE, +} + +var ScanTypeNames = []string { + "PREFIX", + "RANGE", +} + +var ScanTypeValues = []ScanType { + ScanType_PREFIX, + ScanType_RANGE, +} + +func (p ScanType) String() string { + if v, ok := ScanTypeToName[p]; ok { + return v + } + return "" +} + +func ScanTypeFromString(s string) (ScanType, error) { + if v, ok := ScanTypeToValue[s]; ok { + return v, nil + } + return ScanType(0), fmt.Errorf("not a valid ScanType string") +} + +func ScanTypePtr(v ScanType) *ScanType { return &v } + +type EngineSignType int64 +const ( + EngineSignType_BLOCK_ON EngineSignType = 1 + EngineSignType_BLOCK_OFF EngineSignType = 2 +) + +var EngineSignTypeToName = map[EngineSignType]string { + EngineSignType_BLOCK_ON: "BLOCK_ON", + EngineSignType_BLOCK_OFF: "BLOCK_OFF", +} + +var EngineSignTypeToValue = map[string]EngineSignType { + "BLOCK_ON": EngineSignType_BLOCK_ON, + "BLOCK_OFF": EngineSignType_BLOCK_OFF, +} + +var EngineSignTypeNames = []string { + "BLOCK_ON", + "BLOCK_OFF", +} + +var EngineSignTypeValues = []EngineSignType { + EngineSignType_BLOCK_ON, + EngineSignType_BLOCK_OFF, +} + +func (p EngineSignType) String() string { + if v, ok := EngineSignTypeToName[p]; ok { + return v + } + return "" +} + +func EngineSignTypeFromString(s string) (EngineSignType, error) { + if v, ok := EngineSignTypeToValue[s]; ok { + return v, nil + } + return EngineSignType(0), fmt.Errorf("not a valid EngineSignType string") +} + +func EngineSignTypePtr(v EngineSignType) *EngineSignType { return &v } + +// Attributes: +// - Code +// - PartID +// - Leader +type PartitionResult_ struct { + Code nebula0.ErrorCode `thrift:"code,1,required" db:"code" json:"code"` + PartID nebula0.PartitionID `thrift:"part_id,2,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader,omitempty"` +} + +func NewPartitionResult_() *PartitionResult_ { + return &PartitionResult_{} +} + + +func (p *PartitionResult_) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *PartitionResult_) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartitionResult__Leader_DEFAULT *nebula0.HostAddr +func (p *PartitionResult_) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartitionResult__Leader_DEFAULT + } +return p.Leader +} +func (p *PartitionResult_) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartitionResult_) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetCode bool = false; + var issetPartID 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 + } + issetCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetPartID = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")); + } + if !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + return nil +} + +func (p *PartitionResult_) 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 *PartitionResult_) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartitionResult_) ReadField3(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 *PartitionResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionResult"); 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 *PartitionResult_) 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 *PartitionResult_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + } + return err +} + +func (p *PartitionResult_) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("PartitionResult_({Code:%s PartID:%s Leader:%s})", codeVal, partIDVal, leaderVal) +} + +// Attributes: +// - FailedParts +// - LatencyInUs +type ResponseCommon struct { + FailedParts []*PartitionResult_ `thrift:"failed_parts,1,required" db:"failed_parts" json:"failed_parts"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` +} + +func NewResponseCommon() *ResponseCommon { + return &ResponseCommon{} +} + + +func (p *ResponseCommon) GetFailedParts() []*PartitionResult_ { + return p.FailedParts +} + +func (p *ResponseCommon) GetLatencyInUs() int32 { + return p.LatencyInUs +} +func (p *ResponseCommon) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFailedParts bool = false; + var issetLatencyInUs 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 + } + issetFailedParts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetFailedParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedParts is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ResponseCommon) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartitionResult_, 0, size) + p.FailedParts = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewPartitionResult_() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.FailedParts = append(p.FailedParts, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ResponseCommon) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ResponseCommon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ResponseCommon"); 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 *ResponseCommon) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("failed_parts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:failed_parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FailedParts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.FailedParts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:failed_parts: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ResponseCommon) String() string { + if p == nil { + return "" + } + + failedPartsVal := fmt.Sprintf("%v", p.FailedParts) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + return fmt.Sprintf("ResponseCommon({FailedParts:%s LatencyInUs:%s})", failedPartsVal, latencyInUsVal) +} + +// Attributes: +// - Alias +// - Prop +// - Stat +type StatProp struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Prop []byte `thrift:"prop,2" db:"prop" json:"prop"` + Stat StatType `thrift:"stat,3" db:"stat" json:"stat"` +} + +func NewStatProp() *StatProp { + return &StatProp{} +} + + +func (p *StatProp) GetAlias() []byte { + return p.Alias +} + +func (p *StatProp) GetProp() []byte { + return p.Prop +} + +func (p *StatProp) GetStat() StatType { + return p.Stat +} +func (p *StatProp) 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 *StatProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *StatProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *StatProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := StatType(v) + p.Stat = temp +} + return nil +} + +func (p *StatProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatProp"); 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 *StatProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *StatProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prop: ", p), err) } + return err +} + +func (p *StatProp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stat", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat: ", p), err) } + if err := oprot.WriteI32(int32(p.Stat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stat (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat: ", p), err) } + return err +} + +func (p *StatProp) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + propVal := fmt.Sprintf("%v", p.Prop) + statVal := fmt.Sprintf("%v", p.Stat) + return fmt.Sprintf("StatProp({Alias:%s Prop:%s Stat:%s})", aliasVal, propVal, statVal) +} + +// Attributes: +// - Alias +// - Expr +type Expr struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Expr []byte `thrift:"expr,2" db:"expr" json:"expr"` +} + +func NewExpr() *Expr { + return &Expr{} +} + + +func (p *Expr) GetAlias() []byte { + return p.Alias +} + +func (p *Expr) GetExpr() []byte { + return p.Expr +} +func (p *Expr) 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 *Expr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *Expr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Expr = v +} + return nil +} + +func (p *Expr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Expr"); 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 *Expr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *Expr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("expr", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expr: ", p), err) } + if err := oprot.WriteBinary(p.Expr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expr: ", p), err) } + return err +} + +func (p *Expr) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + exprVal := fmt.Sprintf("%v", p.Expr) + return fmt.Sprintf("Expr({Alias:%s Expr:%s})", aliasVal, exprVal) +} + +// Attributes: +// - Type +// - Props +type EdgeProp struct { + Type nebula0.EdgeType `thrift:"type,1" db:"type" json:"type"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewEdgeProp() *EdgeProp { + return &EdgeProp{} +} + + +func (p *EdgeProp) GetType() nebula0.EdgeType { + return p.Type +} + +func (p *EdgeProp) GetProps() [][]byte { + return p.Props +} +func (p *EdgeProp) 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 *EdgeProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *EdgeProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem3 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem3 = v +} + p.Props = append(p.Props, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *EdgeProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeProp"); 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 *EdgeProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *EdgeProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *EdgeProp) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("EdgeProp({Type:%s Props:%s})", typeVal, propsVal) +} + +// Attributes: +// - Tag +// - Props +type VertexProp struct { + Tag nebula0.TagID `thrift:"tag,1" db:"tag" json:"tag"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewVertexProp() *VertexProp { + return &VertexProp{} +} + + +func (p *VertexProp) GetTag() nebula0.TagID { + return p.Tag +} + +func (p *VertexProp) GetProps() [][]byte { + return p.Props +} +func (p *VertexProp) 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 *VertexProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.Tag = temp +} + return nil +} + +func (p *VertexProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem4 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem4 = v +} + p.Props = append(p.Props, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *VertexProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VertexProp"); 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 *VertexProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) } + if err := oprot.WriteI32(int32(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) } + return err +} + +func (p *VertexProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *VertexProp) String() string { + if p == nil { + return "" + } + + tagVal := fmt.Sprintf("%v", p.Tag) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("VertexProp({Tag:%s Props:%s})", tagVal, propsVal) +} + +// Attributes: +// - Prop +// - Direction +type OrderBy struct { + Prop []byte `thrift:"prop,1" db:"prop" json:"prop"` + Direction OrderDirection `thrift:"direction,2" db:"direction" json:"direction"` +} + +func NewOrderBy() *OrderBy { + return &OrderBy{} +} + + +func (p *OrderBy) GetProp() []byte { + return p.Prop +} + +func (p *OrderBy) GetDirection() OrderDirection { + return p.Direction +} +func (p *OrderBy) 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 *OrderBy) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *OrderBy) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := OrderDirection(v) + p.Direction = temp +} + return nil +} + +func (p *OrderBy) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("OrderBy"); 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 *OrderBy) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prop: ", p), err) } + return err +} + +func (p *OrderBy) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:direction: ", p), err) } + if err := oprot.WriteI32(int32(p.Direction)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:direction: ", p), err) } + return err +} + +func (p *OrderBy) String() string { + if p == nil { + return "" + } + + propVal := fmt.Sprintf("%v", p.Prop) + directionVal := fmt.Sprintf("%v", p.Direction) + return fmt.Sprintf("OrderBy({Prop:%s Direction:%s})", propVal, directionVal) +} + +// Attributes: +// - EdgeTypes +// - EdgeDirection +// - Dedup +// - StatProps +// - VertexProps +// - EdgeProps +// - Expressions +// - OrderBy +// - Random +// - Limit +// - Filter +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"` + Dedup bool `thrift:"dedup,3" db:"dedup" json:"dedup"` + StatProps []*StatProp `thrift:"stat_props,4" db:"stat_props" json:"stat_props,omitempty"` + VertexProps []*VertexProp `thrift:"vertex_props,5" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,6" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,7" db:"expressions" json:"expressions,omitempty"` + OrderBy []*OrderBy `thrift:"order_by,8" db:"order_by" json:"order_by,omitempty"` + Random *bool `thrift:"random,9" db:"random" json:"random,omitempty"` + Limit *int64 `thrift:"limit,10" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,11" db:"filter" json:"filter,omitempty"` +} + +func NewTraverseSpec() *TraverseSpec { + return &TraverseSpec{ + EdgeDirection: 1, + } +} + + +func (p *TraverseSpec) GetEdgeTypes() []nebula0.EdgeType { + return p.EdgeTypes +} + +func (p *TraverseSpec) GetEdgeDirection() EdgeDirection { + return p.EdgeDirection +} + +func (p *TraverseSpec) GetDedup() bool { + return p.Dedup +} +var TraverseSpec_StatProps_DEFAULT []*StatProp + +func (p *TraverseSpec) GetStatProps() []*StatProp { + return p.StatProps +} +var TraverseSpec_VertexProps_DEFAULT []*VertexProp + +func (p *TraverseSpec) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var TraverseSpec_EdgeProps_DEFAULT []*EdgeProp + +func (p *TraverseSpec) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var TraverseSpec_Expressions_DEFAULT []*Expr + +func (p *TraverseSpec) GetExpressions() []*Expr { + return p.Expressions +} +var TraverseSpec_OrderBy_DEFAULT []*OrderBy + +func (p *TraverseSpec) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var TraverseSpec_Random_DEFAULT bool +func (p *TraverseSpec) GetRandom() bool { + if !p.IsSetRandom() { + return TraverseSpec_Random_DEFAULT + } +return *p.Random +} +var TraverseSpec_Limit_DEFAULT int64 +func (p *TraverseSpec) GetLimit() int64 { + if !p.IsSetLimit() { + return TraverseSpec_Limit_DEFAULT + } +return *p.Limit +} +var TraverseSpec_Filter_DEFAULT []byte + +func (p *TraverseSpec) GetFilter() []byte { + return p.Filter +} +func (p *TraverseSpec) IsSetStatProps() bool { + return p != nil && p.StatProps != nil +} + +func (p *TraverseSpec) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *TraverseSpec) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *TraverseSpec) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *TraverseSpec) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *TraverseSpec) IsSetRandom() bool { + return p != nil && p.Random != nil +} + +func (p *TraverseSpec) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *TraverseSpec) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *TraverseSpec) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *TraverseSpec) ReadField1(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 _elem5 nebula0.EdgeType + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.EdgeType(v) + _elem5 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeDirection(v) + p.EdgeDirection = temp +} + return nil +} + +func (p *TraverseSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *TraverseSpec) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*StatProp, 0, size) + p.StatProps = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewStatProp() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.StatProps = append(p.StatProps, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem7 := NewVertexProp() + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.VertexProps = append(p.VertexProps, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField6(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem8 := NewEdgeProp() + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + p.EdgeProps = append(p.EdgeProps, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewExpr() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Expressions = append(p.Expressions, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField8(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem10 := NewOrderBy() + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.OrderBy = append(p.OrderBy, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Random = &v +} + return nil +} + +func (p *TraverseSpec) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *TraverseSpec) ReadField11(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.Filter = 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) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TraverseSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:edge_types: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_direction: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeDirection)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_direction: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dedup: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatProps() { + if err := oprot.WriteFieldBegin("stat_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stat_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StatProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stat_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vertex_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + 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 7:expressions: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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:order_by: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetRandom() { + if err := oprot.WriteFieldBegin("random", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:random: ", p), err) } + if err := oprot.WriteBool(bool(*p.Random)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.random (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:random: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:limit: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) String() string { + if p == nil { + return "" + } + + edgeTypesVal := fmt.Sprintf("%v", p.EdgeTypes) + edgeDirectionVal := fmt.Sprintf("%v", p.EdgeDirection) + dedupVal := fmt.Sprintf("%v", p.Dedup) + statPropsVal := fmt.Sprintf("%v", p.StatProps) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var randomVal string + if p.Random == nil { + randomVal = "" + } else { + randomVal = fmt.Sprintf("%v", *p.Random) + } + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + 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) +} + +// Attributes: +// - SpaceID +// - ColumnNames +// - Parts +// - TraverseSpec +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"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewGetNeighborsRequest() *GetNeighborsRequest { + return &GetNeighborsRequest{ + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *GetNeighborsRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetNeighborsRequest) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetNeighborsRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *GetNeighborsRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return GetNeighborsRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *GetNeighborsRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *GetNeighborsRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + 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 _elem11 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem11 = v +} + p.ColumnNames = append(p.ColumnNames, _elem11) + } + 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.Row, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key12 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key12 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val13 := tSlice + for i := 0; i < size; i ++ { + _elem14 := nebula0.NewRow() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + _val13 = append(_val13, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key12] = _val13 + } + 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) 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 := oprot.WriteFieldStop(); err != nil { + return thrift.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) 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) + } + return fmt.Sprintf("GetNeighborsRequest({SpaceID:%s ColumnNames:%s Parts:%s TraverseSpec:%s})", spaceIDVal, columnNamesVal, partsVal, traverseSpecVal) +} + +// Attributes: +// - Result_ +// - Vertices +type GetNeighborsResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Vertices *nebula0.DataSet `thrift:"vertices,2" 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 +} + +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: +// - Result_ +type ExecResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` +} + +func NewExecResponse() *ExecResponse { + return &ExecResponse{ + Result_: NewResponseCommon(), + } +} + +var ExecResponse_Result__DEFAULT *ResponseCommon +func (p *ExecResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ExecResponse_Result__DEFAULT + } +return p.Result_ +} +func (p *ExecResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ExecResponse) 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 + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 *ExecResponse) 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 *ExecResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResponse"); 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 *ExecResponse) 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 *ExecResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("ExecResponse({Result_:%s})", resultVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - VertexProps +// - EdgeProps +// - Expressions +// - Dedup +// - OrderBy +// - Limit +// - Filter +type GetPropRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.Row `thrift:"parts,2" db:"parts" json:"parts"` + VertexProps []*VertexProp `thrift:"vertex_props,3" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,4" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,5" db:"expressions" json:"expressions,omitempty"` + Dedup bool `thrift:"dedup,6" db:"dedup" json:"dedup"` + OrderBy []*OrderBy `thrift:"order_by,7" db:"order_by" json:"order_by,omitempty"` + Limit *int64 `thrift:"limit,8" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,9" db:"filter" json:"filter,omitempty"` +} + +func NewGetPropRequest() *GetPropRequest { + return &GetPropRequest{} +} + + +func (p *GetPropRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetPropRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetPropRequest_VertexProps_DEFAULT []*VertexProp + +func (p *GetPropRequest) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var GetPropRequest_EdgeProps_DEFAULT []*EdgeProp + +func (p *GetPropRequest) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var GetPropRequest_Expressions_DEFAULT []*Expr + +func (p *GetPropRequest) GetExpressions() []*Expr { + return p.Expressions +} + +func (p *GetPropRequest) GetDedup() bool { + return p.Dedup +} +var GetPropRequest_OrderBy_DEFAULT []*OrderBy + +func (p *GetPropRequest) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var GetPropRequest_Limit_DEFAULT int64 +func (p *GetPropRequest) GetLimit() int64 { + if !p.IsSetLimit() { + return GetPropRequest_Limit_DEFAULT + } +return *p.Limit +} +var GetPropRequest_Filter_DEFAULT []byte + +func (p *GetPropRequest) GetFilter() []byte { + return p.Filter +} +func (p *GetPropRequest) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *GetPropRequest) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *GetPropRequest) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *GetPropRequest) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *GetPropRequest) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *GetPropRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *GetPropRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key15 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key15 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val16 := tSlice + for i := 0; i < size; i ++ { + _elem17 := nebula0.NewRow() + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + _val16 = append(_val16, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem18 := NewVertexProp() + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.VertexProps = append(p.VertexProps, _elem18) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem19 := NewEdgeProp() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + p.EdgeProps = append(p.EdgeProps, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem20 := NewExpr() + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + } + p.Expressions = append(p.Expressions, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *GetPropRequest) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem21 := NewOrderBy() + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + } + p.OrderBy = append(p.OrderBy, _elem21) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *GetPropRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *GetPropRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:edge_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:expressions: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dedup: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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 7:order_by: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:limit: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:filter: ", p), err) } + } + return err +} + +func (p *GetPropRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + dedupVal := fmt.Sprintf("%v", p.Dedup) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + limitVal = fmt.Sprintf("%v", *p.Limit) + } + filterVal := fmt.Sprintf("%v", p.Filter) + return fmt.Sprintf("GetPropRequest({SpaceID:%s Parts:%s VertexProps:%s EdgeProps:%s Expressions:%s Dedup:%s OrderBy:%s Limit:%s Filter:%s})", spaceIDVal, partsVal, vertexPropsVal, edgePropsVal, expressionsVal, dedupVal, orderByVal, limitVal, filterVal) +} + +// Attributes: +// - Result_ +// - Props +type GetPropResponse struct { + Result_ *ResponseCommon `thrift:"result,1" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewGetPropResponse() *GetPropResponse { + return &GetPropResponse{ + Result_: NewResponseCommon(), + } +} + +var GetPropResponse_Result__DEFAULT *ResponseCommon +func (p *GetPropResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetPropResponse_Result__DEFAULT + } +return p.Result_ +} +var GetPropResponse_Props_DEFAULT *nebula0.DataSet +func (p *GetPropResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return GetPropResponse_Props_DEFAULT + } +return p.Props +} +func (p *GetPropResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetPropResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *GetPropResponse) 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 *GetPropResponse) 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 *GetPropResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *GetPropResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropResponse"); 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 *GetPropResponse) 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 *GetPropResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *GetPropResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("GetPropResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - TagID +// - Props +type NewTag_ struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewTag_() *NewTag_ { + return &NewTag_{} +} + + +func (p *NewTag_) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *NewTag_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewTag_) 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 *NewTag_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *NewTag_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + p.Props = tSlice + for i := 0; i < size; i ++ { + _elem22 := nebula0.NewValue() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.Props = append(p.Props, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewTag_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewTag"); 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 *NewTag_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *NewTag_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewTag_) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewTag_({TagID:%s Props:%s})", tagIDVal, propsVal) +} + +// Attributes: +// - Id +// - Tags +type NewVertex_ struct { + Id *nebula0.Value `thrift:"id,1" db:"id" json:"id"` + Tags []*NewTag_ `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewNewVertex_() *NewVertex_ { + return &NewVertex_{} +} + +var NewVertex__Id_DEFAULT *nebula0.Value +func (p *NewVertex_) GetId() *nebula0.Value { + if !p.IsSetId() { + return NewVertex__Id_DEFAULT + } +return p.Id +} + +func (p *NewVertex_) GetTags() []*NewTag_ { + return p.Tags +} +func (p *NewVertex_) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *NewVertex_) 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 *NewVertex_) ReadField1(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *NewVertex_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewTag_, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem23 := NewNewTag_() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Tags = append(p.Tags, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewVertex_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewVertex"); 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 *NewVertex_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *NewVertex_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *NewVertex_) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("NewVertex_({Id:%s Tags:%s})", idVal, tagsVal) +} + +// Attributes: +// - Src +// - EdgeType +// - Ranking +// - Dst +type EdgeKey struct { + Src *nebula0.Value `thrift:"src,1" db:"src" json:"src"` + EdgeType nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type"` + Ranking nebula0.EdgeRanking `thrift:"ranking,3" db:"ranking" json:"ranking"` + Dst *nebula0.Value `thrift:"dst,4" db:"dst" json:"dst"` +} + +func NewEdgeKey() *EdgeKey { + return &EdgeKey{} +} + +var EdgeKey_Src_DEFAULT *nebula0.Value +func (p *EdgeKey) GetSrc() *nebula0.Value { + if !p.IsSetSrc() { + return EdgeKey_Src_DEFAULT + } +return p.Src +} + +func (p *EdgeKey) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeKey) GetRanking() nebula0.EdgeRanking { + return p.Ranking +} +var EdgeKey_Dst_DEFAULT *nebula0.Value +func (p *EdgeKey) GetDst() *nebula0.Value { + if !p.IsSetDst() { + return EdgeKey_Dst_DEFAULT + } +return p.Dst +} +func (p *EdgeKey) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *EdgeKey) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *EdgeKey) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeKey) ReadField1(iprot thrift.Protocol) error { + p.Src = nebula0.NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *EdgeKey) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeKey) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *EdgeKey) ReadField4(iprot thrift.Protocol) error { + p.Dst = nebula0.NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *EdgeKey) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeKey"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeKey) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *EdgeKey) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + return err +} + +func (p *EdgeKey) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ranking: ", p), err) } + return err +} + +func (p *EdgeKey) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dst: ", p), err) } + return err +} + +func (p *EdgeKey) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + rankingVal := fmt.Sprintf("%v", p.Ranking) + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + return fmt.Sprintf("EdgeKey({Src:%s EdgeType:%s Ranking:%s Dst:%s})", srcVal, edgeTypeVal, rankingVal, dstVal) +} + +// Attributes: +// - Key +// - Props +type NewEdge_ struct { + Key *EdgeKey `thrift:"key,1" db:"key" json:"key"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewEdge_() *NewEdge_ { + return &NewEdge_{ + Key: NewEdgeKey(), + } +} + +var NewEdge__Key_DEFAULT *EdgeKey +func (p *NewEdge_) GetKey() *EdgeKey { + if !p.IsSetKey() { + return NewEdge__Key_DEFAULT + } +return p.Key +} + +func (p *NewEdge_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewEdge_) IsSetKey() bool { + return p != nil && p.Key != nil +} + +func (p *NewEdge_) 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 *NewEdge_) ReadField1(iprot thrift.Protocol) error { + p.Key = NewEdgeKey() + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *NewEdge_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Props = append(p.Props, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewEdge_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewEdge"); 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 *NewEdge_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *NewEdge_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewEdge_) String() string { + if p == nil { + return "" + } + + var keyVal string + if p.Key == nil { + keyVal = "" + } else { + keyVal = fmt.Sprintf("%v", p.Key) + } + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewEdge_({Key:%s Props:%s})", keyVal, propsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +type AddVerticesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewAddVerticesRequest() *AddVerticesRequest { + return &AddVerticesRequest{} +} + + +func (p *AddVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddVerticesRequest) GetParts() map[nebula0.PartitionID][]*NewVertex_ { + return p.Parts +} + +func (p *AddVerticesRequest) GetPropNames() map[nebula0.TagID][][]byte { + return p.PropNames +} + +func (p *AddVerticesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *AddVerticesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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][]*NewVertex_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key25 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key25 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewVertex_, 0, size) + _val26 := tSlice + for i := 0; i < size; i ++ { + _elem27 := NewNewVertex_() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + _val26 = append(_val26, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key25] = _val26 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.TagID][][]byte, size) + p.PropNames = tMap + for i := 0; i < size; i ++ { +var _key28 nebula0.TagID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.TagID(v) + _key28 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val29 := tSlice + for i := 0; i < size; i ++ { +var _elem30 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem30 = v +} + _val29 = append(_val29, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PropNames[_key28] = _val29 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddVerticesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PropNames { + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:prop_names: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +type AddEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewAddEdgesRequest() *AddEdgesRequest { + return &AddEdgesRequest{} +} + + +func (p *AddEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddEdgesRequest) GetParts() map[nebula0.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *AddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *AddEdgesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *AddEdgesRequest) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key31 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val32 := tSlice + for i := 0; i < size; i ++ { + _elem33 := NewNewEdge_() + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) + } + _val32 = append(_val32, _elem33) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key31] = _val32 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField3(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.PropNames = tSlice + for i := 0; i < size; i ++ { +var _elem34 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem34 = v +} + p.PropNames = append(p.PropNames, _elem34) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddEdgesRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteVerticesRequest 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"` +} + +func NewDeleteVerticesRequest() *DeleteVerticesRequest { + return &DeleteVerticesRequest{} +} + + +func (p *DeleteVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteVerticesRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { + return p.Parts +} +func (p *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key35 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key35 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + _val36 := tSlice + for i := 0; i < size; i ++ { + _elem37 := nebula0.NewValue() + if err := _elem37.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + _val36 = append(_val36, _elem37) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key35] = _val36 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteVerticesRequest"); 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("DeleteVerticesRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type DeleteEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*EdgeKey `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewDeleteEdgesRequest() *DeleteEdgesRequest { + return &DeleteEdgesRequest{} +} + + +func (p *DeleteEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteEdgesRequest) GetParts() map[nebula0.PartitionID][]*EdgeKey { + return p.Parts +} +func (p *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key38 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key38 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val39 := tSlice + for i := 0; i < size; i ++ { + _elem40 := NewEdgeKey() + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + _val39 = append(_val39, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key38] = _val39 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteEdgesRequest"); 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("DeleteEdgesRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - Result_ +// - Props +type UpdateResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewUpdateResponse() *UpdateResponse { + return &UpdateResponse{ + Result_: NewResponseCommon(), + } +} + +var UpdateResponse_Result__DEFAULT *ResponseCommon +func (p *UpdateResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return UpdateResponse_Result__DEFAULT + } +return p.Result_ +} +var UpdateResponse_Props_DEFAULT *nebula0.DataSet +func (p *UpdateResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return UpdateResponse_Props_DEFAULT + } +return p.Props +} +func (p *UpdateResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *UpdateResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *UpdateResponse) 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 *UpdateResponse) 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 *UpdateResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *UpdateResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateResponse"); 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 *UpdateResponse) 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 *UpdateResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("UpdateResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - Name +// - Value +type UpdatedProp struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewUpdatedProp() *UpdatedProp { + return &UpdatedProp{} +} + + +func (p *UpdatedProp) GetName() []byte { + return p.Name +} + +func (p *UpdatedProp) GetValue() []byte { + return p.Value +} +func (p *UpdatedProp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetValue 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *UpdatedProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *UpdatedProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *UpdatedProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdatedProp"); 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 *UpdatedProp) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *UpdatedProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *UpdatedProp) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("UpdatedProp({Name:%s Value:%s})", nameVal, valueVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - VertexID +// - TagID +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + VertexID *nebula0.Value `thrift:"vertex_id,3" db:"vertex_id" json:"vertex_id"` + TagID nebula0.TagID `thrift:"tag_id,4,required" db:"tag_id" json:"tag_id"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,5" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,6" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,7" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,8" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateVertexRequest() *UpdateVertexRequest { + return &UpdateVertexRequest{} +} + + +func (p *UpdateVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateVertexRequest_VertexID_DEFAULT *nebula0.Value +func (p *UpdateVertexRequest) GetVertexID() *nebula0.Value { + if !p.IsSetVertexID() { + return UpdateVertexRequest_VertexID_DEFAULT + } +return p.VertexID +} + +func (p *UpdateVertexRequest) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *UpdateVertexRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateVertexRequest_Insertable_DEFAULT bool = false + +func (p *UpdateVertexRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateVertexRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateVertexRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateVertexRequest_Condition_DEFAULT []byte + +func (p *UpdateVertexRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateVertexRequest) IsSetVertexID() bool { + return p != nil && p.VertexID != nil +} + +func (p *UpdateVertexRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateVertexRequest_Insertable_DEFAULT +} + +func (p *UpdateVertexRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateVertexRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateVertexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTagID 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 + } + 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 + } + issetTagID = true + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetTagID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagID is not set")); + } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField3(iprot thrift.Protocol) error { + p.VertexID = nebula0.NewValue() + if err := p.VertexID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexID), err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem41 := NewUpdatedProp() + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField7(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem42 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem42 = v +} + p.ReturnProps = append(p.ReturnProps, _elem42) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_id: ", p), err) } + if err := p.VertexID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tag_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updated_props: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:insertable: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:return_props: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:condition: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var vertexIDVal string + if p.VertexID == nil { + vertexIDVal = "" + } else { + vertexIDVal = fmt.Sprintf("%v", p.VertexID) + } + tagIDVal := fmt.Sprintf("%v", p.TagID) + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + return fmt.Sprintf("UpdateVertexRequest({SpaceID:%s PartID:%s VertexID:%s TagID:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s})", spaceIDVal, partIDVal, vertexIDVal, tagIDVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - EdgeKey +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +type UpdateEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + EdgeKey *EdgeKey `thrift:"edge_key,3" db:"edge_key" json:"edge_key"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,4" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,5" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,6" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,7" db:"condition" json:"condition,omitempty"` +} + +func NewUpdateEdgeRequest() *UpdateEdgeRequest { + return &UpdateEdgeRequest{ + EdgeKey: NewEdgeKey(), + } +} + + +func (p *UpdateEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateEdgeRequest_EdgeKey_DEFAULT *EdgeKey +func (p *UpdateEdgeRequest) GetEdgeKey() *EdgeKey { + if !p.IsSetEdgeKey() { + return UpdateEdgeRequest_EdgeKey_DEFAULT + } +return p.EdgeKey +} + +func (p *UpdateEdgeRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateEdgeRequest_Insertable_DEFAULT bool = false + +func (p *UpdateEdgeRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateEdgeRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateEdgeRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateEdgeRequest_Condition_DEFAULT []byte + +func (p *UpdateEdgeRequest) GetCondition() []byte { + return p.Condition +} +func (p *UpdateEdgeRequest) IsSetEdgeKey() bool { + return p != nil && p.EdgeKey != nil +} + +func (p *UpdateEdgeRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateEdgeRequest_Insertable_DEFAULT +} + +func (p *UpdateEdgeRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateEdgeRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField3(iprot thrift.Protocol) error { + p.EdgeKey = NewEdgeKey() + if err := p.EdgeKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeKey), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*UpdatedProp, 0, size) + p.UpdatedProps = tSlice + for i := 0; i < size; i ++ { + _elem43 := NewUpdatedProp() + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem43) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField6(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem44 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem44 = v +} + p.ReturnProps = append(p.ReturnProps, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_key", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_key: ", p), err) } + if err := p.EdgeKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_key: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:updated_props: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:insertable: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + 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 6:return_props: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:condition: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var edgeKeyVal string + if p.EdgeKey == nil { + edgeKeyVal = "" + } else { + edgeKeyVal = fmt.Sprintf("%v", p.EdgeKey) + } + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + return fmt.Sprintf("UpdateEdgeRequest({SpaceID:%s PartID:%s EdgeKey:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s})", spaceIDVal, partIDVal, edgeKeyVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Name +type GetUUIDReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Name []byte `thrift:"name,3" db:"name" json:"name"` +} + +func NewGetUUIDReq() *GetUUIDReq { + return &GetUUIDReq{} +} + + +func (p *GetUUIDReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetUUIDReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetUUIDReq) GetName() []byte { + return p.Name +} +func (p *GetUUIDReq) 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 *GetUUIDReq) 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 *GetUUIDReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *GetUUIDReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDReq"); 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 *GetUUIDReq) 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 *GetUUIDReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *GetUUIDReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("GetUUIDReq({SpaceID:%s PartID:%s Name:%s})", spaceIDVal, partIDVal, nameVal) +} + +// Attributes: +// - Result_ +// - Id +type GetUUIDResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Id *nebula0.Value `thrift:"id,2" db:"id" json:"id"` +} + +func NewGetUUIDResp() *GetUUIDResp { + return &GetUUIDResp{ + Result_: NewResponseCommon(), + } +} + +var GetUUIDResp_Result__DEFAULT *ResponseCommon +func (p *GetUUIDResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetUUIDResp_Result__DEFAULT + } +return p.Result_ +} +var GetUUIDResp_Id_DEFAULT *nebula0.Value +func (p *GetUUIDResp) GetId() *nebula0.Value { + if !p.IsSetId() { + return GetUUIDResp_Id_DEFAULT + } +return p.Id +} +func (p *GetUUIDResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetUUIDResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *GetUUIDResp) 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 *GetUUIDResp) 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 *GetUUIDResp) ReadField2(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *GetUUIDResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDResp"); 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 *GetUUIDResp) 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 *GetUUIDResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *GetUUIDResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + return fmt.Sprintf("GetUUIDResp({Result_:%s Id:%s})", resultVal, idVal) +} + +// Attributes: +// - Result_ +// - Data +type LookupIndexResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Data *nebula0.DataSet `thrift:"data,2" db:"data" json:"data,omitempty"` +} + +func NewLookupIndexResp() *LookupIndexResp { + return &LookupIndexResp{ + Result_: NewResponseCommon(), + } +} + +var LookupIndexResp_Result__DEFAULT *ResponseCommon +func (p *LookupIndexResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return LookupIndexResp_Result__DEFAULT + } +return p.Result_ +} +var LookupIndexResp_Data_DEFAULT *nebula0.DataSet +func (p *LookupIndexResp) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return LookupIndexResp_Data_DEFAULT + } +return p.Data +} +func (p *LookupIndexResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *LookupIndexResp) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *LookupIndexResp) 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 *LookupIndexResp) 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 *LookupIndexResp) ReadField2(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *LookupIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexResp"); 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 *LookupIndexResp) 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 *LookupIndexResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + return fmt.Sprintf("LookupIndexResp({Result_:%s Data:%s})", resultVal, dataVal) +} + +// Attributes: +// - ColumnName +// - ScanType +// - BeginValue +// - EndValue +type IndexColumnHint struct { + ColumnName []byte `thrift:"column_name,1" db:"column_name" json:"column_name"` + ScanType ScanType `thrift:"scan_type,2" db:"scan_type" json:"scan_type"` + BeginValue *nebula0.Value `thrift:"begin_value,3" db:"begin_value" json:"begin_value"` + EndValue *nebula0.Value `thrift:"end_value,4" db:"end_value" json:"end_value"` +} + +func NewIndexColumnHint() *IndexColumnHint { + return &IndexColumnHint{} +} + + +func (p *IndexColumnHint) GetColumnName() []byte { + return p.ColumnName +} + +func (p *IndexColumnHint) GetScanType() ScanType { + return p.ScanType +} +var IndexColumnHint_BeginValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetBeginValue() *nebula0.Value { + if !p.IsSetBeginValue() { + return IndexColumnHint_BeginValue_DEFAULT + } +return p.BeginValue +} +var IndexColumnHint_EndValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetEndValue() *nebula0.Value { + if !p.IsSetEndValue() { + return IndexColumnHint_EndValue_DEFAULT + } +return p.EndValue +} +func (p *IndexColumnHint) IsSetBeginValue() bool { + return p != nil && p.BeginValue != nil +} + +func (p *IndexColumnHint) IsSetEndValue() bool { + return p != nil && p.EndValue != nil +} + +func (p *IndexColumnHint) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *IndexColumnHint) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ScanType(v) + p.ScanType = temp +} + return nil +} + +func (p *IndexColumnHint) ReadField3(iprot thrift.Protocol) error { + p.BeginValue = nebula0.NewValue() + if err := p.BeginValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BeginValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField4(iprot thrift.Protocol) error { + p.EndValue = nebula0.NewValue() + if err := p.EndValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndValue), err) + } + return nil +} + +func (p *IndexColumnHint) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexColumnHint"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexColumnHint) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:column_name: ", p), err) } + if err := oprot.WriteBinary(p.ColumnName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.column_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_name: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("scan_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:scan_type: ", p), err) } + if err := oprot.WriteI32(int32(p.ScanType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.scan_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:scan_type: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("begin_value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:begin_value: ", p), err) } + if err := p.BeginValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BeginValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:begin_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:end_value: ", p), err) } + if err := p.EndValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:end_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) String() string { + if p == nil { + return "" + } + + columnNameVal := fmt.Sprintf("%v", p.ColumnName) + scanTypeVal := fmt.Sprintf("%v", p.ScanType) + var beginValueVal string + if p.BeginValue == nil { + beginValueVal = "" + } else { + beginValueVal = fmt.Sprintf("%v", p.BeginValue) + } + var endValueVal string + if p.EndValue == nil { + endValueVal = "" + } else { + endValueVal = fmt.Sprintf("%v", p.EndValue) + } + return fmt.Sprintf("IndexColumnHint({ColumnName:%s ScanType:%s BeginValue:%s EndValue:%s})", columnNameVal, scanTypeVal, beginValueVal, endValueVal) +} + +// Attributes: +// - IndexID +// - Filter +// - ColumnHints +type IndexQueryContext struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + Filter []byte `thrift:"filter,2" db:"filter" json:"filter"` + ColumnHints []*IndexColumnHint `thrift:"column_hints,3" db:"column_hints" json:"column_hints"` +} + +func NewIndexQueryContext() *IndexQueryContext { + return &IndexQueryContext{} +} + + +func (p *IndexQueryContext) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexQueryContext) GetFilter() []byte { + return p.Filter +} + +func (p *IndexQueryContext) GetColumnHints() []*IndexColumnHint { + return p.ColumnHints +} +func (p *IndexQueryContext) 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 *IndexQueryContext) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexQueryContext) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *IndexQueryContext) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexColumnHint, 0, size) + p.ColumnHints = tSlice + for i := 0; i < size; i ++ { + _elem45 := NewIndexColumnHint() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.ColumnHints = append(p.ColumnHints, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexQueryContext) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexQueryContext"); 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 *IndexQueryContext) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:filter: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_hints", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:column_hints: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColumnHints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnHints { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:column_hints: ", p), err) } + return err +} + +func (p *IndexQueryContext) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + filterVal := fmt.Sprintf("%v", p.Filter) + columnHintsVal := fmt.Sprintf("%v", p.ColumnHints) + return fmt.Sprintf("IndexQueryContext({IndexID:%s Filter:%s ColumnHints:%s})", indexIDVal, filterVal, columnHintsVal) +} + +// Attributes: +// - Contexts +// - IsEdge +// - TagOrEdgeID +type IndexSpec struct { + Contexts []*IndexQueryContext `thrift:"contexts,1,required" db:"contexts" json:"contexts"` + IsEdge bool `thrift:"is_edge,2,required" db:"is_edge" json:"is_edge"` + TagOrEdgeID int32 `thrift:"tag_or_edge_id,3,required" db:"tag_or_edge_id" json:"tag_or_edge_id"` +} + +func NewIndexSpec() *IndexSpec { + return &IndexSpec{} +} + + +func (p *IndexSpec) GetContexts() []*IndexQueryContext { + return p.Contexts +} + +func (p *IndexSpec) GetIsEdge() bool { + return p.IsEdge +} + +func (p *IndexSpec) GetTagOrEdgeID() int32 { + return p.TagOrEdgeID +} +func (p *IndexSpec) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetContexts bool = false; + var issetIsEdge bool = false; + var issetTagOrEdgeID 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 + } + issetContexts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetIsEdge = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTagOrEdgeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetContexts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Contexts is not set")); + } + if !issetIsEdge{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsEdge is not set")); + } + if !issetTagOrEdgeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagOrEdgeID is not set")); + } + return nil +} + +func (p *IndexSpec) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexQueryContext, 0, size) + p.Contexts = tSlice + for i := 0; i < size; i ++ { + _elem46 := NewIndexQueryContext() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Contexts = append(p.Contexts, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsEdge = v +} + return nil +} + +func (p *IndexSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagOrEdgeID = v +} + return nil +} + +func (p *IndexSpec) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexSpec"); 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 *IndexSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("contexts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:contexts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Contexts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Contexts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:contexts: ", p), err) } + return err +} + +func (p *IndexSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_edge", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_edge: ", p), err) } + if err := oprot.WriteBool(bool(p.IsEdge)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_edge (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_edge: ", p), err) } + return err +} + +func (p *IndexSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_or_edge_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_or_edge_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagOrEdgeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_or_edge_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_or_edge_id: ", p), err) } + return err +} + +func (p *IndexSpec) String() string { + if p == nil { + return "" + } + + contextsVal := fmt.Sprintf("%v", p.Contexts) + isEdgeVal := fmt.Sprintf("%v", p.IsEdge) + tagOrEdgeIDVal := fmt.Sprintf("%v", p.TagOrEdgeID) + return fmt.Sprintf("IndexSpec({Contexts:%s IsEdge:%s TagOrEdgeID:%s})", contextsVal, isEdgeVal, tagOrEdgeIDVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - ReturnColumns +type LookupIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + ReturnColumns [][]byte `thrift:"return_columns,4" db:"return_columns" json:"return_columns,omitempty"` +} + +func NewLookupIndexRequest() *LookupIndexRequest { + return &LookupIndexRequest{ + Indices: NewIndexSpec(), + } +} + + +func (p *LookupIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupIndexRequest_Indices_DEFAULT *IndexSpec +func (p *LookupIndexRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupIndexRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupIndexRequest_ReturnColumns_DEFAULT [][]byte + +func (p *LookupIndexRequest) GetReturnColumns() [][]byte { + return p.ReturnColumns +} +func (p *LookupIndexRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupIndexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *LookupIndexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem47 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem47 = temp +} + p.Parts = append(p.Parts, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField4(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.ReturnColumns = tSlice + for i := 0; i < size; i ++ { +var _elem48 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem48 = v +} + p.ReturnColumns = append(p.ReturnColumns, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetReturnColumns() { + if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + 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 4:return_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + returnColumnsVal := fmt.Sprintf("%v", p.ReturnColumns) + return fmt.Sprintf("LookupIndexRequest({SpaceID:%s Parts:%s Indices:%s ReturnColumns:%s})", spaceIDVal, partsVal, indicesVal, returnColumnsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - TraverseSpec +type LookupAndTraverseRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` +} + +func NewLookupAndTraverseRequest() *LookupAndTraverseRequest { + return &LookupAndTraverseRequest{ + Indices: NewIndexSpec(), + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *LookupAndTraverseRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupAndTraverseRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupAndTraverseRequest_Indices_DEFAULT *IndexSpec +func (p *LookupAndTraverseRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupAndTraverseRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupAndTraverseRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *LookupAndTraverseRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return LookupAndTraverseRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +func (p *LookupAndTraverseRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupAndTraverseRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *LookupAndTraverseRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem49 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem49 = temp +} + p.Parts = append(p.Parts, _elem49) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupAndTraverseRequest"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + var traverseSpecVal string + if p.TraverseSpec == nil { + traverseSpecVal = "" + } else { + traverseSpecVal = fmt.Sprintf("%v", p.TraverseSpec) + } + return fmt.Sprintf("LookupAndTraverseRequest({SpaceID:%s Parts:%s Indices:%s TraverseSpec:%s})", spaceIDVal, partsVal, indicesVal, traverseSpecVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *VertexProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanVertexRequest() *ScanVertexRequest { + return &ScanVertexRequest{ + ReturnColumns: NewVertexProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanVertexRequest_Cursor_DEFAULT []byte + +func (p *ScanVertexRequest) GetCursor() []byte { + return p.Cursor +} +var ScanVertexRequest_ReturnColumns_DEFAULT *VertexProp +func (p *ScanVertexRequest) GetReturnColumns() *VertexProp { + if !p.IsSetReturnColumns() { + return ScanVertexRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanVertexRequest) GetLimit() int64 { + return p.Limit +} +var ScanVertexRequest_StartTime_DEFAULT int64 +func (p *ScanVertexRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanVertexRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanVertexRequest_EndTime_DEFAULT int64 +func (p *ScanVertexRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanVertexRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanVertexRequest_Filter_DEFAULT []byte + +func (p *ScanVertexRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanVertexRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanVertexRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanVertexRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanVertexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanVertexRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanVertexRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanVertexRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanVertexRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanVertexRequest) 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 *ScanVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanVertexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewVertexProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexRequest) 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 *ScanVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + return fmt.Sprintf("ScanVertexRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal) +} + +// Attributes: +// - Result_ +// - VertexData +// - HasNext +// - NextCursor +type ScanVertexResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + VertexData *nebula0.DataSet `thrift:"vertex_data,2" db:"vertex_data" json:"vertex_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanVertexResponse() *ScanVertexResponse { + return &ScanVertexResponse{ + Result_: NewResponseCommon(), + VertexData: nebula0.NewDataSet(), + } +} + +var ScanVertexResponse_Result__DEFAULT *ResponseCommon +func (p *ScanVertexResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanVertexResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanVertexResponse_VertexData_DEFAULT *nebula0.DataSet +func (p *ScanVertexResponse) GetVertexData() *nebula0.DataSet { + if !p.IsSetVertexData() { + return ScanVertexResponse_VertexData_DEFAULT + } +return p.VertexData +} + +func (p *ScanVertexResponse) GetHasNext() bool { + return p.HasNext +} +var ScanVertexResponse_NextCursor_DEFAULT []byte + +func (p *ScanVertexResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanVertexResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanVertexResponse) IsSetVertexData() bool { + return p != nil && p.VertexData != nil +} + +func (p *ScanVertexResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanVertexResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanVertexResponse) ReadField1(iprot thrift.Protocol) error { + p.Result_ = NewResponseCommon() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField2(iprot thrift.Protocol) error { + p.VertexData = nebula0.NewDataSet() + if err := p.VertexData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexData), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanVertexResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanVertexResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } + if err := p.Result_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertex_data: ", p), err) } + if err := p.VertexData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertex_data: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var vertexDataVal string + if p.VertexData == nil { + vertexDataVal = "" + } else { + vertexDataVal = fmt.Sprintf("%v", p.VertexData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanVertexResponse({Result_:%s VertexData:%s HasNext:%s NextCursor:%s})", resultVal, vertexDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +type ScanEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *EdgeProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` +} + +func NewScanEdgeRequest() *ScanEdgeRequest { + return &ScanEdgeRequest{ + ReturnColumns: NewEdgeProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanEdgeRequest_Cursor_DEFAULT []byte + +func (p *ScanEdgeRequest) GetCursor() []byte { + return p.Cursor +} +var ScanEdgeRequest_ReturnColumns_DEFAULT *EdgeProp +func (p *ScanEdgeRequest) GetReturnColumns() *EdgeProp { + if !p.IsSetReturnColumns() { + return ScanEdgeRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanEdgeRequest) GetLimit() int64 { + return p.Limit +} +var ScanEdgeRequest_StartTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanEdgeRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanEdgeRequest_EndTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanEdgeRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanEdgeRequest_Filter_DEFAULT []byte + +func (p *ScanEdgeRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanEdgeRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanEdgeRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +func (p *ScanEdgeRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanEdgeRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanEdgeRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanEdgeRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanEdgeRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *ScanEdgeRequest) 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 *ScanEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewEdgeProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeRequest) 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 *ScanEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + return fmt.Sprintf("ScanEdgeRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal) +} + +// Attributes: +// - Result_ +// - EdgeData +// - HasNext +// - NextCursor +type ScanEdgeResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + EdgeData *nebula0.DataSet `thrift:"edge_data,2" db:"edge_data" json:"edge_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanEdgeResponse() *ScanEdgeResponse { + return &ScanEdgeResponse{ + Result_: NewResponseCommon(), + EdgeData: nebula0.NewDataSet(), + } +} + +var ScanEdgeResponse_Result__DEFAULT *ResponseCommon +func (p *ScanEdgeResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanEdgeResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanEdgeResponse_EdgeData_DEFAULT *nebula0.DataSet +func (p *ScanEdgeResponse) GetEdgeData() *nebula0.DataSet { + if !p.IsSetEdgeData() { + return ScanEdgeResponse_EdgeData_DEFAULT + } +return p.EdgeData +} + +func (p *ScanEdgeResponse) GetHasNext() bool { + return p.HasNext +} +var ScanEdgeResponse_NextCursor_DEFAULT []byte + +func (p *ScanEdgeResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanEdgeResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanEdgeResponse) IsSetEdgeData() bool { + return p != nil && p.EdgeData != nil +} + +func (p *ScanEdgeResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) ReadField2(iprot thrift.Protocol) error { + p.EdgeData = nebula0.NewDataSet() + if err := p.EdgeData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeData), err) + } + return nil +} + +func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanEdgeResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeResponse"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_data: ", p), err) } + if err := p.EdgeData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_data: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var edgeDataVal string + if p.EdgeData == nil { + edgeDataVal = "" + } else { + edgeDataVal = fmt.Sprintf("%v", p.EdgeData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanEdgeResponse({Result_:%s EdgeData:%s HasNext:%s NextCursor:%s})", resultVal, edgeDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - TaskSpecficParas +type TaskPara struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts,omitempty"` + TaskSpecficParas [][]byte `thrift:"task_specfic_paras,3" db:"task_specfic_paras" json:"task_specfic_paras,omitempty"` +} + +func NewTaskPara() *TaskPara { + return &TaskPara{} +} + + +func (p *TaskPara) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var TaskPara_Parts_DEFAULT []nebula0.PartitionID + +func (p *TaskPara) GetParts() []nebula0.PartitionID { + return p.Parts +} +var TaskPara_TaskSpecficParas_DEFAULT [][]byte + +func (p *TaskPara) GetTaskSpecficParas() [][]byte { + return p.TaskSpecficParas +} +func (p *TaskPara) IsSetParts() bool { + return p != nil && p.Parts != nil +} + +func (p *TaskPara) IsSetTaskSpecficParas() bool { + return p != nil && p.TaskSpecficParas != nil +} + +func (p *TaskPara) 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 *TaskPara) 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 *TaskPara) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem50 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem50 = temp +} + p.Parts = append(p.Parts, _elem50) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) ReadField3(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.TaskSpecficParas = tSlice + for i := 0; i < size; i ++ { +var _elem51 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem51 = v +} + p.TaskSpecficParas = append(p.TaskSpecficParas, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskPara"); 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 *TaskPara) 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 *TaskPara) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetParts() { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + } + return err +} + +func (p *TaskPara) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskSpecficParas() { + if err := oprot.WriteFieldBegin("task_specfic_paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specfic_paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.TaskSpecficParas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskSpecficParas { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_specfic_paras: ", p), err) } + } + return err +} + +func (p *TaskPara) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + taskSpecficParasVal := fmt.Sprintf("%v", p.TaskSpecficParas) + return fmt.Sprintf("TaskPara({SpaceID:%s Parts:%s TaskSpecficParas:%s})", spaceIDVal, partsVal, taskSpecficParasVal) +} + +// Attributes: +// - Cmd +// - JobID +// - TaskID +// - Para +// - Concurrency +type AddAdminTaskRequest struct { + Cmd meta1.AdminCmd `thrift:"cmd,1" db:"cmd" json:"cmd"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Para *TaskPara `thrift:"para,4" db:"para" json:"para"` + Concurrency *int32 `thrift:"concurrency,5" db:"concurrency" json:"concurrency,omitempty"` +} + +func NewAddAdminTaskRequest() *AddAdminTaskRequest { + return &AddAdminTaskRequest{ + Para: NewTaskPara(), + } +} + + +func (p *AddAdminTaskRequest) GetCmd() meta1.AdminCmd { + return p.Cmd +} + +func (p *AddAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *AddAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +var AddAdminTaskRequest_Para_DEFAULT *TaskPara +func (p *AddAdminTaskRequest) GetPara() *TaskPara { + if !p.IsSetPara() { + return AddAdminTaskRequest_Para_DEFAULT + } +return p.Para +} +var AddAdminTaskRequest_Concurrency_DEFAULT int32 +func (p *AddAdminTaskRequest) GetConcurrency() int32 { + if !p.IsSetConcurrency() { + return AddAdminTaskRequest_Concurrency_DEFAULT + } +return *p.Concurrency +} +func (p *AddAdminTaskRequest) IsSetPara() bool { + return p != nil && p.Para != nil +} + +func (p *AddAdminTaskRequest) IsSetConcurrency() bool { + return p != nil && p.Concurrency != nil +} + +func (p *AddAdminTaskRequest) 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 + } + 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 *AddAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := meta1.AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField4(iprot thrift.Protocol) error { + p.Para = NewTaskPara() + if err := p.Para.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Para), err) + } + return nil +} + +func (p *AddAdminTaskRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Concurrency = &v +} + return nil +} + +func (p *AddAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddAdminTaskRequest"); 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 *AddAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("para", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:para: ", p), err) } + if err := p.Para.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Para), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:para: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetConcurrency() { + if err := oprot.WriteFieldBegin("concurrency", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:concurrency: ", p), err) } + if err := oprot.WriteI32(int32(*p.Concurrency)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.concurrency (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:concurrency: ", p), err) } + } + return err +} + +func (p *AddAdminTaskRequest) String() string { + if p == nil { + return "" + } + + cmdVal := fmt.Sprintf("%v", p.Cmd) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var paraVal string + if p.Para == nil { + paraVal = "" + } else { + paraVal = fmt.Sprintf("%v", p.Para) + } + var concurrencyVal string + if p.Concurrency == nil { + concurrencyVal = "" + } else { + concurrencyVal = fmt.Sprintf("%v", *p.Concurrency) + } + return fmt.Sprintf("AddAdminTaskRequest({Cmd:%s JobID:%s TaskID:%s Para:%s Concurrency:%s})", cmdVal, jobIDVal, taskIDVal, paraVal, concurrencyVal) +} + +// Attributes: +// - JobID +// - TaskID +type StopAdminTaskRequest struct { + JobID int32 `thrift:"job_id,1" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,2" db:"task_id" json:"task_id"` +} + +func NewStopAdminTaskRequest() *StopAdminTaskRequest { + return &StopAdminTaskRequest{} +} + + +func (p *StopAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *StopAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +func (p *StopAdminTaskRequest) 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 *StopAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *StopAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *StopAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StopAdminTaskRequest"); 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 *StopAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:task_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) String() string { + if p == nil { + return "" + } + + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + return fmt.Sprintf("StopAdminTaskRequest({JobID:%s TaskID:%s})", jobIDVal, taskIDVal) +} + +// Attributes: +// - Result_ +// - Statis +type AdminExecResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Statis *meta1.StatisItem `thrift:"statis,2" db:"statis" json:"statis,omitempty"` +} + +func NewAdminExecResp() *AdminExecResp { + return &AdminExecResp{ + Result_: NewResponseCommon(), + } +} + +var AdminExecResp_Result__DEFAULT *ResponseCommon +func (p *AdminExecResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return AdminExecResp_Result__DEFAULT + } +return p.Result_ +} +var AdminExecResp_Statis_DEFAULT *meta1.StatisItem +func (p *AdminExecResp) GetStatis() *meta1.StatisItem { + if !p.IsSetStatis() { + return AdminExecResp_Statis_DEFAULT + } +return p.Statis +} +func (p *AdminExecResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminExecResp) IsSetStatis() bool { + return p != nil && p.Statis != nil +} + +func (p *AdminExecResp) 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 *AdminExecResp) 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 *AdminExecResp) ReadField2(iprot thrift.Protocol) error { + p.Statis = meta1.NewStatisItem() + if err := p.Statis.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Statis), err) + } + return nil +} + +func (p *AdminExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminExecResp"); 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 *AdminExecResp) 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 *AdminExecResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetStatis() { + if err := oprot.WriteFieldBegin("statis", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statis: ", p), err) } + if err := p.Statis.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Statis), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statis: ", p), err) } + } + return err +} + +func (p *AdminExecResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var statisVal string + if p.Statis == nil { + statisVal = "" + } else { + statisVal = fmt.Sprintf("%v", p.Statis) + } + return fmt.Sprintf("AdminExecResp({Result_:%s Statis:%s})", resultVal, statisVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - NewLeader_ +type TransLeaderReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + NewLeader_ *nebula0.HostAddr `thrift:"new_leader,3" db:"new_leader" json:"new_leader"` +} + +func NewTransLeaderReq() *TransLeaderReq { + return &TransLeaderReq{ + NewLeader_: nebula0.NewHostAddr(), + } +} + + +func (p *TransLeaderReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *TransLeaderReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var TransLeaderReq_NewLeader__DEFAULT *nebula0.HostAddr +func (p *TransLeaderReq) GetNewLeader_() *nebula0.HostAddr { + if !p.IsSetNewLeader_() { + return TransLeaderReq_NewLeader__DEFAULT + } +return p.NewLeader_ +} +func (p *TransLeaderReq) IsSetNewLeader_() bool { + return p != nil && p.NewLeader_ != nil +} + +func (p *TransLeaderReq) 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 *TransLeaderReq) 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 *TransLeaderReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField3(iprot thrift.Protocol) error { + p.NewLeader_ = nebula0.NewHostAddr() + if err := p.NewLeader_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewLeader_), err) + } + return nil +} + +func (p *TransLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TransLeaderReq"); 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 *TransLeaderReq) 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 *TransLeaderReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_leader: ", p), err) } + if err := p.NewLeader_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewLeader_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_leader: ", p), err) } + return err +} + +func (p *TransLeaderReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var newLeaderVal string + if p.NewLeader_ == nil { + newLeaderVal = "" + } else { + newLeaderVal = fmt.Sprintf("%v", p.NewLeader_) + } + return fmt.Sprintf("TransLeaderReq({SpaceID:%s PartID:%s NewLeader_:%s})", spaceIDVal, partIDVal, newLeaderVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - AsLearner +// - Peers +type AddPartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + AsLearner bool `thrift:"as_learner,3" db:"as_learner" json:"as_learner"` + Peers []*nebula0.HostAddr `thrift:"peers,4" db:"peers" json:"peers"` +} + +func NewAddPartReq() *AddPartReq { + return &AddPartReq{} +} + + +func (p *AddPartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddPartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *AddPartReq) GetAsLearner() bool { + return p.AsLearner +} + +func (p *AddPartReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *AddPartReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddPartReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.AsLearner = v +} + return nil +} + +func (p *AddPartReq) ReadField4(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Peers = append(p.Peers, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddPartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddPartReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("as_learner", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:as_learner: ", p), err) } + if err := oprot.WriteBool(bool(p.AsLearner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.as_learner (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:as_learner: ", p), err) } + return err +} + +func (p *AddPartReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:peers: ", p), err) } + return err +} + +func (p *AddPartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + asLearnerVal := fmt.Sprintf("%v", p.AsLearner) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("AddPartReq({SpaceID:%s PartID:%s AsLearner:%s Peers:%s})", spaceIDVal, partIDVal, asLearnerVal, peersVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Learner +type AddLearnerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Learner *nebula0.HostAddr `thrift:"learner,3" db:"learner" json:"learner"` +} + +func NewAddLearnerReq() *AddLearnerReq { + return &AddLearnerReq{ + Learner: nebula0.NewHostAddr(), + } +} + + +func (p *AddLearnerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddLearnerReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var AddLearnerReq_Learner_DEFAULT *nebula0.HostAddr +func (p *AddLearnerReq) GetLearner() *nebula0.HostAddr { + if !p.IsSetLearner() { + return AddLearnerReq_Learner_DEFAULT + } +return p.Learner +} +func (p *AddLearnerReq) IsSetLearner() bool { + return p != nil && p.Learner != nil +} + +func (p *AddLearnerReq) 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 *AddLearnerReq) 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 *AddLearnerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField3(iprot thrift.Protocol) error { + p.Learner = nebula0.NewHostAddr() + if err := p.Learner.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Learner), err) + } + return nil +} + +func (p *AddLearnerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddLearnerReq"); 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 *AddLearnerReq) 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 *AddLearnerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("learner", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:learner: ", p), err) } + if err := p.Learner.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Learner), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:learner: ", p), err) } + return err +} + +func (p *AddLearnerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var learnerVal string + if p.Learner == nil { + learnerVal = "" + } else { + learnerVal = fmt.Sprintf("%v", p.Learner) + } + return fmt.Sprintf("AddLearnerReq({SpaceID:%s PartID:%s Learner:%s})", spaceIDVal, partIDVal, learnerVal) +} + +// Attributes: +// - SpaceID +// - PartID +type RemovePartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` +} + +func NewRemovePartReq() *RemovePartReq { + return &RemovePartReq{} +} + + +func (p *RemovePartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemovePartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +func (p *RemovePartReq) 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 *RemovePartReq) 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 *RemovePartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *RemovePartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemovePartReq"); 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 *RemovePartReq) 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 *RemovePartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *RemovePartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + return fmt.Sprintf("RemovePartReq({SpaceID:%s PartID:%s})", spaceIDVal, partIDVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peer +// - Add +type MemberChangeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peer *nebula0.HostAddr `thrift:"peer,3" db:"peer" json:"peer"` + Add bool `thrift:"add,4" db:"add" json:"add"` +} + +func NewMemberChangeReq() *MemberChangeReq { + return &MemberChangeReq{ + Peer: nebula0.NewHostAddr(), + } +} + + +func (p *MemberChangeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *MemberChangeReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var MemberChangeReq_Peer_DEFAULT *nebula0.HostAddr +func (p *MemberChangeReq) GetPeer() *nebula0.HostAddr { + if !p.IsSetPeer() { + return MemberChangeReq_Peer_DEFAULT + } +return p.Peer +} + +func (p *MemberChangeReq) GetAdd() bool { + return p.Add +} +func (p *MemberChangeReq) IsSetPeer() bool { + return p != nil && p.Peer != nil +} + +func (p *MemberChangeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField3(iprot thrift.Protocol) error { + p.Peer = nebula0.NewHostAddr() + if err := p.Peer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Peer), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Add = v +} + return nil +} + +func (p *MemberChangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MemberChangeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peer", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peer: ", p), err) } + if err := p.Peer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Peer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peer: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("add", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:add: ", p), err) } + if err := oprot.WriteBool(bool(p.Add)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.add (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:add: ", p), err) } + return err +} + +func (p *MemberChangeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var peerVal string + if p.Peer == nil { + peerVal = "" + } else { + peerVal = fmt.Sprintf("%v", p.Peer) + } + addVal := fmt.Sprintf("%v", p.Add) + return fmt.Sprintf("MemberChangeReq({SpaceID:%s PartID:%s Peer:%s Add:%s})", spaceIDVal, partIDVal, peerVal, addVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Target +type CatchUpDataReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Target *nebula0.HostAddr `thrift:"target,3" db:"target" json:"target"` +} + +func NewCatchUpDataReq() *CatchUpDataReq { + return &CatchUpDataReq{ + Target: nebula0.NewHostAddr(), + } +} + + +func (p *CatchUpDataReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CatchUpDataReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var CatchUpDataReq_Target_DEFAULT *nebula0.HostAddr +func (p *CatchUpDataReq) GetTarget() *nebula0.HostAddr { + if !p.IsSetTarget() { + return CatchUpDataReq_Target_DEFAULT + } +return p.Target +} +func (p *CatchUpDataReq) IsSetTarget() bool { + return p != nil && p.Target != nil +} + +func (p *CatchUpDataReq) 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 *CatchUpDataReq) 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 *CatchUpDataReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField3(iprot thrift.Protocol) error { + p.Target = nebula0.NewHostAddr() + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *CatchUpDataReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CatchUpDataReq"); 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 *CatchUpDataReq) 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 *CatchUpDataReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target: ", p), err) } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target: ", p), err) } + return err +} + +func (p *CatchUpDataReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var targetVal string + if p.Target == nil { + targetVal = "" + } else { + targetVal = fmt.Sprintf("%v", p.Target) + } + return fmt.Sprintf("CatchUpDataReq({SpaceID:%s PartID:%s Target:%s})", spaceIDVal, partIDVal, targetVal) +} + +type GetLeaderReq struct { +} + +func NewGetLeaderReq() *GetLeaderReq { + return &GetLeaderReq{} +} + +func (p *GetLeaderReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetLeaderReq({})") +} + +// Attributes: +// - SpaceID +// - Name +type CreateCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewCreateCPRequest() *CreateCPRequest { + return &CreateCPRequest{} +} + + +func (p *CreateCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateCPRequest) GetName() []byte { + return p.Name +} +func (p *CreateCPRequest) 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 *CreateCPRequest) 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 *CreateCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *CreateCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPRequest"); 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 *CreateCPRequest) 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 *CreateCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *CreateCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("CreateCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Name +type DropCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewDropCPRequest() *DropCPRequest { + return &DropCPRequest{} +} + + +func (p *DropCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropCPRequest) GetName() []byte { + return p.Name +} +func (p *DropCPRequest) 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 *DropCPRequest) 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 *DropCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *DropCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropCPRequest"); 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 *DropCPRequest) 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 *DropCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *DropCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Sign +type BlockingSignRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` +} + +func NewBlockingSignRequest() *BlockingSignRequest { + return &BlockingSignRequest{} +} + + +func (p *BlockingSignRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *BlockingSignRequest) GetSign() EngineSignType { + return p.Sign +} +func (p *BlockingSignRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSign 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 + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetSign = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetSign{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Sign is not set")); + } + return nil +} + +func (p *BlockingSignRequest) 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 *BlockingSignRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EngineSignType(v) + p.Sign = temp +} + return nil +} + +func (p *BlockingSignRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BlockingSignRequest"); 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 *BlockingSignRequest) 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 *BlockingSignRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sign", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sign: ", p), err) } + if err := oprot.WriteI32(int32(p.Sign)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sign (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sign: ", p), err) } + return err +} + +func (p *BlockingSignRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + signVal := fmt.Sprintf("%v", p.Sign) + return fmt.Sprintf("BlockingSignRequest({SpaceID:%s Sign:%s})", spaceIDVal, signVal) +} + +// Attributes: +// - Result_ +// - LeaderParts +type GetLeaderPartsResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + LeaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` +} + +func NewGetLeaderPartsResp() *GetLeaderPartsResp { + return &GetLeaderPartsResp{ + Result_: NewResponseCommon(), + } +} + +var GetLeaderPartsResp_Result__DEFAULT *ResponseCommon +func (p *GetLeaderPartsResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetLeaderPartsResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula0.GraphSpaceID][]nebula0.PartitionID { + return p.LeaderParts +} +func (p *GetLeaderPartsResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetLeaderPartsResp) 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key53 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key53 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val54 := tSlice + for i := 0; i < size; i ++ { +var _elem55 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem55 = temp +} + _val54 = append(_val54, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key53] = _val54 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetLeaderPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderPartsResp"); 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + 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.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader_parts: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + return fmt.Sprintf("GetLeaderPartsResp({Result_:%s LeaderParts:%s})", resultVal, leaderPartsVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peers +type CheckPeersReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peers []*nebula0.HostAddr `thrift:"peers,3" db:"peers" json:"peers"` +} + +func NewCheckPeersReq() *CheckPeersReq { + return &CheckPeersReq{} +} + + +func (p *CheckPeersReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CheckPeersReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *CheckPeersReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *CheckPeersReq) 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 *CheckPeersReq) 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 *CheckPeersReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem56 := nebula0.NewHostAddr() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Peers = append(p.Peers, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckPeersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckPeersReq"); 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 *CheckPeersReq) 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 *CheckPeersReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *CheckPeersReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("CheckPeersReq({SpaceID:%s PartID:%s Peers:%s})", spaceIDVal, partIDVal, peersVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - IndexID +type RebuildIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts"` + IndexID nebula0.IndexID `thrift:"index_id,3" db:"index_id" json:"index_id"` +} + +func NewRebuildIndexRequest() *RebuildIndexRequest { + return &RebuildIndexRequest{} +} + + +func (p *RebuildIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} + +func (p *RebuildIndexRequest) GetIndexID() nebula0.IndexID { + return p.IndexID +} +func (p *RebuildIndexRequest) 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem57 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem57 = temp +} + p.Parts = append(p.Parts, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *RebuildIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexRequest"); 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + indexIDVal := fmt.Sprintf("%v", p.IndexID) + return fmt.Sprintf("RebuildIndexRequest({SpaceID:%s Parts:%s IndexID:%s})", spaceIDVal, partsVal, indexIDVal) +} + +// Attributes: +// - Result_ +// - Info +type CreateCPResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewCreateCPResp() *CreateCPResp { + return &CreateCPResp{ + Result_: NewResponseCommon(), + } +} + +var CreateCPResp_Result__DEFAULT *ResponseCommon +func (p *CreateCPResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return CreateCPResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *CreateCPResp) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *CreateCPResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *CreateCPResp) 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 *CreateCPResp) 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 *CreateCPResp) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem58 := nebula0.NewCheckpointInfo() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Info = append(p.Info, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateCPResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPResp"); 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 *CreateCPResp) 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 *CreateCPResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) } + return err +} + +func (p *CreateCPResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("CreateCPResp({Result_:%s Info:%s})", resultVal, infoVal) +} + +// Attributes: +// - Result_ +// - Dir +type ListClusterInfoResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Result_: NewResponseCommon(), + Dir: nebula0.NewDirInfo(), + } +} + +var ListClusterInfoResp_Result__DEFAULT *ResponseCommon +func (p *ListClusterInfoResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ListClusterInfoResp_Result__DEFAULT + } +return p.Result_ +} +var ListClusterInfoResp_Dir_DEFAULT *nebula0.DirInfo +func (p *ListClusterInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return ListClusterInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *ListClusterInfoResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ListClusterInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("ListClusterInfoResp({Result_:%s Dir:%s})", resultVal, dirVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - SpaceID +// - Parts +// - ReturnPartly +type KVGetRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` + ReturnPartly bool `thrift:"return_partly,3" db:"return_partly" json:"return_partly"` +} + +func NewKVGetRequest() *KVGetRequest { + return &KVGetRequest{} +} + + +func (p *KVGetRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVGetRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} + +func (p *KVGetRequest) GetReturnPartly() bool { + return p.ReturnPartly +} +func (p *KVGetRequest) 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 *KVGetRequest) 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 *KVGetRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key59 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key59 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val60 := 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 +} + _val60 = append(_val60, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key59] = _val60 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReturnPartly = v +} + return nil +} + +func (p *KVGetRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetRequest"); 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 *KVGetRequest) 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 *KVGetRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_partly", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_partly: ", p), err) } + if err := oprot.WriteBool(bool(p.ReturnPartly)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_partly (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_partly: ", p), err) } + return err +} + +func (p *KVGetRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + returnPartlyVal := fmt.Sprintf("%v", p.ReturnPartly) + return fmt.Sprintf("KVGetRequest({SpaceID:%s Parts:%s ReturnPartly:%s})", spaceIDVal, partsVal, returnPartlyVal) +} + +// Attributes: +// - Result_ +// - KeyValues +type KVGetResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + KeyValues map[string][]byte `thrift:"key_values,2" db:"key_values" json:"key_values"` +} + +func NewKVGetResponse() *KVGetResponse { + return &KVGetResponse{ + Result_: NewResponseCommon(), + } +} + +var KVGetResponse_Result__DEFAULT *ResponseCommon +func (p *KVGetResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return KVGetResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *KVGetResponse) GetKeyValues() map[string][]byte { + return p.KeyValues +} +func (p *KVGetResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *KVGetResponse) 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 *KVGetResponse) 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 *KVGetResponse) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.KeyValues = tMap + for i := 0; i < size; i ++ { +var _key62 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key62 = v +} +var _val63 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val63 = v +} + p.KeyValues[_key62] = _val63 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetResponse"); 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 *KVGetResponse) 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 *KVGetResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key_values", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key_values: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.KeyValues)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KeyValues { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key_values: ", p), err) } + return err +} + +func (p *KVGetResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + keyValuesVal := fmt.Sprintf("%v", p.KeyValues) + return fmt.Sprintf("KVGetResponse({Result_:%s KeyValues:%s})", resultVal, keyValuesVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVPutRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.KeyValue `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVPutRequest() *KVPutRequest { + return &KVPutRequest{} +} + + +func (p *KVPutRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVPutRequest) GetParts() map[nebula0.PartitionID][]*nebula0.KeyValue { + return p.Parts +} +func (p *KVPutRequest) 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 *KVPutRequest) 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 *KVPutRequest) 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.KeyValue, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key64 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key64 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + _val65 := tSlice + for i := 0; i < size; i ++ { + _elem66 := nebula0.NewKeyValue() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + _val65 = append(_val65, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key64] = _val65 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVPutRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVPutRequest"); 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 *KVPutRequest) 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 *KVPutRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *KVPutRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVPutRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVRemoveRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVRemoveRequest() *KVRemoveRequest { + return &KVRemoveRequest{} +} + + +func (p *KVRemoveRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVRemoveRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} +func (p *KVRemoveRequest) 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key67 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key67 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val68 := tSlice + for i := 0; i < size; i ++ { +var _elem69 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem69 = v +} + _val68 = append(_val68, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key67] = _val68 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVRemoveRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVRemoveRequest"); 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVRemoveRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVRemoveRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - TxnID +// - SpaceID +// - PartID +// - Position +// - Data +type InternalTxnRequest struct { + TxnID int64 `thrift:"txn_id,1" db:"txn_id" json:"txn_id"` + SpaceID int32 `thrift:"space_id,2" db:"space_id" json:"space_id"` + PartID int32 `thrift:"part_id,3" db:"part_id" json:"part_id"` + Position int32 `thrift:"position,4" db:"position" json:"position"` + Data [][][]byte `thrift:"data,5" db:"data" json:"data"` +} + +func NewInternalTxnRequest() *InternalTxnRequest { + return &InternalTxnRequest{} +} + + +func (p *InternalTxnRequest) GetTxnID() int64 { + return p.TxnID +} + +func (p *InternalTxnRequest) GetSpaceID() int32 { + return p.SpaceID +} + +func (p *InternalTxnRequest) GetPartID() int32 { + return p.PartID +} + +func (p *InternalTxnRequest) GetPosition() int32 { + return p.Position +} + +func (p *InternalTxnRequest) GetData() [][][]byte { + return p.Data +} +func (p *InternalTxnRequest) 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 + } + 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 *InternalTxnRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TxnID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.SpaceID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.PartID = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Position = v +} + return nil +} + +func (p *InternalTxnRequest) ReadField5(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.Data = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _elem70 := tSlice + for i := 0; i < size; i ++ { +var _elem71 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem71 = v +} + _elem70 = append(_elem70, _elem71) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Data = append(p.Data, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *InternalTxnRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("InternalTxnRequest"); 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 *InternalTxnRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("txn_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:txn_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TxnID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.txn_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:txn_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("position", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:position: ", p), err) } + if err := oprot.WriteI32(int32(p.Position)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.position (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:position: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.LIST, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:data: ", p), err) } + return err +} + +func (p *InternalTxnRequest) String() string { + if p == nil { + return "" + } + + txnIDVal := fmt.Sprintf("%v", p.TxnID) + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + positionVal := fmt.Sprintf("%v", p.Position) + dataVal := fmt.Sprintf("%v", p.Data) + return fmt.Sprintf("InternalTxnRequest({TxnID:%s SpaceID:%s PartID:%s Position:%s Data:%s})", txnIDVal, spaceIDVal, partIDVal, positionVal, dataVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Key +type GetValueRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Key []byte `thrift:"key,3" db:"key" json:"key"` +} + +func NewGetValueRequest() *GetValueRequest { + return &GetValueRequest{} +} + + +func (p *GetValueRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetValueRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetValueRequest) GetKey() []byte { + return p.Key +} +func (p *GetValueRequest) 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 *GetValueRequest) 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 *GetValueRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetValueRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *GetValueRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueRequest"); 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 *GetValueRequest) 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 *GetValueRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetValueRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:key: ", p), err) } + return err +} + +func (p *GetValueRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("GetValueRequest({SpaceID:%s PartID:%s Key:%s})", spaceIDVal, partIDVal, keyVal) +} + +// Attributes: +// - Result_ +// - Value +type GetValueResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewGetValueResponse() *GetValueResponse { + return &GetValueResponse{ + Result_: NewResponseCommon(), + } +} + +var GetValueResponse_Result__DEFAULT *ResponseCommon +func (p *GetValueResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetValueResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetValueResponse) GetValue() []byte { + return p.Value +} +func (p *GetValueResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetValueResponse) 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 *GetValueResponse) 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 *GetValueResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *GetValueResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetValueResponse"); 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 *GetValueResponse) 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 *GetValueResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *GetValueResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("GetValueResponse({Result_:%s Value:%s})", resultVal, valueVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_5_1/ttypes.go b/ccore/nebula/internal/thrift/v2_5_1/ttypes.go new file mode 100644 index 0000000..1c2e221 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_5_1/ttypes.go @@ -0,0 +1,4579 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var GoUnusedProtection__ int; + +type NullType int64 +const ( + NullType___NULL__ NullType = 0 + NullType_NaN NullType = 1 + NullType_BAD_DATA NullType = 2 + NullType_BAD_TYPE NullType = 3 + NullType_ERR_OVERFLOW NullType = 4 + NullType_UNKNOWN_PROP NullType = 5 + NullType_DIV_BY_ZERO NullType = 6 + NullType_OUT_OF_RANGE NullType = 7 +) + +var NullTypeToName = map[NullType]string { + NullType___NULL__: "__NULL__", + NullType_NaN: "NaN", + NullType_BAD_DATA: "BAD_DATA", + NullType_BAD_TYPE: "BAD_TYPE", + NullType_ERR_OVERFLOW: "ERR_OVERFLOW", + NullType_UNKNOWN_PROP: "UNKNOWN_PROP", + NullType_DIV_BY_ZERO: "DIV_BY_ZERO", + NullType_OUT_OF_RANGE: "OUT_OF_RANGE", +} + +var NullTypeToValue = map[string]NullType { + "__NULL__": NullType___NULL__, + "NaN": NullType_NaN, + "BAD_DATA": NullType_BAD_DATA, + "BAD_TYPE": NullType_BAD_TYPE, + "ERR_OVERFLOW": NullType_ERR_OVERFLOW, + "UNKNOWN_PROP": NullType_UNKNOWN_PROP, + "DIV_BY_ZERO": NullType_DIV_BY_ZERO, + "OUT_OF_RANGE": NullType_OUT_OF_RANGE, +} + +var NullTypeNames = []string { + "__NULL__", + "NaN", + "BAD_DATA", + "BAD_TYPE", + "ERR_OVERFLOW", + "UNKNOWN_PROP", + "DIV_BY_ZERO", + "OUT_OF_RANGE", +} + +var NullTypeValues = []NullType { + NullType___NULL__, + NullType_NaN, + NullType_BAD_DATA, + NullType_BAD_TYPE, + NullType_ERR_OVERFLOW, + NullType_UNKNOWN_PROP, + NullType_DIV_BY_ZERO, + NullType_OUT_OF_RANGE, +} + +func (p NullType) String() string { + if v, ok := NullTypeToName[p]; ok { + return v + } + return "" +} + +func NullTypeFromString(s string) (NullType, error) { + if v, ok := NullTypeToValue[s]; ok { + return v, nil + } + return NullType(0), fmt.Errorf("not a valid NullType string") +} + +func NullTypePtr(v NullType) *NullType { return &v } + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -4 + ErrorCode_E_SPACE_NOT_FOUND ErrorCode = -5 + ErrorCode_E_TAG_NOT_FOUND ErrorCode = -6 + ErrorCode_E_EDGE_NOT_FOUND ErrorCode = -7 + ErrorCode_E_INDEX_NOT_FOUND ErrorCode = -8 + ErrorCode_E_EDGE_PROP_NOT_FOUND ErrorCode = -9 + ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -10 + ErrorCode_E_ROLE_NOT_FOUND ErrorCode = -11 + ErrorCode_E_CONFIG_NOT_FOUND ErrorCode = -12 + ErrorCode_E_GROUP_NOT_FOUND ErrorCode = -13 + ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 + ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 + ErrorCode_E_BACKUP_FAILED ErrorCode = -24 + ErrorCode_E_BACKUP_EMPTY_TABLE ErrorCode = -25 + ErrorCode_E_BACKUP_TABLE_FAILED ErrorCode = -26 + ErrorCode_E_PARTIAL_RESULT ErrorCode = -27 + ErrorCode_E_REBUILD_INDEX_FAILED ErrorCode = -28 + ErrorCode_E_INVALID_PASSWORD ErrorCode = -29 + ErrorCode_E_FAILED_GET_ABS_PATH ErrorCode = -30 + ErrorCode_E_BAD_USERNAME_PASSWORD ErrorCode = -1001 + ErrorCode_E_SESSION_INVALID ErrorCode = -1002 + ErrorCode_E_SESSION_TIMEOUT ErrorCode = -1003 + ErrorCode_E_SYNTAX_ERROR ErrorCode = -1004 + ErrorCode_E_EXECUTION_ERROR ErrorCode = -1005 + ErrorCode_E_STATEMENT_EMPTY ErrorCode = -1006 + ErrorCode_E_BAD_PERMISSION ErrorCode = -1008 + ErrorCode_E_SEMANTIC_ERROR ErrorCode = -1009 + ErrorCode_E_TOO_MANY_CONNECTIONS ErrorCode = -1010 + ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = -1011 + ErrorCode_E_NO_HOSTS ErrorCode = -2001 + ErrorCode_E_EXISTED ErrorCode = -2002 + ErrorCode_E_INVALID_HOST ErrorCode = -2003 + ErrorCode_E_UNSUPPORTED ErrorCode = -2004 + ErrorCode_E_NOT_DROP ErrorCode = -2005 + ErrorCode_E_BALANCER_RUNNING ErrorCode = -2006 + ErrorCode_E_CONFIG_IMMUTABLE ErrorCode = -2007 + ErrorCode_E_CONFLICT ErrorCode = -2008 + ErrorCode_E_INVALID_PARM ErrorCode = -2009 + ErrorCode_E_WRONGCLUSTER ErrorCode = -2010 + ErrorCode_E_STORE_FAILURE ErrorCode = -2021 + ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 + ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 + ErrorCode_E_BALANCED ErrorCode = -2024 + ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -2025 + ErrorCode_E_NO_VALID_HOST ErrorCode = -2026 + ErrorCode_E_CORRUPTTED_BALANCE_PLAN ErrorCode = -2027 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -2028 + ErrorCode_E_IMPROPER_ROLE ErrorCode = -2030 + ErrorCode_E_INVALID_PARTITION_NUM ErrorCode = -2031 + ErrorCode_E_INVALID_REPLICA_FACTOR ErrorCode = -2032 + ErrorCode_E_INVALID_CHARSET ErrorCode = -2033 + ErrorCode_E_INVALID_COLLATE ErrorCode = -2034 + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH ErrorCode = -2035 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -2040 + ErrorCode_E_BLOCK_WRITE_FAILURE ErrorCode = -2041 + ErrorCode_E_REBUILD_INDEX_FAILURE ErrorCode = -2042 + ErrorCode_E_INDEX_WITH_TTL ErrorCode = -2043 + ErrorCode_E_ADD_JOB_FAILURE ErrorCode = -2044 + ErrorCode_E_STOP_JOB_FAILURE ErrorCode = -2045 + ErrorCode_E_SAVE_JOB_FAILURE ErrorCode = -2046 + ErrorCode_E_BALANCER_FAILURE ErrorCode = -2047 + ErrorCode_E_JOB_NOT_FINISHED ErrorCode = -2048 + ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -2049 + ErrorCode_E_INVALID_JOB ErrorCode = -2065 + ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 + ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 + ErrorCode_E_RESTORE_FAILURE ErrorCode = -2068 + ErrorCode_E_SESSION_NOT_FOUND ErrorCode = -2069 + ErrorCode_E_LIST_CLUSTER_FAILURE ErrorCode = -2070 + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE ErrorCode = -2071 + ErrorCode_E_GET_META_DIR_FAILURE ErrorCode = -2072 + ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 + ErrorCode_E_CONSENSUS_ERROR ErrorCode = -3001 + ErrorCode_E_KEY_HAS_EXISTS ErrorCode = -3002 + ErrorCode_E_DATA_TYPE_MISMATCH ErrorCode = -3003 + ErrorCode_E_INVALID_FIELD_VALUE ErrorCode = -3004 + ErrorCode_E_INVALID_OPERATION ErrorCode = -3005 + ErrorCode_E_NOT_NULLABLE ErrorCode = -3006 + ErrorCode_E_FIELD_UNSET ErrorCode = -3007 + ErrorCode_E_OUT_OF_RANGE ErrorCode = -3008 + ErrorCode_E_ATOMIC_OP_FAILED ErrorCode = -3009 + ErrorCode_E_DATA_CONFLICT_ERROR ErrorCode = -3010 + ErrorCode_E_WRITE_STALLED ErrorCode = -3011 + ErrorCode_E_IMPROPER_DATA_TYPE ErrorCode = -3021 + ErrorCode_E_INVALID_SPACEVIDLEN ErrorCode = -3022 + ErrorCode_E_INVALID_FILTER ErrorCode = -3031 + ErrorCode_E_INVALID_UPDATER ErrorCode = -3032 + ErrorCode_E_INVALID_STORE ErrorCode = -3033 + ErrorCode_E_INVALID_PEER ErrorCode = -3034 + ErrorCode_E_RETRY_EXHAUSTED ErrorCode = -3035 + ErrorCode_E_TRANSFER_LEADER_FAILED ErrorCode = -3036 + ErrorCode_E_INVALID_STAT_TYPE ErrorCode = -3037 + ErrorCode_E_INVALID_VID ErrorCode = -3038 + ErrorCode_E_NO_TRANSFORMED ErrorCode = -3039 + ErrorCode_E_LOAD_META_FAILED ErrorCode = -3040 + ErrorCode_E_FAILED_TO_CHECKPOINT ErrorCode = -3041 + ErrorCode_E_CHECKPOINT_BLOCKED ErrorCode = -3042 + ErrorCode_E_FILTER_OUT ErrorCode = -3043 + ErrorCode_E_INVALID_DATA ErrorCode = -3044 + ErrorCode_E_MUTATE_EDGE_CONFLICT ErrorCode = -3045 + ErrorCode_E_MUTATE_TAG_CONFLICT ErrorCode = -3046 + ErrorCode_E_OUTDATED_LOCK ErrorCode = -3047 + ErrorCode_E_INVALID_TASK_PARA ErrorCode = -3051 + ErrorCode_E_USER_CANCEL ErrorCode = -3052 + ErrorCode_E_TASK_EXECUTION_FAILED ErrorCode = -3053 + ErrorCode_E_UNKNOWN ErrorCode = -8000 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAIL_TO_CONNECT: "E_FAIL_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_LEADER_CHANGED: "E_LEADER_CHANGED", + ErrorCode_E_SPACE_NOT_FOUND: "E_SPACE_NOT_FOUND", + ErrorCode_E_TAG_NOT_FOUND: "E_TAG_NOT_FOUND", + ErrorCode_E_EDGE_NOT_FOUND: "E_EDGE_NOT_FOUND", + ErrorCode_E_INDEX_NOT_FOUND: "E_INDEX_NOT_FOUND", + ErrorCode_E_EDGE_PROP_NOT_FOUND: "E_EDGE_PROP_NOT_FOUND", + ErrorCode_E_TAG_PROP_NOT_FOUND: "E_TAG_PROP_NOT_FOUND", + ErrorCode_E_ROLE_NOT_FOUND: "E_ROLE_NOT_FOUND", + ErrorCode_E_CONFIG_NOT_FOUND: "E_CONFIG_NOT_FOUND", + ErrorCode_E_GROUP_NOT_FOUND: "E_GROUP_NOT_FOUND", + ErrorCode_E_ZONE_NOT_FOUND: "E_ZONE_NOT_FOUND", + ErrorCode_E_LISTENER_NOT_FOUND: "E_LISTENER_NOT_FOUND", + ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", + ErrorCode_E_KEY_NOT_FOUND: "E_KEY_NOT_FOUND", + ErrorCode_E_USER_NOT_FOUND: "E_USER_NOT_FOUND", + ErrorCode_E_BACKUP_FAILED: "E_BACKUP_FAILED", + ErrorCode_E_BACKUP_EMPTY_TABLE: "E_BACKUP_EMPTY_TABLE", + ErrorCode_E_BACKUP_TABLE_FAILED: "E_BACKUP_TABLE_FAILED", + ErrorCode_E_PARTIAL_RESULT: "E_PARTIAL_RESULT", + ErrorCode_E_REBUILD_INDEX_FAILED: "E_REBUILD_INDEX_FAILED", + ErrorCode_E_INVALID_PASSWORD: "E_INVALID_PASSWORD", + ErrorCode_E_FAILED_GET_ABS_PATH: "E_FAILED_GET_ABS_PATH", + ErrorCode_E_BAD_USERNAME_PASSWORD: "E_BAD_USERNAME_PASSWORD", + ErrorCode_E_SESSION_INVALID: "E_SESSION_INVALID", + ErrorCode_E_SESSION_TIMEOUT: "E_SESSION_TIMEOUT", + ErrorCode_E_SYNTAX_ERROR: "E_SYNTAX_ERROR", + ErrorCode_E_EXECUTION_ERROR: "E_EXECUTION_ERROR", + ErrorCode_E_STATEMENT_EMPTY: "E_STATEMENT_EMPTY", + ErrorCode_E_BAD_PERMISSION: "E_BAD_PERMISSION", + ErrorCode_E_SEMANTIC_ERROR: "E_SEMANTIC_ERROR", + ErrorCode_E_TOO_MANY_CONNECTIONS: "E_TOO_MANY_CONNECTIONS", + ErrorCode_E_PARTIAL_SUCCEEDED: "E_PARTIAL_SUCCEEDED", + ErrorCode_E_NO_HOSTS: "E_NO_HOSTS", + ErrorCode_E_EXISTED: "E_EXISTED", + ErrorCode_E_INVALID_HOST: "E_INVALID_HOST", + ErrorCode_E_UNSUPPORTED: "E_UNSUPPORTED", + ErrorCode_E_NOT_DROP: "E_NOT_DROP", + ErrorCode_E_BALANCER_RUNNING: "E_BALANCER_RUNNING", + ErrorCode_E_CONFIG_IMMUTABLE: "E_CONFIG_IMMUTABLE", + ErrorCode_E_CONFLICT: "E_CONFLICT", + ErrorCode_E_INVALID_PARM: "E_INVALID_PARM", + ErrorCode_E_WRONGCLUSTER: "E_WRONGCLUSTER", + 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", + ErrorCode_E_BALANCED: "E_BALANCED", + ErrorCode_E_NO_RUNNING_BALANCE_PLAN: "E_NO_RUNNING_BALANCE_PLAN", + ErrorCode_E_NO_VALID_HOST: "E_NO_VALID_HOST", + ErrorCode_E_CORRUPTTED_BALANCE_PLAN: "E_CORRUPTTED_BALANCE_PLAN", + ErrorCode_E_NO_INVALID_BALANCE_PLAN: "E_NO_INVALID_BALANCE_PLAN", + ErrorCode_E_IMPROPER_ROLE: "E_IMPROPER_ROLE", + ErrorCode_E_INVALID_PARTITION_NUM: "E_INVALID_PARTITION_NUM", + ErrorCode_E_INVALID_REPLICA_FACTOR: "E_INVALID_REPLICA_FACTOR", + ErrorCode_E_INVALID_CHARSET: "E_INVALID_CHARSET", + ErrorCode_E_INVALID_COLLATE: "E_INVALID_COLLATE", + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH: "E_CHARSET_COLLATE_NOT_MATCH", + ErrorCode_E_SNAPSHOT_FAILURE: "E_SNAPSHOT_FAILURE", + ErrorCode_E_BLOCK_WRITE_FAILURE: "E_BLOCK_WRITE_FAILURE", + ErrorCode_E_REBUILD_INDEX_FAILURE: "E_REBUILD_INDEX_FAILURE", + ErrorCode_E_INDEX_WITH_TTL: "E_INDEX_WITH_TTL", + ErrorCode_E_ADD_JOB_FAILURE: "E_ADD_JOB_FAILURE", + ErrorCode_E_STOP_JOB_FAILURE: "E_STOP_JOB_FAILURE", + ErrorCode_E_SAVE_JOB_FAILURE: "E_SAVE_JOB_FAILURE", + ErrorCode_E_BALANCER_FAILURE: "E_BALANCER_FAILURE", + ErrorCode_E_JOB_NOT_FINISHED: "E_JOB_NOT_FINISHED", + ErrorCode_E_TASK_REPORT_OUT_DATE: "E_TASK_REPORT_OUT_DATE", + 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", + ErrorCode_E_RESTORE_FAILURE: "E_RESTORE_FAILURE", + ErrorCode_E_SESSION_NOT_FOUND: "E_SESSION_NOT_FOUND", + ErrorCode_E_LIST_CLUSTER_FAILURE: "E_LIST_CLUSTER_FAILURE", + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE: "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + ErrorCode_E_GET_META_DIR_FAILURE: "E_GET_META_DIR_FAILURE", + ErrorCode_E_QUERY_NOT_FOUND: "E_QUERY_NOT_FOUND", + ErrorCode_E_CONSENSUS_ERROR: "E_CONSENSUS_ERROR", + ErrorCode_E_KEY_HAS_EXISTS: "E_KEY_HAS_EXISTS", + ErrorCode_E_DATA_TYPE_MISMATCH: "E_DATA_TYPE_MISMATCH", + ErrorCode_E_INVALID_FIELD_VALUE: "E_INVALID_FIELD_VALUE", + ErrorCode_E_INVALID_OPERATION: "E_INVALID_OPERATION", + ErrorCode_E_NOT_NULLABLE: "E_NOT_NULLABLE", + ErrorCode_E_FIELD_UNSET: "E_FIELD_UNSET", + ErrorCode_E_OUT_OF_RANGE: "E_OUT_OF_RANGE", + ErrorCode_E_ATOMIC_OP_FAILED: "E_ATOMIC_OP_FAILED", + ErrorCode_E_DATA_CONFLICT_ERROR: "E_DATA_CONFLICT_ERROR", + ErrorCode_E_WRITE_STALLED: "E_WRITE_STALLED", + ErrorCode_E_IMPROPER_DATA_TYPE: "E_IMPROPER_DATA_TYPE", + ErrorCode_E_INVALID_SPACEVIDLEN: "E_INVALID_SPACEVIDLEN", + ErrorCode_E_INVALID_FILTER: "E_INVALID_FILTER", + ErrorCode_E_INVALID_UPDATER: "E_INVALID_UPDATER", + ErrorCode_E_INVALID_STORE: "E_INVALID_STORE", + ErrorCode_E_INVALID_PEER: "E_INVALID_PEER", + ErrorCode_E_RETRY_EXHAUSTED: "E_RETRY_EXHAUSTED", + ErrorCode_E_TRANSFER_LEADER_FAILED: "E_TRANSFER_LEADER_FAILED", + ErrorCode_E_INVALID_STAT_TYPE: "E_INVALID_STAT_TYPE", + ErrorCode_E_INVALID_VID: "E_INVALID_VID", + ErrorCode_E_NO_TRANSFORMED: "E_NO_TRANSFORMED", + ErrorCode_E_LOAD_META_FAILED: "E_LOAD_META_FAILED", + ErrorCode_E_FAILED_TO_CHECKPOINT: "E_FAILED_TO_CHECKPOINT", + ErrorCode_E_CHECKPOINT_BLOCKED: "E_CHECKPOINT_BLOCKED", + ErrorCode_E_FILTER_OUT: "E_FILTER_OUT", + ErrorCode_E_INVALID_DATA: "E_INVALID_DATA", + ErrorCode_E_MUTATE_EDGE_CONFLICT: "E_MUTATE_EDGE_CONFLICT", + ErrorCode_E_MUTATE_TAG_CONFLICT: "E_MUTATE_TAG_CONFLICT", + ErrorCode_E_OUTDATED_LOCK: "E_OUTDATED_LOCK", + ErrorCode_E_INVALID_TASK_PARA: "E_INVALID_TASK_PARA", + ErrorCode_E_USER_CANCEL: "E_USER_CANCEL", + ErrorCode_E_TASK_EXECUTION_FAILED: "E_TASK_EXECUTION_FAILED", + ErrorCode_E_UNKNOWN: "E_UNKNOWN", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAIL_TO_CONNECT": ErrorCode_E_FAIL_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_LEADER_CHANGED": ErrorCode_E_LEADER_CHANGED, + "E_SPACE_NOT_FOUND": ErrorCode_E_SPACE_NOT_FOUND, + "E_TAG_NOT_FOUND": ErrorCode_E_TAG_NOT_FOUND, + "E_EDGE_NOT_FOUND": ErrorCode_E_EDGE_NOT_FOUND, + "E_INDEX_NOT_FOUND": ErrorCode_E_INDEX_NOT_FOUND, + "E_EDGE_PROP_NOT_FOUND": ErrorCode_E_EDGE_PROP_NOT_FOUND, + "E_TAG_PROP_NOT_FOUND": ErrorCode_E_TAG_PROP_NOT_FOUND, + "E_ROLE_NOT_FOUND": ErrorCode_E_ROLE_NOT_FOUND, + "E_CONFIG_NOT_FOUND": ErrorCode_E_CONFIG_NOT_FOUND, + "E_GROUP_NOT_FOUND": ErrorCode_E_GROUP_NOT_FOUND, + "E_ZONE_NOT_FOUND": ErrorCode_E_ZONE_NOT_FOUND, + "E_LISTENER_NOT_FOUND": ErrorCode_E_LISTENER_NOT_FOUND, + "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, + "E_KEY_NOT_FOUND": ErrorCode_E_KEY_NOT_FOUND, + "E_USER_NOT_FOUND": ErrorCode_E_USER_NOT_FOUND, + "E_BACKUP_FAILED": ErrorCode_E_BACKUP_FAILED, + "E_BACKUP_EMPTY_TABLE": ErrorCode_E_BACKUP_EMPTY_TABLE, + "E_BACKUP_TABLE_FAILED": ErrorCode_E_BACKUP_TABLE_FAILED, + "E_PARTIAL_RESULT": ErrorCode_E_PARTIAL_RESULT, + "E_REBUILD_INDEX_FAILED": ErrorCode_E_REBUILD_INDEX_FAILED, + "E_INVALID_PASSWORD": ErrorCode_E_INVALID_PASSWORD, + "E_FAILED_GET_ABS_PATH": ErrorCode_E_FAILED_GET_ABS_PATH, + "E_BAD_USERNAME_PASSWORD": ErrorCode_E_BAD_USERNAME_PASSWORD, + "E_SESSION_INVALID": ErrorCode_E_SESSION_INVALID, + "E_SESSION_TIMEOUT": ErrorCode_E_SESSION_TIMEOUT, + "E_SYNTAX_ERROR": ErrorCode_E_SYNTAX_ERROR, + "E_EXECUTION_ERROR": ErrorCode_E_EXECUTION_ERROR, + "E_STATEMENT_EMPTY": ErrorCode_E_STATEMENT_EMPTY, + "E_BAD_PERMISSION": ErrorCode_E_BAD_PERMISSION, + "E_SEMANTIC_ERROR": ErrorCode_E_SEMANTIC_ERROR, + "E_TOO_MANY_CONNECTIONS": ErrorCode_E_TOO_MANY_CONNECTIONS, + "E_PARTIAL_SUCCEEDED": ErrorCode_E_PARTIAL_SUCCEEDED, + "E_NO_HOSTS": ErrorCode_E_NO_HOSTS, + "E_EXISTED": ErrorCode_E_EXISTED, + "E_INVALID_HOST": ErrorCode_E_INVALID_HOST, + "E_UNSUPPORTED": ErrorCode_E_UNSUPPORTED, + "E_NOT_DROP": ErrorCode_E_NOT_DROP, + "E_BALANCER_RUNNING": ErrorCode_E_BALANCER_RUNNING, + "E_CONFIG_IMMUTABLE": ErrorCode_E_CONFIG_IMMUTABLE, + "E_CONFLICT": ErrorCode_E_CONFLICT, + "E_INVALID_PARM": ErrorCode_E_INVALID_PARM, + "E_WRONGCLUSTER": ErrorCode_E_WRONGCLUSTER, + "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, + "E_BALANCED": ErrorCode_E_BALANCED, + "E_NO_RUNNING_BALANCE_PLAN": ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + "E_NO_VALID_HOST": ErrorCode_E_NO_VALID_HOST, + "E_CORRUPTTED_BALANCE_PLAN": ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + "E_NO_INVALID_BALANCE_PLAN": ErrorCode_E_NO_INVALID_BALANCE_PLAN, + "E_IMPROPER_ROLE": ErrorCode_E_IMPROPER_ROLE, + "E_INVALID_PARTITION_NUM": ErrorCode_E_INVALID_PARTITION_NUM, + "E_INVALID_REPLICA_FACTOR": ErrorCode_E_INVALID_REPLICA_FACTOR, + "E_INVALID_CHARSET": ErrorCode_E_INVALID_CHARSET, + "E_INVALID_COLLATE": ErrorCode_E_INVALID_COLLATE, + "E_CHARSET_COLLATE_NOT_MATCH": ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + "E_SNAPSHOT_FAILURE": ErrorCode_E_SNAPSHOT_FAILURE, + "E_BLOCK_WRITE_FAILURE": ErrorCode_E_BLOCK_WRITE_FAILURE, + "E_REBUILD_INDEX_FAILURE": ErrorCode_E_REBUILD_INDEX_FAILURE, + "E_INDEX_WITH_TTL": ErrorCode_E_INDEX_WITH_TTL, + "E_ADD_JOB_FAILURE": ErrorCode_E_ADD_JOB_FAILURE, + "E_STOP_JOB_FAILURE": ErrorCode_E_STOP_JOB_FAILURE, + "E_SAVE_JOB_FAILURE": ErrorCode_E_SAVE_JOB_FAILURE, + "E_BALANCER_FAILURE": ErrorCode_E_BALANCER_FAILURE, + "E_JOB_NOT_FINISHED": ErrorCode_E_JOB_NOT_FINISHED, + "E_TASK_REPORT_OUT_DATE": ErrorCode_E_TASK_REPORT_OUT_DATE, + "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, + "E_RESTORE_FAILURE": ErrorCode_E_RESTORE_FAILURE, + "E_SESSION_NOT_FOUND": ErrorCode_E_SESSION_NOT_FOUND, + "E_LIST_CLUSTER_FAILURE": ErrorCode_E_LIST_CLUSTER_FAILURE, + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE": ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + "E_GET_META_DIR_FAILURE": ErrorCode_E_GET_META_DIR_FAILURE, + "E_QUERY_NOT_FOUND": ErrorCode_E_QUERY_NOT_FOUND, + "E_CONSENSUS_ERROR": ErrorCode_E_CONSENSUS_ERROR, + "E_KEY_HAS_EXISTS": ErrorCode_E_KEY_HAS_EXISTS, + "E_DATA_TYPE_MISMATCH": ErrorCode_E_DATA_TYPE_MISMATCH, + "E_INVALID_FIELD_VALUE": ErrorCode_E_INVALID_FIELD_VALUE, + "E_INVALID_OPERATION": ErrorCode_E_INVALID_OPERATION, + "E_NOT_NULLABLE": ErrorCode_E_NOT_NULLABLE, + "E_FIELD_UNSET": ErrorCode_E_FIELD_UNSET, + "E_OUT_OF_RANGE": ErrorCode_E_OUT_OF_RANGE, + "E_ATOMIC_OP_FAILED": ErrorCode_E_ATOMIC_OP_FAILED, + "E_DATA_CONFLICT_ERROR": ErrorCode_E_DATA_CONFLICT_ERROR, + "E_WRITE_STALLED": ErrorCode_E_WRITE_STALLED, + "E_IMPROPER_DATA_TYPE": ErrorCode_E_IMPROPER_DATA_TYPE, + "E_INVALID_SPACEVIDLEN": ErrorCode_E_INVALID_SPACEVIDLEN, + "E_INVALID_FILTER": ErrorCode_E_INVALID_FILTER, + "E_INVALID_UPDATER": ErrorCode_E_INVALID_UPDATER, + "E_INVALID_STORE": ErrorCode_E_INVALID_STORE, + "E_INVALID_PEER": ErrorCode_E_INVALID_PEER, + "E_RETRY_EXHAUSTED": ErrorCode_E_RETRY_EXHAUSTED, + "E_TRANSFER_LEADER_FAILED": ErrorCode_E_TRANSFER_LEADER_FAILED, + "E_INVALID_STAT_TYPE": ErrorCode_E_INVALID_STAT_TYPE, + "E_INVALID_VID": ErrorCode_E_INVALID_VID, + "E_NO_TRANSFORMED": ErrorCode_E_NO_TRANSFORMED, + "E_LOAD_META_FAILED": ErrorCode_E_LOAD_META_FAILED, + "E_FAILED_TO_CHECKPOINT": ErrorCode_E_FAILED_TO_CHECKPOINT, + "E_CHECKPOINT_BLOCKED": ErrorCode_E_CHECKPOINT_BLOCKED, + "E_FILTER_OUT": ErrorCode_E_FILTER_OUT, + "E_INVALID_DATA": ErrorCode_E_INVALID_DATA, + "E_MUTATE_EDGE_CONFLICT": ErrorCode_E_MUTATE_EDGE_CONFLICT, + "E_MUTATE_TAG_CONFLICT": ErrorCode_E_MUTATE_TAG_CONFLICT, + "E_OUTDATED_LOCK": ErrorCode_E_OUTDATED_LOCK, + "E_INVALID_TASK_PARA": ErrorCode_E_INVALID_TASK_PARA, + "E_USER_CANCEL": ErrorCode_E_USER_CANCEL, + "E_TASK_EXECUTION_FAILED": ErrorCode_E_TASK_EXECUTION_FAILED, + "E_UNKNOWN": ErrorCode_E_UNKNOWN, +} + +var ErrorCodeNames = []string { + "SUCCEEDED", + "E_DISCONNECTED", + "E_FAIL_TO_CONNECT", + "E_RPC_FAILURE", + "E_LEADER_CHANGED", + "E_SPACE_NOT_FOUND", + "E_TAG_NOT_FOUND", + "E_EDGE_NOT_FOUND", + "E_INDEX_NOT_FOUND", + "E_EDGE_PROP_NOT_FOUND", + "E_TAG_PROP_NOT_FOUND", + "E_ROLE_NOT_FOUND", + "E_CONFIG_NOT_FOUND", + "E_GROUP_NOT_FOUND", + "E_ZONE_NOT_FOUND", + "E_LISTENER_NOT_FOUND", + "E_PART_NOT_FOUND", + "E_KEY_NOT_FOUND", + "E_USER_NOT_FOUND", + "E_BACKUP_FAILED", + "E_BACKUP_EMPTY_TABLE", + "E_BACKUP_TABLE_FAILED", + "E_PARTIAL_RESULT", + "E_REBUILD_INDEX_FAILED", + "E_INVALID_PASSWORD", + "E_FAILED_GET_ABS_PATH", + "E_BAD_USERNAME_PASSWORD", + "E_SESSION_INVALID", + "E_SESSION_TIMEOUT", + "E_SYNTAX_ERROR", + "E_EXECUTION_ERROR", + "E_STATEMENT_EMPTY", + "E_BAD_PERMISSION", + "E_SEMANTIC_ERROR", + "E_TOO_MANY_CONNECTIONS", + "E_PARTIAL_SUCCEEDED", + "E_NO_HOSTS", + "E_EXISTED", + "E_INVALID_HOST", + "E_UNSUPPORTED", + "E_NOT_DROP", + "E_BALANCER_RUNNING", + "E_CONFIG_IMMUTABLE", + "E_CONFLICT", + "E_INVALID_PARM", + "E_WRONGCLUSTER", + "E_STORE_FAILURE", + "E_STORE_SEGMENT_ILLEGAL", + "E_BAD_BALANCE_PLAN", + "E_BALANCED", + "E_NO_RUNNING_BALANCE_PLAN", + "E_NO_VALID_HOST", + "E_CORRUPTTED_BALANCE_PLAN", + "E_NO_INVALID_BALANCE_PLAN", + "E_IMPROPER_ROLE", + "E_INVALID_PARTITION_NUM", + "E_INVALID_REPLICA_FACTOR", + "E_INVALID_CHARSET", + "E_INVALID_COLLATE", + "E_CHARSET_COLLATE_NOT_MATCH", + "E_SNAPSHOT_FAILURE", + "E_BLOCK_WRITE_FAILURE", + "E_REBUILD_INDEX_FAILURE", + "E_INDEX_WITH_TTL", + "E_ADD_JOB_FAILURE", + "E_STOP_JOB_FAILURE", + "E_SAVE_JOB_FAILURE", + "E_BALANCER_FAILURE", + "E_JOB_NOT_FINISHED", + "E_TASK_REPORT_OUT_DATE", + "E_INVALID_JOB", + "E_BACKUP_BUILDING_INDEX", + "E_BACKUP_SPACE_NOT_FOUND", + "E_RESTORE_FAILURE", + "E_SESSION_NOT_FOUND", + "E_LIST_CLUSTER_FAILURE", + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + "E_GET_META_DIR_FAILURE", + "E_QUERY_NOT_FOUND", + "E_CONSENSUS_ERROR", + "E_KEY_HAS_EXISTS", + "E_DATA_TYPE_MISMATCH", + "E_INVALID_FIELD_VALUE", + "E_INVALID_OPERATION", + "E_NOT_NULLABLE", + "E_FIELD_UNSET", + "E_OUT_OF_RANGE", + "E_ATOMIC_OP_FAILED", + "E_DATA_CONFLICT_ERROR", + "E_WRITE_STALLED", + "E_IMPROPER_DATA_TYPE", + "E_INVALID_SPACEVIDLEN", + "E_INVALID_FILTER", + "E_INVALID_UPDATER", + "E_INVALID_STORE", + "E_INVALID_PEER", + "E_RETRY_EXHAUSTED", + "E_TRANSFER_LEADER_FAILED", + "E_INVALID_STAT_TYPE", + "E_INVALID_VID", + "E_NO_TRANSFORMED", + "E_LOAD_META_FAILED", + "E_FAILED_TO_CHECKPOINT", + "E_CHECKPOINT_BLOCKED", + "E_FILTER_OUT", + "E_INVALID_DATA", + "E_MUTATE_EDGE_CONFLICT", + "E_MUTATE_TAG_CONFLICT", + "E_OUTDATED_LOCK", + "E_INVALID_TASK_PARA", + "E_USER_CANCEL", + "E_TASK_EXECUTION_FAILED", + "E_UNKNOWN", +} + +var ErrorCodeValues = []ErrorCode { + ErrorCode_SUCCEEDED, + ErrorCode_E_DISCONNECTED, + ErrorCode_E_FAIL_TO_CONNECT, + ErrorCode_E_RPC_FAILURE, + ErrorCode_E_LEADER_CHANGED, + ErrorCode_E_SPACE_NOT_FOUND, + ErrorCode_E_TAG_NOT_FOUND, + ErrorCode_E_EDGE_NOT_FOUND, + ErrorCode_E_INDEX_NOT_FOUND, + ErrorCode_E_EDGE_PROP_NOT_FOUND, + ErrorCode_E_TAG_PROP_NOT_FOUND, + ErrorCode_E_ROLE_NOT_FOUND, + ErrorCode_E_CONFIG_NOT_FOUND, + ErrorCode_E_GROUP_NOT_FOUND, + ErrorCode_E_ZONE_NOT_FOUND, + ErrorCode_E_LISTENER_NOT_FOUND, + ErrorCode_E_PART_NOT_FOUND, + ErrorCode_E_KEY_NOT_FOUND, + ErrorCode_E_USER_NOT_FOUND, + ErrorCode_E_BACKUP_FAILED, + ErrorCode_E_BACKUP_EMPTY_TABLE, + ErrorCode_E_BACKUP_TABLE_FAILED, + ErrorCode_E_PARTIAL_RESULT, + ErrorCode_E_REBUILD_INDEX_FAILED, + ErrorCode_E_INVALID_PASSWORD, + ErrorCode_E_FAILED_GET_ABS_PATH, + ErrorCode_E_BAD_USERNAME_PASSWORD, + ErrorCode_E_SESSION_INVALID, + ErrorCode_E_SESSION_TIMEOUT, + ErrorCode_E_SYNTAX_ERROR, + ErrorCode_E_EXECUTION_ERROR, + ErrorCode_E_STATEMENT_EMPTY, + ErrorCode_E_BAD_PERMISSION, + ErrorCode_E_SEMANTIC_ERROR, + ErrorCode_E_TOO_MANY_CONNECTIONS, + ErrorCode_E_PARTIAL_SUCCEEDED, + ErrorCode_E_NO_HOSTS, + ErrorCode_E_EXISTED, + ErrorCode_E_INVALID_HOST, + ErrorCode_E_UNSUPPORTED, + ErrorCode_E_NOT_DROP, + ErrorCode_E_BALANCER_RUNNING, + ErrorCode_E_CONFIG_IMMUTABLE, + ErrorCode_E_CONFLICT, + ErrorCode_E_INVALID_PARM, + ErrorCode_E_WRONGCLUSTER, + ErrorCode_E_STORE_FAILURE, + ErrorCode_E_STORE_SEGMENT_ILLEGAL, + ErrorCode_E_BAD_BALANCE_PLAN, + ErrorCode_E_BALANCED, + ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + ErrorCode_E_NO_VALID_HOST, + ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + ErrorCode_E_NO_INVALID_BALANCE_PLAN, + ErrorCode_E_IMPROPER_ROLE, + ErrorCode_E_INVALID_PARTITION_NUM, + ErrorCode_E_INVALID_REPLICA_FACTOR, + ErrorCode_E_INVALID_CHARSET, + ErrorCode_E_INVALID_COLLATE, + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + ErrorCode_E_SNAPSHOT_FAILURE, + ErrorCode_E_BLOCK_WRITE_FAILURE, + ErrorCode_E_REBUILD_INDEX_FAILURE, + ErrorCode_E_INDEX_WITH_TTL, + ErrorCode_E_ADD_JOB_FAILURE, + ErrorCode_E_STOP_JOB_FAILURE, + ErrorCode_E_SAVE_JOB_FAILURE, + ErrorCode_E_BALANCER_FAILURE, + ErrorCode_E_JOB_NOT_FINISHED, + ErrorCode_E_TASK_REPORT_OUT_DATE, + ErrorCode_E_INVALID_JOB, + ErrorCode_E_BACKUP_BUILDING_INDEX, + ErrorCode_E_BACKUP_SPACE_NOT_FOUND, + ErrorCode_E_RESTORE_FAILURE, + ErrorCode_E_SESSION_NOT_FOUND, + ErrorCode_E_LIST_CLUSTER_FAILURE, + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + ErrorCode_E_GET_META_DIR_FAILURE, + ErrorCode_E_QUERY_NOT_FOUND, + ErrorCode_E_CONSENSUS_ERROR, + ErrorCode_E_KEY_HAS_EXISTS, + ErrorCode_E_DATA_TYPE_MISMATCH, + ErrorCode_E_INVALID_FIELD_VALUE, + ErrorCode_E_INVALID_OPERATION, + ErrorCode_E_NOT_NULLABLE, + ErrorCode_E_FIELD_UNSET, + ErrorCode_E_OUT_OF_RANGE, + ErrorCode_E_ATOMIC_OP_FAILED, + ErrorCode_E_DATA_CONFLICT_ERROR, + ErrorCode_E_WRITE_STALLED, + ErrorCode_E_IMPROPER_DATA_TYPE, + ErrorCode_E_INVALID_SPACEVIDLEN, + ErrorCode_E_INVALID_FILTER, + ErrorCode_E_INVALID_UPDATER, + ErrorCode_E_INVALID_STORE, + ErrorCode_E_INVALID_PEER, + ErrorCode_E_RETRY_EXHAUSTED, + ErrorCode_E_TRANSFER_LEADER_FAILED, + ErrorCode_E_INVALID_STAT_TYPE, + ErrorCode_E_INVALID_VID, + ErrorCode_E_NO_TRANSFORMED, + ErrorCode_E_LOAD_META_FAILED, + ErrorCode_E_FAILED_TO_CHECKPOINT, + ErrorCode_E_CHECKPOINT_BLOCKED, + ErrorCode_E_FILTER_OUT, + ErrorCode_E_INVALID_DATA, + ErrorCode_E_MUTATE_EDGE_CONFLICT, + ErrorCode_E_MUTATE_TAG_CONFLICT, + ErrorCode_E_OUTDATED_LOCK, + ErrorCode_E_INVALID_TASK_PARA, + ErrorCode_E_USER_CANCEL, + ErrorCode_E_TASK_EXECUTION_FAILED, + ErrorCode_E_UNKNOWN, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +type GraphSpaceID = int32 + +func GraphSpaceIDPtr(v GraphSpaceID) *GraphSpaceID { return &v } + +type PartitionID = int32 + +func PartitionIDPtr(v PartitionID) *PartitionID { return &v } + +type TagID = int32 + +func TagIDPtr(v TagID) *TagID { return &v } + +type EdgeType = int32 + +func EdgeTypePtr(v EdgeType) *EdgeType { return &v } + +type EdgeRanking = int64 + +func EdgeRankingPtr(v EdgeRanking) *EdgeRanking { return &v } + +type LogID = int64 + +func LogIDPtr(v LogID) *LogID { return &v } + +type TermID = int64 + +func TermIDPtr(v TermID) *TermID { return &v } + +type Timestamp = int64 + +func TimestampPtr(v Timestamp) *Timestamp { return &v } + +type IndexID = int32 + +func IndexIDPtr(v IndexID) *IndexID { return &v } + +type Port = int32 + +func PortPtr(v Port) *Port { return &v } + +type SessionID = int64 + +func SessionIDPtr(v SessionID) *SessionID { return &v } + +type ExecutionPlanID = int64 + +func ExecutionPlanIDPtr(v ExecutionPlanID) *ExecutionPlanID { return &v } + +// Attributes: +// - Year +// - Month +// - Day +type Date struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` +} + +func NewDate() *Date { + return &Date{} +} + + +func (p *Date) GetYear() int16 { + return p.Year +} + +func (p *Date) GetMonth() int8 { + return p.Month +} + +func (p *Date) GetDay() int8 { + return p.Day +} +func (p *Date) 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 *Date) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *Date) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *Date) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *Date) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Date"); 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 *Date) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *Date) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *Date) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *Date) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + return fmt.Sprintf("Date({Year:%s Month:%s Day:%s})", yearVal, monthVal, dayVal) +} + +// Attributes: +// - Hour +// - Minute +// - Sec +// - Microsec +type Time struct { + Hour int8 `thrift:"hour,1" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,2" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,3" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,4" db:"microsec" json:"microsec"` +} + +func NewTime() *Time { + return &Time{} +} + + +func (p *Time) GetHour() int8 { + return p.Hour +} + +func (p *Time) GetMinute() int8 { + return p.Minute +} + +func (p *Time) GetSec() int8 { + return p.Sec +} + +func (p *Time) GetMicrosec() int32 { + return p.Microsec +} +func (p *Time) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Time) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *Time) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *Time) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *Time) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *Time) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Time"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Time) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hour: ", p), err) } + return err +} + +func (p *Time) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:minute: ", p), err) } + return err +} + +func (p *Time) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sec: ", p), err) } + return err +} + +func (p *Time) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:microsec: ", p), err) } + return err +} + +func (p *Time) String() string { + if p == nil { + return "" + } + + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("Time({Hour:%s Minute:%s Sec:%s Microsec:%s})", hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - Year +// - Month +// - Day +// - Hour +// - Minute +// - Sec +// - Microsec +type DateTime struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` + Hour int8 `thrift:"hour,4" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,5" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,6" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,7" db:"microsec" json:"microsec"` +} + +func NewDateTime() *DateTime { + return &DateTime{} +} + + +func (p *DateTime) GetYear() int16 { + return p.Year +} + +func (p *DateTime) GetMonth() int8 { + return p.Month +} + +func (p *DateTime) GetDay() int8 { + return p.Day +} + +func (p *DateTime) GetHour() int8 { + return p.Hour +} + +func (p *DateTime) GetMinute() int8 { + return p.Minute +} + +func (p *DateTime) GetSec() int8 { + return p.Sec +} + +func (p *DateTime) GetMicrosec() int32 { + return p.Microsec +} +func (p *DateTime) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DateTime) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *DateTime) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *DateTime) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *DateTime) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *DateTime) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *DateTime) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *DateTime) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *DateTime) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DateTime"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DateTime) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *DateTime) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *DateTime) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *DateTime) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hour: ", p), err) } + return err +} + +func (p *DateTime) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minute: ", p), err) } + return err +} + +func (p *DateTime) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sec: ", p), err) } + return err +} + +func (p *DateTime) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:microsec: ", p), err) } + return err +} + +func (p *DateTime) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("DateTime({Year:%s Month:%s Day:%s Hour:%s Minute:%s Sec:%s Microsec:%s})", yearVal, monthVal, dayVal, hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - NVal +// - BVal +// - IVal +// - FVal +// - SVal +// - DVal +// - TVal +// - DtVal +// - VVal +// - EVal +// - PVal +// - LVal +// - MVal +// - UVal +// - GVal +type Value struct { + NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` + BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` + IVal *int64 `thrift:"iVal,3" db:"iVal" json:"iVal,omitempty"` + FVal *float64 `thrift:"fVal,4" db:"fVal" json:"fVal,omitempty"` + SVal []byte `thrift:"sVal,5" db:"sVal" json:"sVal,omitempty"` + DVal *Date `thrift:"dVal,6" db:"dVal" json:"dVal,omitempty"` + TVal *Time `thrift:"tVal,7" db:"tVal" json:"tVal,omitempty"` + DtVal *DateTime `thrift:"dtVal,8" db:"dtVal" json:"dtVal,omitempty"` + VVal *Vertex `thrift:"vVal,9" db:"vVal" json:"vVal,omitempty"` + EVal *Edge `thrift:"eVal,10" db:"eVal" json:"eVal,omitempty"` + PVal *Path `thrift:"pVal,11" db:"pVal" json:"pVal,omitempty"` + LVal *NList `thrift:"lVal,12" db:"lVal" json:"lVal,omitempty"` + MVal *NMap `thrift:"mVal,13" db:"mVal" json:"mVal,omitempty"` + UVal *NSet `thrift:"uVal,14" db:"uVal" json:"uVal,omitempty"` + GVal *DataSet `thrift:"gVal,15" db:"gVal" json:"gVal,omitempty"` +} + +func NewValue() *Value { + return &Value{} +} + +var Value_NVal_DEFAULT NullType +func (p *Value) GetNVal() NullType { + if !p.IsSetNVal() { + return Value_NVal_DEFAULT + } +return *p.NVal +} +var Value_BVal_DEFAULT bool +func (p *Value) GetBVal() bool { + if !p.IsSetBVal() { + return Value_BVal_DEFAULT + } +return *p.BVal +} +var Value_IVal_DEFAULT int64 +func (p *Value) GetIVal() int64 { + if !p.IsSetIVal() { + return Value_IVal_DEFAULT + } +return *p.IVal +} +var Value_FVal_DEFAULT float64 +func (p *Value) GetFVal() float64 { + if !p.IsSetFVal() { + return Value_FVal_DEFAULT + } +return *p.FVal +} +var Value_SVal_DEFAULT []byte + +func (p *Value) GetSVal() []byte { + return p.SVal +} +var Value_DVal_DEFAULT *Date +func (p *Value) GetDVal() *Date { + if !p.IsSetDVal() { + return Value_DVal_DEFAULT + } +return p.DVal +} +var Value_TVal_DEFAULT *Time +func (p *Value) GetTVal() *Time { + if !p.IsSetTVal() { + return Value_TVal_DEFAULT + } +return p.TVal +} +var Value_DtVal_DEFAULT *DateTime +func (p *Value) GetDtVal() *DateTime { + if !p.IsSetDtVal() { + return Value_DtVal_DEFAULT + } +return p.DtVal +} +var Value_VVal_DEFAULT *Vertex +func (p *Value) GetVVal() *Vertex { + if !p.IsSetVVal() { + return Value_VVal_DEFAULT + } +return p.VVal +} +var Value_EVal_DEFAULT *Edge +func (p *Value) GetEVal() *Edge { + if !p.IsSetEVal() { + return Value_EVal_DEFAULT + } +return p.EVal +} +var Value_PVal_DEFAULT *Path +func (p *Value) GetPVal() *Path { + if !p.IsSetPVal() { + return Value_PVal_DEFAULT + } +return p.PVal +} +var Value_LVal_DEFAULT *NList +func (p *Value) GetLVal() *NList { + if !p.IsSetLVal() { + return Value_LVal_DEFAULT + } +return p.LVal +} +var Value_MVal_DEFAULT *NMap +func (p *Value) GetMVal() *NMap { + if !p.IsSetMVal() { + return Value_MVal_DEFAULT + } +return p.MVal +} +var Value_UVal_DEFAULT *NSet +func (p *Value) GetUVal() *NSet { + if !p.IsSetUVal() { + return Value_UVal_DEFAULT + } +return p.UVal +} +var Value_GVal_DEFAULT *DataSet +func (p *Value) GetGVal() *DataSet { + if !p.IsSetGVal() { + return Value_GVal_DEFAULT + } +return p.GVal +} +func (p *Value) CountSetFieldsValue() int { + count := 0 + if (p.IsSetNVal()) { + count++ + } + if (p.IsSetBVal()) { + count++ + } + if (p.IsSetIVal()) { + count++ + } + if (p.IsSetFVal()) { + count++ + } + if (p.IsSetSVal()) { + count++ + } + if (p.IsSetDVal()) { + count++ + } + if (p.IsSetTVal()) { + count++ + } + if (p.IsSetDtVal()) { + count++ + } + if (p.IsSetVVal()) { + count++ + } + if (p.IsSetEVal()) { + count++ + } + if (p.IsSetPVal()) { + count++ + } + if (p.IsSetLVal()) { + count++ + } + if (p.IsSetMVal()) { + count++ + } + if (p.IsSetUVal()) { + count++ + } + if (p.IsSetGVal()) { + count++ + } + return count + +} + +func (p *Value) IsSetNVal() bool { + return p != nil && p.NVal != nil +} + +func (p *Value) IsSetBVal() bool { + return p != nil && p.BVal != nil +} + +func (p *Value) IsSetIVal() bool { + return p != nil && p.IVal != nil +} + +func (p *Value) IsSetFVal() bool { + return p != nil && p.FVal != nil +} + +func (p *Value) IsSetSVal() bool { + return p != nil && p.SVal != nil +} + +func (p *Value) IsSetDVal() bool { + return p != nil && p.DVal != nil +} + +func (p *Value) IsSetTVal() bool { + return p != nil && p.TVal != nil +} + +func (p *Value) IsSetDtVal() bool { + return p != nil && p.DtVal != nil +} + +func (p *Value) IsSetVVal() bool { + return p != nil && p.VVal != nil +} + +func (p *Value) IsSetEVal() bool { + return p != nil && p.EVal != nil +} + +func (p *Value) IsSetPVal() bool { + return p != nil && p.PVal != nil +} + +func (p *Value) IsSetLVal() bool { + return p != nil && p.LVal != nil +} + +func (p *Value) IsSetMVal() bool { + return p != nil && p.MVal != nil +} + +func (p *Value) IsSetUVal() bool { + return p != nil && p.UVal != nil +} + +func (p *Value) IsSetGVal() bool { + return p != nil && p.GVal != nil +} + +func (p *Value) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(iprot); err != nil { + return err + } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } + case 14: + if err := p.ReadField14(iprot); err != nil { + return err + } + case 15: + if err := p.ReadField15(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 *Value) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := NullType(v) + p.NVal = &temp +} + return nil +} + +func (p *Value) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BVal = &v +} + return nil +} + +func (p *Value) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IVal = &v +} + return nil +} + +func (p *Value) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FVal = &v +} + return nil +} + +func (p *Value) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SVal = v +} + return nil +} + +func (p *Value) ReadField6(iprot thrift.Protocol) error { + p.DVal = NewDate() + if err := p.DVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DVal), err) + } + return nil +} + +func (p *Value) ReadField7(iprot thrift.Protocol) error { + p.TVal = NewTime() + if err := p.TVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TVal), err) + } + return nil +} + +func (p *Value) ReadField8(iprot thrift.Protocol) error { + p.DtVal = NewDateTime() + if err := p.DtVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DtVal), err) + } + return nil +} + +func (p *Value) ReadField9(iprot thrift.Protocol) error { + p.VVal = NewVertex() + if err := p.VVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VVal), err) + } + return nil +} + +func (p *Value) ReadField10(iprot thrift.Protocol) error { + p.EVal = NewEdge() + if err := p.EVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EVal), err) + } + return nil +} + +func (p *Value) ReadField11(iprot thrift.Protocol) error { + p.PVal = NewPath() + if err := p.PVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PVal), err) + } + return nil +} + +func (p *Value) ReadField12(iprot thrift.Protocol) error { + p.LVal = NewNList() + if err := p.LVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LVal), err) + } + return nil +} + +func (p *Value) ReadField13(iprot thrift.Protocol) error { + p.MVal = NewNMap() + if err := p.MVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MVal), err) + } + return nil +} + +func (p *Value) ReadField14(iprot thrift.Protocol) error { + p.UVal = NewNSet() + if err := p.UVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UVal), err) + } + return nil +} + +func (p *Value) ReadField15(iprot thrift.Protocol) error { + p.GVal = NewDataSet() + if err := p.GVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GVal), err) + } + return nil +} + +func (p *Value) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsValue(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("Value"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } + if err := p.writeField14(oprot); err != nil { return err } + if err := p.writeField15(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Value) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetNVal() { + if err := oprot.WriteFieldBegin("nVal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nVal: ", p), err) } + if err := oprot.WriteI32(int32(*p.NVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nVal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nVal: ", p), err) } + } + return err +} + +func (p *Value) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetBVal() { + if err := oprot.WriteFieldBegin("bVal", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bVal: ", p), err) } + if err := oprot.WriteBool(bool(*p.BVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bVal (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bVal: ", p), err) } + } + return err +} + +func (p *Value) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetIVal() { + if err := oprot.WriteFieldBegin("iVal", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:iVal: ", p), err) } + if err := oprot.WriteI64(int64(*p.IVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.iVal (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:iVal: ", p), err) } + } + return err +} + +func (p *Value) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetFVal() { + if err := oprot.WriteFieldBegin("fVal", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fVal: ", p), err) } + if err := oprot.WriteDouble(float64(*p.FVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fVal (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fVal: ", p), err) } + } + return err +} + +func (p *Value) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetSVal() { + if err := oprot.WriteFieldBegin("sVal", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sVal: ", p), err) } + if err := oprot.WriteBinary(p.SVal); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sVal (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sVal: ", p), err) } + } + return err +} + +func (p *Value) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetDVal() { + if err := oprot.WriteFieldBegin("dVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dVal: ", p), err) } + if err := p.DVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dVal: ", p), err) } + } + return err +} + +func (p *Value) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetTVal() { + if err := oprot.WriteFieldBegin("tVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tVal: ", p), err) } + if err := p.TVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tVal: ", p), err) } + } + return err +} + +func (p *Value) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetDtVal() { + if err := oprot.WriteFieldBegin("dtVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:dtVal: ", p), err) } + if err := p.DtVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DtVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:dtVal: ", p), err) } + } + return err +} + +func (p *Value) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetVVal() { + if err := oprot.WriteFieldBegin("vVal", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:vVal: ", p), err) } + if err := p.VVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:vVal: ", p), err) } + } + return err +} + +func (p *Value) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetEVal() { + if err := oprot.WriteFieldBegin("eVal", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:eVal: ", p), err) } + if err := p.EVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:eVal: ", p), err) } + } + return err +} + +func (p *Value) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetPVal() { + if err := oprot.WriteFieldBegin("pVal", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:pVal: ", p), err) } + if err := p.PVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:pVal: ", p), err) } + } + return err +} + +func (p *Value) writeField12(oprot thrift.Protocol) (err error) { + if p.IsSetLVal() { + if err := oprot.WriteFieldBegin("lVal", thrift.STRUCT, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:lVal: ", p), err) } + if err := p.LVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:lVal: ", p), err) } + } + return err +} + +func (p *Value) writeField13(oprot thrift.Protocol) (err error) { + if p.IsSetMVal() { + if err := oprot.WriteFieldBegin("mVal", thrift.STRUCT, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:mVal: ", p), err) } + if err := p.MVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:mVal: ", p), err) } + } + return err +} + +func (p *Value) writeField14(oprot thrift.Protocol) (err error) { + if p.IsSetUVal() { + if err := oprot.WriteFieldBegin("uVal", thrift.STRUCT, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:uVal: ", p), err) } + if err := p.UVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:uVal: ", p), err) } + } + return err +} + +func (p *Value) writeField15(oprot thrift.Protocol) (err error) { + if p.IsSetGVal() { + if err := oprot.WriteFieldBegin("gVal", thrift.STRUCT, 15); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:gVal: ", p), err) } + if err := p.GVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:gVal: ", p), err) } + } + return err +} + +func (p *Value) String() string { + if p == nil { + return "" + } + + var nValVal string + if p.NVal == nil { + nValVal = "" + } else { + nValVal = fmt.Sprintf("%v", *p.NVal) + } + var bValVal string + if p.BVal == nil { + bValVal = "" + } else { + bValVal = fmt.Sprintf("%v", *p.BVal) + } + var iValVal string + if p.IVal == nil { + iValVal = "" + } else { + iValVal = fmt.Sprintf("%v", *p.IVal) + } + var fValVal string + if p.FVal == nil { + fValVal = "" + } else { + fValVal = fmt.Sprintf("%v", *p.FVal) + } + sValVal := fmt.Sprintf("%v", p.SVal) + var dValVal string + if p.DVal == nil { + dValVal = "" + } else { + dValVal = fmt.Sprintf("%v", p.DVal) + } + var tValVal string + if p.TVal == nil { + tValVal = "" + } else { + tValVal = fmt.Sprintf("%v", p.TVal) + } + var dtValVal string + if p.DtVal == nil { + dtValVal = "" + } else { + dtValVal = fmt.Sprintf("%v", p.DtVal) + } + var vValVal string + if p.VVal == nil { + vValVal = "" + } else { + vValVal = fmt.Sprintf("%v", p.VVal) + } + var eValVal string + if p.EVal == nil { + eValVal = "" + } else { + eValVal = fmt.Sprintf("%v", p.EVal) + } + var pValVal string + if p.PVal == nil { + pValVal = "" + } else { + pValVal = fmt.Sprintf("%v", p.PVal) + } + var lValVal string + if p.LVal == nil { + lValVal = "" + } else { + lValVal = fmt.Sprintf("%v", p.LVal) + } + var mValVal string + if p.MVal == nil { + mValVal = "" + } else { + mValVal = fmt.Sprintf("%v", p.MVal) + } + var uValVal string + if p.UVal == nil { + uValVal = "" + } else { + uValVal = fmt.Sprintf("%v", p.UVal) + } + var gValVal string + if p.GVal == nil { + gValVal = "" + } else { + gValVal = fmt.Sprintf("%v", p.GVal) + } + return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal) +} + +// Attributes: +// - Values +type NList struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNList() *NList { + return &NList{} +} + + +func (p *NList) GetValues() []*Value { + return p.Values +} +func (p *NList) 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 *NList) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem0 := NewValue() + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Values = append(p.Values, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NList) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NList"); 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 *NList) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NList) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NList({Values:%s})", valuesVal) +} + +// Attributes: +// - Kvs +type NMap struct { + Kvs map[string]*Value `thrift:"kvs,1" db:"kvs" json:"kvs"` +} + +func NewNMap() *NMap { + return &NMap{} +} + + +func (p *NMap) GetKvs() map[string]*Value { + return p.Kvs +} +func (p *NMap) 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 *NMap) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Kvs = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} + _val2 := NewValue() + if err := _val2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val2), err) + } + p.Kvs[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *NMap) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NMap"); 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 *NMap) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kvs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Kvs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kvs: ", p), err) } + return err +} + +func (p *NMap) String() string { + if p == nil { + return "" + } + + kvsVal := fmt.Sprintf("%v", p.Kvs) + return fmt.Sprintf("NMap({Kvs:%s})", kvsVal) +} + +// Attributes: +// - Values +type NSet struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNSet() *NSet { + return &NSet{} +} + + +func (p *NSet) GetValues() []*Value { + return p.Values +} +func (p *NSet) 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 *NSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*Value, 0, size) + p.Values = tSet + for i := 0; i < size; i ++ { + _elem3 := NewValue() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Values = append(p.Values, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *NSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NSet"); 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 *NSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.SET, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[*Value]bool, len(p.Values)) + for _, v := range p.Values { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NSet) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NSet({Values:%s})", valuesVal) +} + +// Attributes: +// - Values +type Row struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewRow() *Row { + return &Row{} +} + + +func (p *Row) GetValues() []*Value { + return p.Values +} +func (p *Row) 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 *Row) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewValue() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Values = append(p.Values, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Row) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Row"); 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 *Row) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *Row) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("Row({Values:%s})", valuesVal) +} + +// Attributes: +// - ColumnNames +// - Rows +type DataSet struct { + ColumnNames [][]byte `thrift:"column_names,1" db:"column_names" json:"column_names"` + Rows []*Row `thrift:"rows,2" db:"rows" json:"rows"` +} + +func NewDataSet() *DataSet { + return &DataSet{} +} + + +func (p *DataSet) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *DataSet) GetRows() []*Row { + return p.Rows +} +func (p *DataSet) 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 *DataSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ColumnNames = tSlice + for i := 0; i < size; i ++ { +var _elem5 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.ColumnNames = append(p.ColumnNames, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Row, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewRow() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.Rows = append(p.Rows, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DataSet"); 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 *DataSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:column_names: ", p), err) } + return err +} + +func (p *DataSet) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + 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:rows: ", p), err) } + return err +} + +func (p *DataSet) String() string { + if p == nil { + return "" + } + + columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) + rowsVal := fmt.Sprintf("%v", p.Rows) + return fmt.Sprintf("DataSet({ColumnNames:%s Rows:%s})", columnNamesVal, rowsVal) +} + +// Attributes: +// - Name +// - Props +type Tag struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Props map[string]*Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewTag() *Tag { + return &Tag{} +} + + +func (p *Tag) GetName() []byte { + return p.Name +} + +func (p *Tag) GetProps() map[string]*Value { + return p.Props +} +func (p *Tag) 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 *Tag) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Tag) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} + _val8 := NewValue() + if err := _val8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val8), err) + } + p.Props[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Tag) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Tag"); 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 *Tag) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Tag) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Tag({Name:%s Props:%s})", nameVal, propsVal) +} + +// Attributes: +// - Vid +// - Tags +type Vertex struct { + Vid *Value `thrift:"vid,1" db:"vid" json:"vid"` + Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewVertex() *Vertex { + return &Vertex{} +} + +var Vertex_Vid_DEFAULT *Value +func (p *Vertex) GetVid() *Value { + if !p.IsSetVid() { + return Vertex_Vid_DEFAULT + } +return p.Vid +} + +func (p *Vertex) GetTags() []*Tag { + return p.Tags +} +func (p *Vertex) IsSetVid() bool { + return p != nil && p.Vid != nil +} + +func (p *Vertex) 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 *Vertex) ReadField1(iprot thrift.Protocol) error { + p.Vid = NewValue() + if err := p.Vid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vid), err) + } + return nil +} + +func (p *Vertex) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewTag() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Tags = append(p.Tags, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Vertex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Vertex"); 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 *Vertex) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:vid: ", p), err) } + if err := p.Vid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:vid: ", p), err) } + return err +} + +func (p *Vertex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *Vertex) String() string { + if p == nil { + return "" + } + + var vidVal string + if p.Vid == nil { + vidVal = "" + } else { + vidVal = fmt.Sprintf("%v", p.Vid) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("Vertex({Vid:%s Tags:%s})", vidVal, tagsVal) +} + +// Attributes: +// - Src +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Edge struct { + Src *Value `thrift:"src,1" db:"src" json:"src"` + Dst *Value `thrift:"dst,2" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,3" db:"type" json:"type"` + Name []byte `thrift:"name,4" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,5" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,6" db:"props" json:"props"` +} + +func NewEdge() *Edge { + return &Edge{} +} + +var Edge_Src_DEFAULT *Value +func (p *Edge) GetSrc() *Value { + if !p.IsSetSrc() { + return Edge_Src_DEFAULT + } +return p.Src +} +var Edge_Dst_DEFAULT *Value +func (p *Edge) GetDst() *Value { + if !p.IsSetDst() { + return Edge_Dst_DEFAULT + } +return p.Dst +} + +func (p *Edge) GetType() EdgeType { + return p.Type +} + +func (p *Edge) GetName() []byte { + return p.Name +} + +func (p *Edge) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Edge) GetProps() map[string]*Value { + return p.Props +} +func (p *Edge) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Edge) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Edge) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Edge) ReadField1(iprot thrift.Protocol) error { + p.Src = NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Edge) ReadField2(iprot thrift.Protocol) error { + p.Dst = NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Edge) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Edge) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Edge) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Edge) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} + _val11 := NewValue() + if err := _val11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val11), err) + } + p.Props[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Edge) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Edge"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Edge) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Edge) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dst: ", p), err) } + return err +} + +func (p *Edge) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *Edge) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:name: ", p), err) } + return err +} + +func (p *Edge) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ranking: ", p), err) } + return err +} + +func (p *Edge) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) } + return err +} + +func (p *Edge) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Edge({Src:%s Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", srcVal, dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Step struct { + Dst *Vertex `thrift:"dst,1" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,2" db:"type" json:"type"` + Name []byte `thrift:"name,3" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,4" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,5" db:"props" json:"props"` +} + +func NewStep() *Step { + return &Step{ + Dst: NewVertex(), + } +} + +var Step_Dst_DEFAULT *Vertex +func (p *Step) GetDst() *Vertex { + if !p.IsSetDst() { + return Step_Dst_DEFAULT + } +return p.Dst +} + +func (p *Step) GetType() EdgeType { + return p.Type +} + +func (p *Step) GetName() []byte { + return p.Name +} + +func (p *Step) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Step) GetProps() map[string]*Value { + return p.Props +} +func (p *Step) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Step) 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 + } + 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 *Step) ReadField1(iprot thrift.Protocol) error { + p.Dst = NewVertex() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Step) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Step) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Step) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Step) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key12 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key12 = v +} + _val13 := NewValue() + if err := _val13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val13), err) + } + p.Props[_key12] = _val13 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Step) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Step"); 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 *Step) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dst: ", p), err) } + return err +} + +func (p *Step) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *Step) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *Step) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ranking: ", p), err) } + return err +} + +func (p *Step) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:props: ", p), err) } + return err +} + +func (p *Step) String() string { + if p == nil { + return "" + } + + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Step({Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Src +// - Steps +type Path struct { + Src *Vertex `thrift:"src,1" db:"src" json:"src"` + Steps []*Step `thrift:"steps,2" db:"steps" json:"steps"` +} + +func NewPath() *Path { + return &Path{ + Src: NewVertex(), + } +} + +var Path_Src_DEFAULT *Vertex +func (p *Path) GetSrc() *Vertex { + if !p.IsSetSrc() { + return Path_Src_DEFAULT + } +return p.Src +} + +func (p *Path) GetSteps() []*Step { + return p.Steps +} +func (p *Path) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Path) 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 *Path) ReadField1(iprot thrift.Protocol) error { + p.Src = NewVertex() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Path) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Step, 0, size) + p.Steps = tSlice + for i := 0; i < size; i ++ { + _elem14 := NewStep() + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + p.Steps = append(p.Steps, _elem14) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Path) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Path"); 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 *Path) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Path) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("steps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:steps: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Steps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Steps { + 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:steps: ", p), err) } + return err +} + +func (p *Path) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + stepsVal := fmt.Sprintf("%v", p.Steps) + return fmt.Sprintf("Path({Src:%s Steps:%s})", srcVal, stepsVal) +} + +// Attributes: +// - Host +// - Port +type HostAddr struct { + Host string `thrift:"host,1" db:"host" json:"host"` + Port Port `thrift:"port,2" db:"port" json:"port"` +} + +func NewHostAddr() *HostAddr { + return &HostAddr{} +} + + +func (p *HostAddr) GetHost() string { + return p.Host +} + +func (p *HostAddr) GetPort() Port { + return p.Port +} +func (p *HostAddr) 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 *HostAddr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *HostAddr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := Port(v) + p.Port = temp +} + return nil +} + +func (p *HostAddr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostAddr"); 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 *HostAddr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteString(string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostAddr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } + if err := oprot.WriteI32(int32(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } + return err +} + +func (p *HostAddr) String() string { + if p == nil { + return "" + } + + hostVal := fmt.Sprintf("%v", p.Host) + portVal := fmt.Sprintf("%v", p.Port) + return fmt.Sprintf("HostAddr({Host:%s Port:%s})", hostVal, portVal) +} + +// Attributes: +// - Key +// - Value +type KeyValue struct { + Key []byte `thrift:"key,1" db:"key" json:"key"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewKeyValue() *KeyValue { + return &KeyValue{} +} + + +func (p *KeyValue) GetKey() []byte { + return p.Key +} + +func (p *KeyValue) GetValue() []byte { + return p.Value +} +func (p *KeyValue) 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 *KeyValue) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *KeyValue) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *KeyValue) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KeyValue"); 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 *KeyValue) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *KeyValue) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("KeyValue({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - LogID +// - TermID +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"` +} + +func NewLogInfo() *LogInfo { + return &LogInfo{} +} + + +func (p *LogInfo) GetLogID() LogID { + return p.LogID +} + +func (p *LogInfo) GetTermID() TermID { + return p.TermID +} +func (p *LogInfo) 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 *LogInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := LogID(v) + p.LogID = temp +} + return nil +} + +func (p *LogInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TermID(v) + p.TermID = temp +} + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("log_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:log_id: ", p), err) } + if err := oprot.WriteI64(int64(p.LogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TermID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_id: ", p), err) } + return err +} + +func (p *LogInfo) String() string { + if p == nil { + return "" + } + + logIDVal := fmt.Sprintf("%v", p.LogID) + termIDVal := fmt.Sprintf("%v", p.TermID) + return fmt.Sprintf("LogInfo({LogID:%s TermID:%s})", logIDVal, termIDVal) +} + +// Attributes: +// - Root +// - Data +type DirInfo struct { + Root []byte `thrift:"root,1" db:"root" json:"root"` + Data [][]byte `thrift:"data,2" db:"data" json:"data"` +} + +func NewDirInfo() *DirInfo { + return &DirInfo{} +} + + +func (p *DirInfo) GetRoot() []byte { + return p.Root +} + +func (p *DirInfo) GetData() [][]byte { + return p.Data +} +func (p *DirInfo) 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 *DirInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Root = v +} + return nil +} + +func (p *DirInfo) 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.Data = tSlice + for i := 0; i < size; i ++ { +var _elem15 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem15 = v +} + p.Data = append(p.Data, _elem15) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DirInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DirInfo"); 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 *DirInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("root", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:root: ", p), err) } + if err := oprot.WriteBinary(p.Root); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.root (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:root: ", p), err) } + return err +} + +func (p *DirInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + 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:data: ", p), err) } + return err +} + +func (p *DirInfo) String() string { + if p == nil { + return "" + } + + rootVal := fmt.Sprintf("%v", p.Root) + dataVal := fmt.Sprintf("%v", p.Data) + return fmt.Sprintf("DirInfo({Root:%s Data:%s})", rootVal, dataVal) +} + +// Attributes: +// - Host +// - Dir +type NodeInfo struct { + Host *HostAddr `thrift:"host,1" db:"host" json:"host"` + Dir *DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewNodeInfo() *NodeInfo { + return &NodeInfo{ + Host: NewHostAddr(), + Dir: NewDirInfo(), + } +} + +var NodeInfo_Host_DEFAULT *HostAddr +func (p *NodeInfo) GetHost() *HostAddr { + if !p.IsSetHost() { + return NodeInfo_Host_DEFAULT + } +return p.Host +} +var NodeInfo_Dir_DEFAULT *DirInfo +func (p *NodeInfo) GetDir() *DirInfo { + if !p.IsSetDir() { + return NodeInfo_Dir_DEFAULT + } +return p.Dir +} +func (p *NodeInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *NodeInfo) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *NodeInfo) 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 *NodeInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *NodeInfo) ReadField2(iprot thrift.Protocol) error { + p.Dir = NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *NodeInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NodeInfo"); 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 *NodeInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *NodeInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *NodeInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("NodeInfo({Host:%s Dir:%s})", hostVal, dirVal) +} + +// Attributes: +// - Info +type PartitionBackupInfo struct { + Info map[PartitionID]*LogInfo `thrift:"info,1" db:"info" json:"info"` +} + +func NewPartitionBackupInfo() *PartitionBackupInfo { + return &PartitionBackupInfo{} +} + + +func (p *PartitionBackupInfo) GetInfo() map[PartitionID]*LogInfo { + return p.Info +} +func (p *PartitionBackupInfo) 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 *PartitionBackupInfo) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[PartitionID]*LogInfo, size) + p.Info = tMap + for i := 0; i < size; i ++ { +var _key16 PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := PartitionID(v) + _key16 = temp +} + _val17 := NewLogInfo() + if err := _val17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val17), err) + } + p.Info[_key16] = _val17 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PartitionBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionBackupInfo"); 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 *PartitionBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Info { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) } + return err +} + +func (p *PartitionBackupInfo) String() string { + if p == nil { + return "" + } + + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("PartitionBackupInfo({Info:%s})", infoVal) +} + +// Attributes: +// - PartitionInfo +// - Path +type CheckpointInfo struct { + PartitionInfo *PartitionBackupInfo `thrift:"partition_info,1" db:"partition_info" json:"partition_info"` + Path []byte `thrift:"path,2" db:"path" json:"path"` +} + +func NewCheckpointInfo() *CheckpointInfo { + return &CheckpointInfo{ + PartitionInfo: NewPartitionBackupInfo(), + } +} + +var CheckpointInfo_PartitionInfo_DEFAULT *PartitionBackupInfo +func (p *CheckpointInfo) GetPartitionInfo() *PartitionBackupInfo { + if !p.IsSetPartitionInfo() { + return CheckpointInfo_PartitionInfo_DEFAULT + } +return p.PartitionInfo +} + +func (p *CheckpointInfo) GetPath() []byte { + return p.Path +} +func (p *CheckpointInfo) IsSetPartitionInfo() bool { + return p != nil && p.PartitionInfo != nil +} + +func (p *CheckpointInfo) 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 *CheckpointInfo) ReadField1(iprot thrift.Protocol) error { + p.PartitionInfo = NewPartitionBackupInfo() + if err := p.PartitionInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionInfo), err) + } + return nil +} + +func (p *CheckpointInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Path = v +} + return nil +} + +func (p *CheckpointInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckpointInfo"); 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 *CheckpointInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_info", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:partition_info: ", p), err) } + if err := p.PartitionInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:partition_info: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) } + if err := oprot.WriteBinary(p.Path); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.path (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) } + return err +} + +func (p *CheckpointInfo) String() string { + if p == nil { + return "" + } + + var partitionInfoVal string + if p.PartitionInfo == nil { + partitionInfoVal = "" + } else { + partitionInfoVal = fmt.Sprintf("%v", p.PartitionInfo) + } + pathVal := fmt.Sprintf("%v", p.Path) + return fmt.Sprintf("CheckpointInfo({PartitionInfo:%s Path:%s})", partitionInfoVal, pathVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/constants.go b/ccore/nebula/internal/thrift/v2_6_0/constants.go new file mode 100644 index 0000000..d0b39bb --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/constants.go @@ -0,0 +1,26 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +const Version = "2.6.0" + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/graph/constants.go b/ccore/nebula/internal/thrift/v2_6_0/graph/constants.go new file mode 100644 index 0000000..c695727 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/graph/constants.go @@ -0,0 +1,28 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/graph/graph_service-remote/graph_service-remote.go b/ccore/nebula/internal/thrift/v2_6_0/graph/graph_service-remote/graph_service-remote.go new file mode 100755 index 0000000..c441b35 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/graph/graph_service-remote/graph_service-remote.go @@ -0,0 +1,212 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/graph" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AuthResponse authenticate(string username, string password)") + fmt.Fprintln(os.Stderr, " void signout(i64 sessionId)") + fmt.Fprintln(os.Stderr, " ExecutionResponse execute(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " string executeJson(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := graph.NewGraphServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "authenticate": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Authenticate requires 2 args") + flag.Usage() + } + argvalue0 := []byte(flag.Arg(1)) + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Authenticate(value0, value1)) + fmt.Print("\n") + break + case "signout": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Signout requires 1 args") + flag.Usage() + } + argvalue0, err13 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err13 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Signout(value0)) + fmt.Print("\n") + break + case "execute": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Execute requires 2 args") + flag.Usage() + } + argvalue0, err14 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err14 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Execute(value0, value1)) + fmt.Print("\n") + break + case "executeJson": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "ExecuteJson requires 2 args") + flag.Usage() + } + argvalue0, err16 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err16 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.ExecuteJson(value0, value1)) + fmt.Print("\n") + break + case "verifyClientVersion": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "VerifyClientVersion requires 1 args") + flag.Usage() + } + arg18 := flag.Arg(1) + mbTrans19 := thrift.NewMemoryBufferLen(len(arg18)) + defer mbTrans19.Close() + _, err20 := mbTrans19.WriteString(arg18) + if err20 != nil { + Usage() + return + } + factory21 := thrift.NewSimpleJSONProtocolFactory() + jsProt22 := factory21.GetProtocol(mbTrans19) + argvalue0 := graph.NewVerifyClientVersionReq() + err23 := argvalue0.Read(jsProt22) + if err23 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.VerifyClientVersion(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_6_0/graph/graphservice.go b/ccore/nebula/internal/thrift/v2_6_0/graph/graphservice.go new file mode 100644 index 0000000..37eb6ea --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/graph/graphservice.go @@ -0,0 +1,1640 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type GraphService interface { + // Parameters: + // - Username + // - Password + Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(ctx context.Context, sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) + // Parameters: + // - Req + VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) +} + +type GraphServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Username + // - Password + Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) + // Parameters: + // - SessionId + Signout(sessionId int64) (err error) + // Parameters: + // - SessionId + // - Stmt + Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) + // Parameters: + // - Req + VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) +} + +type GraphServiceClient struct { + GraphServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceClient { + return &GraphServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceClientProtocol(prot thrift.Protocol) *GraphServiceClient { + return NewGraphServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceClient) Signout(sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphServiceClient) VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + args := GraphServiceVerifyClientVersionArgs{ + Req : req, + } + err = p.CC.SendMsg("verifyClientVersion", &args, thrift.CALL) + if err != nil { return } + return p.recvVerifyClientVersion() +} + + +func (p *GraphServiceClient) recvVerifyClientVersion() (value *VerifyClientVersionResp, err error) { + var result GraphServiceVerifyClientVersionResult + err = p.CC.RecvMsg("verifyClientVersion", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceThreadsafeClient struct { + GraphServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphServiceThreadsafeClient { + return &GraphServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphServiceThreadsafeClient { + return NewGraphServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceThreadsafeClient) Authenticate(username []byte, password []byte) (_r *AuthResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + err = p.CC.SendMsg("authenticate", &args, thrift.CALL) + if err != nil { return } + return p.recvAuthenticate() +} + + +func (p *GraphServiceThreadsafeClient) recvAuthenticate() (value *AuthResponse, err error) { + var result GraphServiceAuthenticateResult + err = p.CC.RecvMsg("authenticate", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceThreadsafeClient) Signout(sessionId int64) (err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.CC.SendMsg("signout", &args, thrift.ONEWAY) + if err != nil { return } + return +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) Execute(sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("execute", &args, thrift.CALL) + if err != nil { return } + return p.recvExecute() +} + + +func (p *GraphServiceThreadsafeClient) recvExecute() (value *ExecutionResponse, err error) { + var result GraphServiceExecuteResult + err = p.CC.RecvMsg("execute", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceThreadsafeClient) ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + err = p.CC.SendMsg("executeJson", &args, thrift.CALL) + if err != nil { return } + return p.recvExecuteJson() +} + + +func (p *GraphServiceThreadsafeClient) recvExecuteJson() (value []byte, err error) { + var result GraphServiceExecuteJsonResult + err = p.CC.RecvMsg("executeJson", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphServiceThreadsafeClient) VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphServiceVerifyClientVersionArgs{ + Req : req, + } + err = p.CC.SendMsg("verifyClientVersion", &args, thrift.CALL) + if err != nil { return } + return p.recvVerifyClientVersion() +} + + +func (p *GraphServiceThreadsafeClient) recvVerifyClientVersion() (value *VerifyClientVersionResp, err error) { + var result GraphServiceVerifyClientVersionResult + err = p.CC.RecvMsg("verifyClientVersion", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphServiceChannelClient(channel thrift.RequestChannel) *GraphServiceChannelClient { + return &GraphServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceChannelClient) Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, err error) { + args := GraphServiceAuthenticateArgs{ + Username : username, + Password : password, + } + var result GraphServiceAuthenticateResult + err = p.RequestChannel.Call(ctx, "authenticate", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +func (p *GraphServiceChannelClient) Signout(ctx context.Context, sessionId int64) (err error) { + args := GraphServiceSignoutArgs{ + SessionId : sessionId, + } + err = p.RequestChannel.Oneway(ctx, "signout", &args) + if err != nil { return } + + return nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, err error) { + args := GraphServiceExecuteArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteResult + err = p.RequestChannel.Call(ctx, "execute", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceChannelClient) ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) { + args := GraphServiceExecuteJsonArgs{ + SessionId : sessionId, + Stmt : stmt, + } + var result GraphServiceExecuteJsonResult + err = p.RequestChannel.Call(ctx, "executeJson", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphServiceChannelClient) VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + args := GraphServiceVerifyClientVersionArgs{ + Req : req, + } + var result GraphServiceVerifyClientVersionResult + err = p.RequestChannel.Call(ctx, "verifyClientVersion", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphService +} + +func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { + self9 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self9.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} + self9.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} + self9.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} + self9.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} + self9.processorMap["verifyClientVersion"] = &graphServiceProcessorVerifyClientVersion{handler:handler} + return self9 +} + +type graphServiceProcessorAuthenticate struct { + handler GraphService +} + +func (p *graphServiceProcessorAuthenticate) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceAuthenticateArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorAuthenticate) 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("authenticate", 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 *graphServiceProcessorAuthenticate) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceAuthenticateArgs) + var result GraphServiceAuthenticateResult + if retval, err := p.handler.Authenticate(ctx, args.Username, args.Password); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing authenticate: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorSignout struct { + handler GraphService +} + +func (p *graphServiceProcessorSignout) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceSignoutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorSignout) 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("signout", 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 *graphServiceProcessorSignout) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceSignoutArgs) + if err := p.handler.Signout(ctx, args.SessionId); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signout: " + err.Error()) + return x, x + } + } + return nil, nil +} + +type graphServiceProcessorExecute struct { + handler GraphService +} + +func (p *graphServiceProcessorExecute) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecute) 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("execute", 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 *graphServiceProcessorExecute) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteArgs) + var result GraphServiceExecuteResult + if retval, err := p.handler.Execute(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing execute: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorExecuteJson struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJson) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceExecuteJsonArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorExecuteJson) 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("executeJson", 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 *graphServiceProcessorExecuteJson) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceExecuteJsonArgs) + var result GraphServiceExecuteJsonResult + if retval, err := p.handler.ExecuteJson(ctx, args.SessionId, args.Stmt); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJson: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphServiceProcessorVerifyClientVersion struct { + handler GraphService +} + +func (p *graphServiceProcessorVerifyClientVersion) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphServiceVerifyClientVersionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphServiceProcessorVerifyClientVersion) 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("verifyClientVersion", 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 *graphServiceProcessorVerifyClientVersion) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphServiceVerifyClientVersionArgs) + var result GraphServiceVerifyClientVersionResult + if retval, err := p.handler.VerifyClientVersion(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyClientVersion: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Username +// - Password +type GraphServiceAuthenticateArgs struct { + thrift.IRequest + Username []byte `thrift:"username,1" db:"username" json:"username"` + Password []byte `thrift:"password,2" db:"password" json:"password"` +} + +func NewGraphServiceAuthenticateArgs() *GraphServiceAuthenticateArgs { + return &GraphServiceAuthenticateArgs{} +} + + +func (p *GraphServiceAuthenticateArgs) GetUsername() []byte { + return p.Username +} + +func (p *GraphServiceAuthenticateArgs) GetPassword() []byte { + return p.Password +} +func (p *GraphServiceAuthenticateArgs) 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 *GraphServiceAuthenticateArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Username = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Password = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 := 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 *GraphServiceAuthenticateArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("username", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:username: ", p), err) } + if err := oprot.WriteBinary(p.Username); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:username: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("password", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:password: ", p), err) } + if err := oprot.WriteBinary(p.Password); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:password: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) String() string { + if p == nil { + return "" + } + + usernameVal := fmt.Sprintf("%v", p.Username) + passwordVal := fmt.Sprintf("%v", p.Password) + return fmt.Sprintf("GraphServiceAuthenticateArgs({Username:%s Password:%s})", usernameVal, passwordVal) +} + +// Attributes: +// - Success +type GraphServiceAuthenticateResult struct { + thrift.IResponse + Success *AuthResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceAuthenticateResult() *GraphServiceAuthenticateResult { + return &GraphServiceAuthenticateResult{} +} + +var GraphServiceAuthenticateResult_Success_DEFAULT *AuthResponse +func (p *GraphServiceAuthenticateResult) GetSuccess() *AuthResponse { + if !p.IsSetSuccess() { + return GraphServiceAuthenticateResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceAuthenticateResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAuthResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("authenticate_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 *GraphServiceAuthenticateResult) 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 *GraphServiceAuthenticateResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceAuthenticateResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +type GraphServiceSignoutArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` +} + +func NewGraphServiceSignoutArgs() *GraphServiceSignoutArgs { + return &GraphServiceSignoutArgs{} +} + + +func (p *GraphServiceSignoutArgs) GetSessionId() int64 { + return p.SessionId +} +func (p *GraphServiceSignoutArgs) 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 *GraphServiceSignoutArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceSignoutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signout_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 *GraphServiceSignoutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceSignoutArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + return fmt.Sprintf("GraphServiceSignoutArgs({SessionId:%s})", sessionIdVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteArgs() *GraphServiceExecuteArgs { + return &GraphServiceExecuteArgs{} +} + + +func (p *GraphServiceExecuteArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteArgs) 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 *GraphServiceExecuteArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 := 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 *GraphServiceExecuteArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteResult struct { + thrift.IResponse + Success *ExecutionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteResult() *GraphServiceExecuteResult { + return &GraphServiceExecuteResult{} +} + +var GraphServiceExecuteResult_Success_DEFAULT *ExecutionResponse +func (p *GraphServiceExecuteResult) GetSuccess() *ExecutionResponse { + if !p.IsSetSuccess() { + return GraphServiceExecuteResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceExecuteResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecutionResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("execute_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 *GraphServiceExecuteResult) 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 *GraphServiceExecuteResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceExecuteResult({Success:%s})", successVal) +} + +// Attributes: +// - SessionId +// - Stmt +type GraphServiceExecuteJsonArgs struct { + thrift.IRequest + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` +} + +func NewGraphServiceExecuteJsonArgs() *GraphServiceExecuteJsonArgs { + return &GraphServiceExecuteJsonArgs{} +} + + +func (p *GraphServiceExecuteJsonArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteJsonArgs) GetStmt() []byte { + return p.Stmt +} +func (p *GraphServiceExecuteJsonArgs) 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 *GraphServiceExecuteJsonArgs) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 := 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 *GraphServiceExecuteJsonArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) String() string { + if p == nil { + return "" + } + + sessionIdVal := fmt.Sprintf("%v", p.SessionId) + stmtVal := fmt.Sprintf("%v", p.Stmt) + return fmt.Sprintf("GraphServiceExecuteJsonArgs({SessionId:%s Stmt:%s})", sessionIdVal, stmtVal) +} + +// Attributes: +// - Success +type GraphServiceExecuteJsonResult struct { + thrift.IResponse + Success []byte `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteJsonResult() *GraphServiceExecuteJsonResult { + return &GraphServiceExecuteJsonResult{} +} + +var GraphServiceExecuteJsonResult_Success_DEFAULT []byte + +func (p *GraphServiceExecuteJsonResult) GetSuccess() []byte { + return p.Success +} +func (p *GraphServiceExecuteJsonResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceExecuteJsonResult) 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 *GraphServiceExecuteJsonResult) ReadField0(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("executeJson_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 *GraphServiceExecuteJsonResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteJsonResult) String() string { + if p == nil { + return "" + } + + successVal := fmt.Sprintf("%v", p.Success) + return fmt.Sprintf("GraphServiceExecuteJsonResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphServiceVerifyClientVersionArgs struct { + thrift.IRequest + Req *VerifyClientVersionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphServiceVerifyClientVersionArgs() *GraphServiceVerifyClientVersionArgs { + return &GraphServiceVerifyClientVersionArgs{ + Req: NewVerifyClientVersionReq(), + } +} + +var GraphServiceVerifyClientVersionArgs_Req_DEFAULT *VerifyClientVersionReq +func (p *GraphServiceVerifyClientVersionArgs) GetReq() *VerifyClientVersionReq { + if !p.IsSetReq() { + return GraphServiceVerifyClientVersionArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphServiceVerifyClientVersionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphServiceVerifyClientVersionArgs) 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 *GraphServiceVerifyClientVersionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewVerifyClientVersionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("verifyClientVersion_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 *GraphServiceVerifyClientVersionArgs) 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 *GraphServiceVerifyClientVersionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphServiceVerifyClientVersionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphServiceVerifyClientVersionResult struct { + thrift.IResponse + Success *VerifyClientVersionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceVerifyClientVersionResult() *GraphServiceVerifyClientVersionResult { + return &GraphServiceVerifyClientVersionResult{} +} + +var GraphServiceVerifyClientVersionResult_Success_DEFAULT *VerifyClientVersionResp +func (p *GraphServiceVerifyClientVersionResult) GetSuccess() *VerifyClientVersionResp { + if !p.IsSetSuccess() { + return GraphServiceVerifyClientVersionResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceVerifyClientVersionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphServiceVerifyClientVersionResult) 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 *GraphServiceVerifyClientVersionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewVerifyClientVersionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("verifyClientVersion_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 *GraphServiceVerifyClientVersionResult) 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 *GraphServiceVerifyClientVersionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphServiceVerifyClientVersionResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_6_0/graph/ttypes.go b/ccore/nebula/internal/thrift/v2_6_0/graph/ttypes.go new file mode 100644 index 0000000..a33f6b2 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/graph/ttypes.go @@ -0,0 +1,1945 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package graph + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +// Attributes: +// - Rows +// - ExecDurationInUs +// - TotalDurationInUs +// - OtherStats +type ProfilingStats struct { + Rows int64 `thrift:"rows,1,required" db:"rows" json:"rows"` + ExecDurationInUs int64 `thrift:"exec_duration_in_us,2,required" db:"exec_duration_in_us" json:"exec_duration_in_us"` + TotalDurationInUs int64 `thrift:"total_duration_in_us,3,required" db:"total_duration_in_us" json:"total_duration_in_us"` + OtherStats map[string][]byte `thrift:"other_stats,4" db:"other_stats" json:"other_stats,omitempty"` +} + +func NewProfilingStats() *ProfilingStats { + return &ProfilingStats{} +} + + +func (p *ProfilingStats) GetRows() int64 { + return p.Rows +} + +func (p *ProfilingStats) GetExecDurationInUs() int64 { + return p.ExecDurationInUs +} + +func (p *ProfilingStats) GetTotalDurationInUs() int64 { + return p.TotalDurationInUs +} +var ProfilingStats_OtherStats_DEFAULT map[string][]byte + +func (p *ProfilingStats) GetOtherStats() map[string][]byte { + return p.OtherStats +} +func (p *ProfilingStats) IsSetOtherStats() bool { + return p != nil && p.OtherStats != nil +} + +func (p *ProfilingStats) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRows bool = false; + var issetExecDurationInUs bool = false; + var issetTotalDurationInUs 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 + } + issetRows = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetExecDurationInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetTotalDurationInUs = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRows{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetExecDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExecDurationInUs is not set")); + } + if !issetTotalDurationInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TotalDurationInUs is not set")); + } + return nil +} + +func (p *ProfilingStats) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Rows = v +} + return nil +} + +func (p *ProfilingStats) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExecDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TotalDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.OtherStats = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.OtherStats[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ProfilingStats) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ProfilingStats"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ProfilingStats) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:rows: ", p), err) } + if err := oprot.WriteI64(int64(p.Rows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:rows: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("exec_duration_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:exec_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.ExecDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.exec_duration_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:exec_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("total_duration_in_us", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:total_duration_in_us: ", p), err) } + if err := oprot.WriteI64(int64(p.TotalDurationInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total_duration_in_us (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:total_duration_in_us: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetOtherStats() { + if err := oprot.WriteFieldBegin("other_stats", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:other_stats: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.OtherStats)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.OtherStats { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:other_stats: ", p), err) } + } + return err +} + +func (p *ProfilingStats) String() string { + if p == nil { + return "" + } + + rowsVal := fmt.Sprintf("%v", p.Rows) + execDurationInUsVal := fmt.Sprintf("%v", p.ExecDurationInUs) + totalDurationInUsVal := fmt.Sprintf("%v", p.TotalDurationInUs) + otherStatsVal := fmt.Sprintf("%v", p.OtherStats) + return fmt.Sprintf("ProfilingStats({Rows:%s ExecDurationInUs:%s TotalDurationInUs:%s OtherStats:%s})", rowsVal, execDurationInUsVal, totalDurationInUsVal, otherStatsVal) +} + +// Attributes: +// - IsDoBranch +// - ConditionNodeID +type PlanNodeBranchInfo struct { + IsDoBranch bool `thrift:"is_do_branch,1,required" db:"is_do_branch" json:"is_do_branch"` + ConditionNodeID int64 `thrift:"condition_node_id,2,required" db:"condition_node_id" json:"condition_node_id"` +} + +func NewPlanNodeBranchInfo() *PlanNodeBranchInfo { + return &PlanNodeBranchInfo{} +} + + +func (p *PlanNodeBranchInfo) GetIsDoBranch() bool { + return p.IsDoBranch +} + +func (p *PlanNodeBranchInfo) GetConditionNodeID() int64 { + return p.ConditionNodeID +} +func (p *PlanNodeBranchInfo) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetIsDoBranch bool = false; + var issetConditionNodeID 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 + } + issetIsDoBranch = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetConditionNodeID = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetIsDoBranch{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsDoBranch is not set")); + } + if !issetConditionNodeID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ConditionNodeID is not set")); + } + return nil +} + +func (p *PlanNodeBranchInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.IsDoBranch = v +} + return nil +} + +func (p *PlanNodeBranchInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ConditionNodeID = v +} + return nil +} + +func (p *PlanNodeBranchInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeBranchInfo"); 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 *PlanNodeBranchInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_do_branch", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:is_do_branch: ", p), err) } + if err := oprot.WriteBool(bool(p.IsDoBranch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_do_branch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:is_do_branch: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("condition_node_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:condition_node_id: ", p), err) } + if err := oprot.WriteI64(int64(p.ConditionNodeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition_node_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:condition_node_id: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) String() string { + if p == nil { + return "" + } + + isDoBranchVal := fmt.Sprintf("%v", p.IsDoBranch) + conditionNodeIDVal := fmt.Sprintf("%v", p.ConditionNodeID) + return fmt.Sprintf("PlanNodeBranchInfo({IsDoBranch:%s ConditionNodeID:%s})", isDoBranchVal, conditionNodeIDVal) +} + +// Attributes: +// - Key +// - Value +type Pair struct { + Key []byte `thrift:"key,1,required" db:"key" json:"key"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewPair() *Pair { + return &Pair{} +} + + +func (p *Pair) GetKey() []byte { + return p.Key +} + +func (p *Pair) GetValue() []byte { + return p.Value +} +func (p *Pair) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKey bool = false; + var issetValue 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 + } + issetKey = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetKey{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *Pair) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *Pair) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *Pair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Pair"); 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 *Pair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *Pair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *Pair) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("Pair({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - Name +// - Id +// - OutputVar +// - Description +// - Profiles +// - BranchInfo +// - Dependencies +type PlanNodeDescription struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Id int64 `thrift:"id,2,required" db:"id" json:"id"` + OutputVar []byte `thrift:"output_var,3,required" db:"output_var" json:"output_var"` + Description []*Pair `thrift:"description,4" db:"description" json:"description,omitempty"` + Profiles []*ProfilingStats `thrift:"profiles,5" db:"profiles" json:"profiles,omitempty"` + BranchInfo *PlanNodeBranchInfo `thrift:"branch_info,6" db:"branch_info" json:"branch_info,omitempty"` + Dependencies []int64 `thrift:"dependencies,7" db:"dependencies" json:"dependencies,omitempty"` +} + +func NewPlanNodeDescription() *PlanNodeDescription { + return &PlanNodeDescription{} +} + + +func (p *PlanNodeDescription) GetName() []byte { + return p.Name +} + +func (p *PlanNodeDescription) GetId() int64 { + return p.Id +} + +func (p *PlanNodeDescription) GetOutputVar() []byte { + return p.OutputVar +} +var PlanNodeDescription_Description_DEFAULT []*Pair + +func (p *PlanNodeDescription) GetDescription() []*Pair { + return p.Description +} +var PlanNodeDescription_Profiles_DEFAULT []*ProfilingStats + +func (p *PlanNodeDescription) GetProfiles() []*ProfilingStats { + return p.Profiles +} +var PlanNodeDescription_BranchInfo_DEFAULT *PlanNodeBranchInfo +func (p *PlanNodeDescription) GetBranchInfo() *PlanNodeBranchInfo { + if !p.IsSetBranchInfo() { + return PlanNodeDescription_BranchInfo_DEFAULT + } +return p.BranchInfo +} +var PlanNodeDescription_Dependencies_DEFAULT []int64 + +func (p *PlanNodeDescription) GetDependencies() []int64 { + return p.Dependencies +} +func (p *PlanNodeDescription) IsSetDescription() bool { + return p != nil && p.Description != nil +} + +func (p *PlanNodeDescription) IsSetProfiles() bool { + return p != nil && p.Profiles != nil +} + +func (p *PlanNodeDescription) IsSetBranchInfo() bool { + return p != nil && p.BranchInfo != nil +} + +func (p *PlanNodeDescription) IsSetDependencies() bool { + return p != nil && p.Dependencies != nil +} + +func (p *PlanNodeDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetId bool = false; + var issetOutputVar 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetId = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetOutputVar = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetId{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Id is not set")); + } + if !issetOutputVar{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OutputVar is not set")); + } + return nil +} + +func (p *PlanNodeDescription) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OutputVar = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Pair, 0, size) + p.Description = tSlice + for i := 0; i < size; i ++ { + _elem3 := NewPair() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Description = append(p.Description, _elem3) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ProfilingStats, 0, size) + p.Profiles = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewProfilingStats() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Profiles = append(p.Profiles, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField6(iprot thrift.Protocol) error { + p.BranchInfo = NewPlanNodeBranchInfo() + if err := p.BranchInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BranchInfo), err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Dependencies = tSlice + for i := 0; i < size; i ++ { +var _elem5 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Dependencies = append(p.Dependencies, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanNodeDescription"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeDescription) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("output_var", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:output_var: ", p), err) } + if err := oprot.WriteBinary(p.OutputVar); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.output_var (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:output_var: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetDescription() { + if err := oprot.WriteFieldBegin("description", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:description: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Description)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Description { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:description: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetProfiles() { + if err := oprot.WriteFieldBegin("profiles", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:profiles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Profiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Profiles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:profiles: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetBranchInfo() { + if err := oprot.WriteFieldBegin("branch_info", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:branch_info: ", p), err) } + if err := p.BranchInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BranchInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:branch_info: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetDependencies() { + if err := oprot.WriteFieldBegin("dependencies", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dependencies: ", p), err) } + if err := oprot.WriteListBegin(thrift.I64, len(p.Dependencies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dependencies { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dependencies: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + idVal := fmt.Sprintf("%v", p.Id) + outputVarVal := fmt.Sprintf("%v", p.OutputVar) + descriptionVal := fmt.Sprintf("%v", p.Description) + profilesVal := fmt.Sprintf("%v", p.Profiles) + var branchInfoVal string + if p.BranchInfo == nil { + branchInfoVal = "" + } else { + branchInfoVal = fmt.Sprintf("%v", p.BranchInfo) + } + dependenciesVal := fmt.Sprintf("%v", p.Dependencies) + return fmt.Sprintf("PlanNodeDescription({Name:%s Id:%s OutputVar:%s Description:%s Profiles:%s BranchInfo:%s Dependencies:%s})", nameVal, idVal, outputVarVal, descriptionVal, profilesVal, branchInfoVal, dependenciesVal) +} + +// Attributes: +// - PlanNodeDescs +// - NodeIndexMap +// - Format +// - OptimizeTimeInUs +type PlanDescription struct { + PlanNodeDescs []*PlanNodeDescription `thrift:"plan_node_descs,1,required" db:"plan_node_descs" json:"plan_node_descs"` + NodeIndexMap map[int64]int64 `thrift:"node_index_map,2,required" db:"node_index_map" json:"node_index_map"` + Format []byte `thrift:"format,3,required" db:"format" json:"format"` + OptimizeTimeInUs int32 `thrift:"optimize_time_in_us,4,required" db:"optimize_time_in_us" json:"optimize_time_in_us"` +} + +func NewPlanDescription() *PlanDescription { + return &PlanDescription{} +} + + +func (p *PlanDescription) GetPlanNodeDescs() []*PlanNodeDescription { + return p.PlanNodeDescs +} + +func (p *PlanDescription) GetNodeIndexMap() map[int64]int64 { + return p.NodeIndexMap +} + +func (p *PlanDescription) GetFormat() []byte { + return p.Format +} + +func (p *PlanDescription) GetOptimizeTimeInUs() int32 { + return p.OptimizeTimeInUs +} +func (p *PlanDescription) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPlanNodeDescs bool = false; + var issetNodeIndexMap bool = false; + var issetFormat bool = false; + var issetOptimizeTimeInUs 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 + } + issetPlanNodeDescs = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetNodeIndexMap = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetFormat = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetOptimizeTimeInUs = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPlanNodeDescs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PlanNodeDescs is not set")); + } + if !issetNodeIndexMap{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NodeIndexMap is not set")); + } + if !issetFormat{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Format is not set")); + } + if !issetOptimizeTimeInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OptimizeTimeInUs is not set")); + } + return nil +} + +func (p *PlanDescription) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PlanNodeDescription, 0, size) + p.PlanNodeDescs = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewPlanNodeDescription() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.PlanNodeDescs = append(p.PlanNodeDescs, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[int64]int64, size) + p.NodeIndexMap = tMap + for i := 0; i < size; i ++ { +var _key7 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} +var _val8 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val8 = v +} + p.NodeIndexMap[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Format = v +} + return nil +} + +func (p *PlanDescription) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OptimizeTimeInUs = v +} + return nil +} + +func (p *PlanDescription) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PlanDescription"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanDescription) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("plan_node_descs", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:plan_node_descs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PlanNodeDescs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PlanNodeDescs { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:plan_node_descs: ", p), err) } + return err +} + +func (p *PlanDescription) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node_index_map", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:node_index_map: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.NodeIndexMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NodeIndexMap { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node_index_map: ", p), err) } + return err +} + +func (p *PlanDescription) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("format", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:format: ", p), err) } + if err := oprot.WriteBinary(p.Format); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.format (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:format: ", p), err) } + return err +} + +func (p *PlanDescription) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("optimize_time_in_us", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:optimize_time_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.OptimizeTimeInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.optimize_time_in_us (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:optimize_time_in_us: ", p), err) } + return err +} + +func (p *PlanDescription) String() string { + if p == nil { + return "" + } + + planNodeDescsVal := fmt.Sprintf("%v", p.PlanNodeDescs) + nodeIndexMapVal := fmt.Sprintf("%v", p.NodeIndexMap) + formatVal := fmt.Sprintf("%v", p.Format) + optimizeTimeInUsVal := fmt.Sprintf("%v", p.OptimizeTimeInUs) + return fmt.Sprintf("PlanDescription({PlanNodeDescs:%s NodeIndexMap:%s Format:%s OptimizeTimeInUs:%s})", planNodeDescsVal, nodeIndexMapVal, formatVal, optimizeTimeInUsVal) +} + +// Attributes: +// - ErrorCode +// - LatencyInUs +// - Data +// - SpaceName +// - ErrorMsg +// - PlanDesc +// - Comment +type ExecutionResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + Data *nebula0.DataSet `thrift:"data,3" db:"data" json:"data,omitempty"` + SpaceName []byte `thrift:"space_name,4" db:"space_name" json:"space_name,omitempty"` + ErrorMsg []byte `thrift:"error_msg,5" db:"error_msg" json:"error_msg,omitempty"` + PlanDesc *PlanDescription `thrift:"plan_desc,6" db:"plan_desc" json:"plan_desc,omitempty"` + Comment []byte `thrift:"comment,7" db:"comment" json:"comment,omitempty"` +} + +func NewExecutionResponse() *ExecutionResponse { + return &ExecutionResponse{} +} + + +func (p *ExecutionResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} + +func (p *ExecutionResponse) GetLatencyInUs() int32 { + return p.LatencyInUs +} +var ExecutionResponse_Data_DEFAULT *nebula0.DataSet +func (p *ExecutionResponse) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return ExecutionResponse_Data_DEFAULT + } +return p.Data +} +var ExecutionResponse_SpaceName_DEFAULT []byte + +func (p *ExecutionResponse) GetSpaceName() []byte { + return p.SpaceName +} +var ExecutionResponse_ErrorMsg_DEFAULT []byte + +func (p *ExecutionResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var ExecutionResponse_PlanDesc_DEFAULT *PlanDescription +func (p *ExecutionResponse) GetPlanDesc() *PlanDescription { + if !p.IsSetPlanDesc() { + return ExecutionResponse_PlanDesc_DEFAULT + } +return p.PlanDesc +} +var ExecutionResponse_Comment_DEFAULT []byte + +func (p *ExecutionResponse) GetComment() []byte { + return p.Comment +} +func (p *ExecutionResponse) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *ExecutionResponse) IsSetSpaceName() bool { + return p != nil && p.SpaceName != nil +} + +func (p *ExecutionResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *ExecutionResponse) IsSetPlanDesc() bool { + return p != nil && p.PlanDesc != nil +} + +func (p *ExecutionResponse) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ExecutionResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + var issetLatencyInUs 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 + } + issetErrorCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ExecutionResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *ExecutionResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ExecutionResponse) ReadField3(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ExecutionResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *ExecutionResponse) ReadField6(iprot thrift.Protocol) error { + p.PlanDesc = NewPlanDescription() + if err := p.PlanDesc.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PlanDesc), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ExecutionResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecutionResponse"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecutionResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceName() { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_name: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_msg: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetPlanDesc() { + if err := oprot.WriteFieldBegin("plan_desc", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:plan_desc: ", p), err) } + if err := p.PlanDesc.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PlanDesc), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:plan_desc: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:comment: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var planDescVal string + if p.PlanDesc == nil { + planDescVal = "" + } else { + planDescVal = fmt.Sprintf("%v", p.PlanDesc) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ExecutionResponse({ErrorCode:%s LatencyInUs:%s Data:%s SpaceName:%s ErrorMsg:%s PlanDesc:%s Comment:%s})", errorCodeVal, latencyInUsVal, dataVal, spaceNameVal, errorMsgVal, planDescVal, commentVal) +} + +// Attributes: +// - ErrorCode +// - ErrorMsg +// - SessionID +// - TimeZoneOffsetSeconds +// - TimeZoneName +type AuthResponse struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + ErrorMsg []byte `thrift:"error_msg,2" db:"error_msg" json:"error_msg,omitempty"` + SessionID *int64 `thrift:"session_id,3" db:"session_id" json:"session_id,omitempty"` + TimeZoneOffsetSeconds *int32 `thrift:"time_zone_offset_seconds,4" db:"time_zone_offset_seconds" json:"time_zone_offset_seconds,omitempty"` + TimeZoneName []byte `thrift:"time_zone_name,5" db:"time_zone_name" json:"time_zone_name,omitempty"` +} + +func NewAuthResponse() *AuthResponse { + return &AuthResponse{} +} + + +func (p *AuthResponse) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} +var AuthResponse_ErrorMsg_DEFAULT []byte + +func (p *AuthResponse) GetErrorMsg() []byte { + return p.ErrorMsg +} +var AuthResponse_SessionID_DEFAULT int64 +func (p *AuthResponse) GetSessionID() int64 { + if !p.IsSetSessionID() { + return AuthResponse_SessionID_DEFAULT + } +return *p.SessionID +} +var AuthResponse_TimeZoneOffsetSeconds_DEFAULT int32 +func (p *AuthResponse) GetTimeZoneOffsetSeconds() int32 { + if !p.IsSetTimeZoneOffsetSeconds() { + return AuthResponse_TimeZoneOffsetSeconds_DEFAULT + } +return *p.TimeZoneOffsetSeconds +} +var AuthResponse_TimeZoneName_DEFAULT []byte + +func (p *AuthResponse) GetTimeZoneName() []byte { + return p.TimeZoneName +} +func (p *AuthResponse) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *AuthResponse) IsSetSessionID() bool { + return p != nil && p.SessionID != nil +} + +func (p *AuthResponse) IsSetTimeZoneOffsetSeconds() bool { + return p != nil && p.TimeZoneOffsetSeconds != nil +} + +func (p *AuthResponse) IsSetTimeZoneName() bool { + return p != nil && p.TimeZoneName != nil +} + +func (p *AuthResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode 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 + } + issetErrorCode = true + 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 + } + 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) + } + if !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *AuthResponse) 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.ErrorCode = temp +} + return nil +} + +func (p *AuthResponse) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *AuthResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SessionID = &v +} + return nil +} + +func (p *AuthResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TimeZoneOffsetSeconds = &v +} + return nil +} + +func (p *AuthResponse) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.TimeZoneName = v +} + return nil +} + +func (p *AuthResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AuthResponse"); 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 *AuthResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *AuthResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session_id: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneOffsetSeconds() { + if err := oprot.WriteFieldBegin("time_zone_offset_seconds", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:time_zone_offset_seconds: ", p), err) } + if err := oprot.WriteI32(int32(*p.TimeZoneOffsetSeconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_offset_seconds (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:time_zone_offset_seconds: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetTimeZoneName() { + if err := oprot.WriteFieldBegin("time_zone_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:time_zone_name: ", p), err) } + if err := oprot.WriteBinary(p.TimeZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:time_zone_name: ", p), err) } + } + return err +} + +func (p *AuthResponse) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + var sessionIDVal string + if p.SessionID == nil { + sessionIDVal = "" + } else { + sessionIDVal = fmt.Sprintf("%v", *p.SessionID) + } + var timeZoneOffsetSecondsVal string + if p.TimeZoneOffsetSeconds == nil { + timeZoneOffsetSecondsVal = "" + } else { + timeZoneOffsetSecondsVal = fmt.Sprintf("%v", *p.TimeZoneOffsetSeconds) + } + timeZoneNameVal := fmt.Sprintf("%v", p.TimeZoneName) + return fmt.Sprintf("AuthResponse({ErrorCode:%s ErrorMsg:%s SessionID:%s TimeZoneOffsetSeconds:%s TimeZoneName:%s})", errorCodeVal, errorMsgVal, sessionIDVal, timeZoneOffsetSecondsVal, timeZoneNameVal) +} + +// Attributes: +// - ErrorCode +// - ErrorMsg +type VerifyClientVersionResp struct { + ErrorCode nebula0.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + ErrorMsg []byte `thrift:"error_msg,2" db:"error_msg" json:"error_msg,omitempty"` +} + +func NewVerifyClientVersionResp() *VerifyClientVersionResp { + return &VerifyClientVersionResp{} +} + + +func (p *VerifyClientVersionResp) GetErrorCode() nebula0.ErrorCode { + return p.ErrorCode +} +var VerifyClientVersionResp_ErrorMsg_DEFAULT []byte + +func (p *VerifyClientVersionResp) GetErrorMsg() []byte { + return p.ErrorMsg +} +func (p *VerifyClientVersionResp) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *VerifyClientVersionResp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode 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 + } + issetErrorCode = 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 !issetErrorCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *VerifyClientVersionResp) 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.ErrorCode = temp +} + return nil +} + +func (p *VerifyClientVersionResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *VerifyClientVersionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VerifyClientVersionResp"); 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 *VerifyClientVersionResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("error_code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } + if err := oprot.WriteI32(int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *VerifyClientVersionResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *VerifyClientVersionResp) String() string { + if p == nil { + return "" + } + + errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + return fmt.Sprintf("VerifyClientVersionResp({ErrorCode:%s ErrorMsg:%s})", errorCodeVal, errorMsgVal) +} + +// Attributes: +// - Version +type VerifyClientVersionReq struct { + Version []byte `thrift:"version,1,required" db:"version" json:"version"` +} + +func NewVerifyClientVersionReq() *VerifyClientVersionReq { + return &VerifyClientVersionReq{ + Version: []byte("2.6.0"), + } +} + + +func (p *VerifyClientVersionReq) GetVersion() []byte { + return p.Version +} +func (p *VerifyClientVersionReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetVersion 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 + } + issetVersion = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetVersion{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Version is not set")); + } + return nil +} + +func (p *VerifyClientVersionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *VerifyClientVersionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VerifyClientVersionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) String() string { + if p == nil { + return "" + } + + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("VerifyClientVersionReq({Version:%s})", versionVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/meta/constants.go b/ccore/nebula/internal/thrift/v2_6_0/meta/constants.go new file mode 100644 index 0000000..45f7147 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/meta/constants.go @@ -0,0 +1,29 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var const_lit_vid_type_type_length int16 = 8 + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/meta/meta_service-remote/meta_service-remote.go b/ccore/nebula/internal/thrift/v2_6_0/meta/meta_service-remote/meta_service-remote.go new file mode 100755 index 0000000..4c016ea --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/meta/meta_service-remote/meta_service-remote.go @@ -0,0 +1,2464 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResp createSpace(CreateSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSpace(DropSpaceReq req)") + fmt.Fprintln(os.Stderr, " GetSpaceResp getSpace(GetSpaceReq req)") + fmt.Fprintln(os.Stderr, " ListSpacesResp listSpaces(ListSpacesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createSpaceAs(CreateSpaceAsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTag(CreateTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterTag(AlterTagReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTag(DropTagReq req)") + fmt.Fprintln(os.Stderr, " GetTagResp getTag(GetTagReq req)") + fmt.Fprintln(os.Stderr, " ListTagsResp listTags(ListTagsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdge(CreateEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterEdge(AlterEdgeReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdge(DropEdgeReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeResp getEdge(GetEdgeReq req)") + fmt.Fprintln(os.Stderr, " ListEdgesResp listEdges(ListEdgesReq req)") + fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") + fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") + fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp multiPut(MultiPutReq req)") + fmt.Fprintln(os.Stderr, " GetResp get(GetReq req)") + fmt.Fprintln(os.Stderr, " MultiGetResp multiGet(MultiGetReq req)") + fmt.Fprintln(os.Stderr, " ExecResp remove(RemoveReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeRange(RemoveRangeReq req)") + fmt.Fprintln(os.Stderr, " ScanResp scan(ScanReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createTagIndex(CreateTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropTagIndex(DropTagIndexReq req)") + fmt.Fprintln(os.Stderr, " GetTagIndexResp getTagIndex(GetTagIndexReq req)") + fmt.Fprintln(os.Stderr, " ListTagIndexesResp listTagIndexes(ListTagIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildTagIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listTagIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createEdgeIndex(CreateEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropEdgeIndex(DropEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " GetEdgeIndexResp getEdgeIndex(GetEdgeIndexReq req)") + fmt.Fprintln(os.Stderr, " ListEdgeIndexesResp listEdgeIndexes(ListEdgeIndexesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp rebuildEdgeIndex(RebuildIndexReq req)") + fmt.Fprintln(os.Stderr, " ListIndexStatusResp listEdgeIndexStatus(ListIndexStatusReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createUser(CreateUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropUser(DropUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterUser(AlterUserReq req)") + fmt.Fprintln(os.Stderr, " ExecResp grantRole(GrantRoleReq req)") + fmt.Fprintln(os.Stderr, " ExecResp revokeRole(RevokeRoleReq req)") + fmt.Fprintln(os.Stderr, " ListUsersResp listUsers(ListUsersReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp listRoles(ListRolesReq req)") + fmt.Fprintln(os.Stderr, " ListRolesResp getUserRoles(GetUserRolesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp changePassword(ChangePasswordReq req)") + fmt.Fprintln(os.Stderr, " HBResp heartBeat(HBReq req)") + fmt.Fprintln(os.Stderr, " BalanceResp balance(BalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp leaderBalance(LeaderBalanceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp regConfig(RegConfigReq req)") + fmt.Fprintln(os.Stderr, " GetConfigResp getConfig(GetConfigReq req)") + fmt.Fprintln(os.Stderr, " ExecResp setConfig(SetConfigReq req)") + fmt.Fprintln(os.Stderr, " ListConfigsResp listConfigs(ListConfigsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createSnapshot(CreateSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSnapshot(DropSnapshotReq req)") + fmt.Fprintln(os.Stderr, " ListSnapshotsResp listSnapshots(ListSnapshotsReq req)") + fmt.Fprintln(os.Stderr, " AdminJobResp runAdminJob(AdminJobReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZone(AddZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostIntoZone(AddHostIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHostFromZone(DropHostFromZoneReq req)") + fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") + fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addGroup(AddGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropGroup(DropGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addZoneIntoGroup(AddZoneIntoGroupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZoneFromGroup(DropZoneFromGroupReq req)") + fmt.Fprintln(os.Stderr, " GetGroupResp getGroup(GetGroupReq req)") + fmt.Fprintln(os.Stderr, " ListGroupsResp listGroups(ListGroupsReq req)") + fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") + fmt.Fprintln(os.Stderr, " ExecResp restoreMeta(RestoreMetaReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addListener(AddListenerReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeListener(RemoveListenerReq req)") + fmt.Fprintln(os.Stderr, " ListListenerResp listListener(ListListenerReq req)") + fmt.Fprintln(os.Stderr, " GetStatsResp getStats(GetStatsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signInFTService(SignInFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signOutFTService(SignOutFTServiceReq req)") + fmt.Fprintln(os.Stderr, " ListFTClientsResp listFTClients(ListFTClientsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp createFTIndex(CreateFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropFTIndex(DropFTIndexReq req)") + fmt.Fprintln(os.Stderr, " ListFTIndexesResp listFTIndexes(ListFTIndexesReq req)") + fmt.Fprintln(os.Stderr, " CreateSessionResp createSession(CreateSessionReq req)") + fmt.Fprintln(os.Stderr, " UpdateSessionsResp updateSessions(UpdateSessionsReq req)") + fmt.Fprintln(os.Stderr, " ListSessionsResp listSessions(ListSessionsReq req)") + fmt.Fprintln(os.Stderr, " GetSessionResp getSession(GetSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp removeSession(RemoveSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp killQuery(KillQueryReq req)") + fmt.Fprintln(os.Stderr, " ExecResp reportTaskFinish(ReportTaskReq req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listCluster(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr, " GetMetaDirInfoResp getMetaDirInfo(GetMetaDirInfoReq req)") + fmt.Fprintln(os.Stderr, " VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := meta.NewMetaServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "createSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") + flag.Usage() + } + arg99 := flag.Arg(1) + mbTrans100 := thrift.NewMemoryBufferLen(len(arg99)) + defer mbTrans100.Close() + _, err101 := mbTrans100.WriteString(arg99) + if err101 != nil { + Usage() + return + } + factory102 := thrift.NewSimpleJSONProtocolFactory() + jsProt103 := factory102.GetProtocol(mbTrans100) + argvalue0 := meta.NewCreateSpaceReq() + err104 := argvalue0.Read(jsProt103) + if err104 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpace(value0)) + fmt.Print("\n") + break + case "dropSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") + flag.Usage() + } + arg105 := flag.Arg(1) + mbTrans106 := thrift.NewMemoryBufferLen(len(arg105)) + defer mbTrans106.Close() + _, err107 := mbTrans106.WriteString(arg105) + if err107 != nil { + Usage() + return + } + factory108 := thrift.NewSimpleJSONProtocolFactory() + jsProt109 := factory108.GetProtocol(mbTrans106) + argvalue0 := meta.NewDropSpaceReq() + err110 := argvalue0.Read(jsProt109) + if err110 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSpace(value0)) + fmt.Print("\n") + break + case "getSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") + flag.Usage() + } + arg111 := flag.Arg(1) + mbTrans112 := thrift.NewMemoryBufferLen(len(arg111)) + defer mbTrans112.Close() + _, err113 := mbTrans112.WriteString(arg111) + if err113 != nil { + Usage() + return + } + factory114 := thrift.NewSimpleJSONProtocolFactory() + jsProt115 := factory114.GetProtocol(mbTrans112) + argvalue0 := meta.NewGetSpaceReq() + err116 := argvalue0.Read(jsProt115) + if err116 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSpace(value0)) + fmt.Print("\n") + break + case "listSpaces": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") + flag.Usage() + } + arg117 := flag.Arg(1) + mbTrans118 := thrift.NewMemoryBufferLen(len(arg117)) + defer mbTrans118.Close() + _, err119 := mbTrans118.WriteString(arg117) + if err119 != nil { + Usage() + return + } + factory120 := thrift.NewSimpleJSONProtocolFactory() + jsProt121 := factory120.GetProtocol(mbTrans118) + argvalue0 := meta.NewListSpacesReq() + err122 := argvalue0.Read(jsProt121) + if err122 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSpaces(value0)) + fmt.Print("\n") + break + case "createSpaceAs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpaceAs requires 1 args") + flag.Usage() + } + arg123 := flag.Arg(1) + mbTrans124 := thrift.NewMemoryBufferLen(len(arg123)) + defer mbTrans124.Close() + _, err125 := mbTrans124.WriteString(arg123) + if err125 != nil { + Usage() + return + } + factory126 := thrift.NewSimpleJSONProtocolFactory() + jsProt127 := factory126.GetProtocol(mbTrans124) + argvalue0 := meta.NewCreateSpaceAsReq() + err128 := argvalue0.Read(jsProt127) + if err128 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpaceAs(value0)) + fmt.Print("\n") + break + case "createTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") + flag.Usage() + } + arg129 := flag.Arg(1) + mbTrans130 := thrift.NewMemoryBufferLen(len(arg129)) + defer mbTrans130.Close() + _, err131 := mbTrans130.WriteString(arg129) + if err131 != nil { + Usage() + return + } + factory132 := thrift.NewSimpleJSONProtocolFactory() + jsProt133 := factory132.GetProtocol(mbTrans130) + argvalue0 := meta.NewCreateTagReq() + err134 := argvalue0.Read(jsProt133) + if err134 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTag(value0)) + fmt.Print("\n") + break + case "alterTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") + flag.Usage() + } + arg135 := flag.Arg(1) + mbTrans136 := thrift.NewMemoryBufferLen(len(arg135)) + defer mbTrans136.Close() + _, err137 := mbTrans136.WriteString(arg135) + if err137 != nil { + Usage() + return + } + factory138 := thrift.NewSimpleJSONProtocolFactory() + jsProt139 := factory138.GetProtocol(mbTrans136) + argvalue0 := meta.NewAlterTagReq() + err140 := argvalue0.Read(jsProt139) + if err140 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterTag(value0)) + fmt.Print("\n") + break + case "dropTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTag requires 1 args") + flag.Usage() + } + arg141 := flag.Arg(1) + mbTrans142 := thrift.NewMemoryBufferLen(len(arg141)) + defer mbTrans142.Close() + _, err143 := mbTrans142.WriteString(arg141) + if err143 != nil { + Usage() + return + } + factory144 := thrift.NewSimpleJSONProtocolFactory() + jsProt145 := factory144.GetProtocol(mbTrans142) + argvalue0 := meta.NewDropTagReq() + err146 := argvalue0.Read(jsProt145) + if err146 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTag(value0)) + fmt.Print("\n") + break + case "getTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTag requires 1 args") + flag.Usage() + } + arg147 := flag.Arg(1) + mbTrans148 := thrift.NewMemoryBufferLen(len(arg147)) + defer mbTrans148.Close() + _, err149 := mbTrans148.WriteString(arg147) + if err149 != nil { + Usage() + return + } + factory150 := thrift.NewSimpleJSONProtocolFactory() + jsProt151 := factory150.GetProtocol(mbTrans148) + argvalue0 := meta.NewGetTagReq() + err152 := argvalue0.Read(jsProt151) + if err152 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTag(value0)) + fmt.Print("\n") + break + case "listTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTags requires 1 args") + flag.Usage() + } + arg153 := flag.Arg(1) + mbTrans154 := thrift.NewMemoryBufferLen(len(arg153)) + defer mbTrans154.Close() + _, err155 := mbTrans154.WriteString(arg153) + if err155 != nil { + Usage() + return + } + factory156 := thrift.NewSimpleJSONProtocolFactory() + jsProt157 := factory156.GetProtocol(mbTrans154) + argvalue0 := meta.NewListTagsReq() + err158 := argvalue0.Read(jsProt157) + if err158 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTags(value0)) + fmt.Print("\n") + break + case "createEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") + flag.Usage() + } + arg159 := flag.Arg(1) + mbTrans160 := thrift.NewMemoryBufferLen(len(arg159)) + defer mbTrans160.Close() + _, err161 := mbTrans160.WriteString(arg159) + if err161 != nil { + Usage() + return + } + factory162 := thrift.NewSimpleJSONProtocolFactory() + jsProt163 := factory162.GetProtocol(mbTrans160) + argvalue0 := meta.NewCreateEdgeReq() + err164 := argvalue0.Read(jsProt163) + if err164 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdge(value0)) + fmt.Print("\n") + break + case "alterEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") + flag.Usage() + } + arg165 := flag.Arg(1) + mbTrans166 := thrift.NewMemoryBufferLen(len(arg165)) + defer mbTrans166.Close() + _, err167 := mbTrans166.WriteString(arg165) + if err167 != nil { + Usage() + return + } + factory168 := thrift.NewSimpleJSONProtocolFactory() + jsProt169 := factory168.GetProtocol(mbTrans166) + argvalue0 := meta.NewAlterEdgeReq() + err170 := argvalue0.Read(jsProt169) + if err170 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterEdge(value0)) + fmt.Print("\n") + break + case "dropEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") + flag.Usage() + } + arg171 := flag.Arg(1) + mbTrans172 := thrift.NewMemoryBufferLen(len(arg171)) + defer mbTrans172.Close() + _, err173 := mbTrans172.WriteString(arg171) + if err173 != nil { + Usage() + return + } + factory174 := thrift.NewSimpleJSONProtocolFactory() + jsProt175 := factory174.GetProtocol(mbTrans172) + argvalue0 := meta.NewDropEdgeReq() + err176 := argvalue0.Read(jsProt175) + if err176 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdge(value0)) + fmt.Print("\n") + break + case "getEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") + flag.Usage() + } + arg177 := flag.Arg(1) + mbTrans178 := thrift.NewMemoryBufferLen(len(arg177)) + defer mbTrans178.Close() + _, err179 := mbTrans178.WriteString(arg177) + if err179 != nil { + Usage() + return + } + factory180 := thrift.NewSimpleJSONProtocolFactory() + jsProt181 := factory180.GetProtocol(mbTrans178) + argvalue0 := meta.NewGetEdgeReq() + err182 := argvalue0.Read(jsProt181) + if err182 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdge(value0)) + fmt.Print("\n") + break + case "listEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") + flag.Usage() + } + arg183 := flag.Arg(1) + mbTrans184 := thrift.NewMemoryBufferLen(len(arg183)) + defer mbTrans184.Close() + _, err185 := mbTrans184.WriteString(arg183) + if err185 != nil { + Usage() + return + } + factory186 := thrift.NewSimpleJSONProtocolFactory() + jsProt187 := factory186.GetProtocol(mbTrans184) + argvalue0 := meta.NewListEdgesReq() + err188 := argvalue0.Read(jsProt187) + if err188 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdges(value0)) + fmt.Print("\n") + break + case "listHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") + flag.Usage() + } + arg189 := flag.Arg(1) + mbTrans190 := thrift.NewMemoryBufferLen(len(arg189)) + defer mbTrans190.Close() + _, err191 := mbTrans190.WriteString(arg189) + if err191 != nil { + Usage() + return + } + factory192 := thrift.NewSimpleJSONProtocolFactory() + jsProt193 := factory192.GetProtocol(mbTrans190) + argvalue0 := meta.NewListHostsReq() + err194 := argvalue0.Read(jsProt193) + if err194 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListHosts(value0)) + fmt.Print("\n") + break + case "getPartsAlloc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") + flag.Usage() + } + arg195 := flag.Arg(1) + mbTrans196 := thrift.NewMemoryBufferLen(len(arg195)) + defer mbTrans196.Close() + _, err197 := mbTrans196.WriteString(arg195) + if err197 != nil { + Usage() + return + } + factory198 := thrift.NewSimpleJSONProtocolFactory() + jsProt199 := factory198.GetProtocol(mbTrans196) + argvalue0 := meta.NewGetPartsAllocReq() + err200 := argvalue0.Read(jsProt199) + if err200 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPartsAlloc(value0)) + fmt.Print("\n") + break + case "listParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListParts requires 1 args") + flag.Usage() + } + arg201 := flag.Arg(1) + mbTrans202 := thrift.NewMemoryBufferLen(len(arg201)) + defer mbTrans202.Close() + _, err203 := mbTrans202.WriteString(arg201) + if err203 != nil { + Usage() + return + } + factory204 := thrift.NewSimpleJSONProtocolFactory() + jsProt205 := factory204.GetProtocol(mbTrans202) + argvalue0 := meta.NewListPartsReq() + err206 := argvalue0.Read(jsProt205) + if err206 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListParts(value0)) + fmt.Print("\n") + break + case "multiPut": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiPut requires 1 args") + flag.Usage() + } + arg207 := flag.Arg(1) + mbTrans208 := thrift.NewMemoryBufferLen(len(arg207)) + defer mbTrans208.Close() + _, err209 := mbTrans208.WriteString(arg207) + if err209 != nil { + Usage() + return + } + factory210 := thrift.NewSimpleJSONProtocolFactory() + jsProt211 := factory210.GetProtocol(mbTrans208) + argvalue0 := meta.NewMultiPutReq() + err212 := argvalue0.Read(jsProt211) + if err212 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiPut(value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg213 := flag.Arg(1) + mbTrans214 := thrift.NewMemoryBufferLen(len(arg213)) + defer mbTrans214.Close() + _, err215 := mbTrans214.WriteString(arg213) + if err215 != nil { + Usage() + return + } + factory216 := thrift.NewSimpleJSONProtocolFactory() + jsProt217 := factory216.GetProtocol(mbTrans214) + argvalue0 := meta.NewGetReq() + err218 := argvalue0.Read(jsProt217) + if err218 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "multiGet": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MultiGet requires 1 args") + flag.Usage() + } + arg219 := flag.Arg(1) + mbTrans220 := thrift.NewMemoryBufferLen(len(arg219)) + defer mbTrans220.Close() + _, err221 := mbTrans220.WriteString(arg219) + if err221 != nil { + Usage() + return + } + factory222 := thrift.NewSimpleJSONProtocolFactory() + jsProt223 := factory222.GetProtocol(mbTrans220) + argvalue0 := meta.NewMultiGetReq() + err224 := argvalue0.Read(jsProt223) + if err224 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MultiGet(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg225 := flag.Arg(1) + mbTrans226 := thrift.NewMemoryBufferLen(len(arg225)) + defer mbTrans226.Close() + _, err227 := mbTrans226.WriteString(arg225) + if err227 != nil { + Usage() + return + } + factory228 := thrift.NewSimpleJSONProtocolFactory() + jsProt229 := factory228.GetProtocol(mbTrans226) + argvalue0 := meta.NewRemoveReq() + err230 := argvalue0.Read(jsProt229) + if err230 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "removeRange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveRange requires 1 args") + flag.Usage() + } + arg231 := flag.Arg(1) + mbTrans232 := thrift.NewMemoryBufferLen(len(arg231)) + defer mbTrans232.Close() + _, err233 := mbTrans232.WriteString(arg231) + if err233 != nil { + Usage() + return + } + factory234 := thrift.NewSimpleJSONProtocolFactory() + jsProt235 := factory234.GetProtocol(mbTrans232) + argvalue0 := meta.NewRemoveRangeReq() + err236 := argvalue0.Read(jsProt235) + if err236 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveRange(value0)) + fmt.Print("\n") + break + case "scan": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Scan requires 1 args") + flag.Usage() + } + arg237 := flag.Arg(1) + mbTrans238 := thrift.NewMemoryBufferLen(len(arg237)) + defer mbTrans238.Close() + _, err239 := mbTrans238.WriteString(arg237) + if err239 != nil { + Usage() + return + } + factory240 := thrift.NewSimpleJSONProtocolFactory() + jsProt241 := factory240.GetProtocol(mbTrans238) + argvalue0 := meta.NewScanReq() + err242 := argvalue0.Read(jsProt241) + if err242 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Scan(value0)) + fmt.Print("\n") + break + case "createTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") + flag.Usage() + } + arg243 := flag.Arg(1) + mbTrans244 := thrift.NewMemoryBufferLen(len(arg243)) + defer mbTrans244.Close() + _, err245 := mbTrans244.WriteString(arg243) + if err245 != nil { + Usage() + return + } + factory246 := thrift.NewSimpleJSONProtocolFactory() + jsProt247 := factory246.GetProtocol(mbTrans244) + argvalue0 := meta.NewCreateTagIndexReq() + err248 := argvalue0.Read(jsProt247) + if err248 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTagIndex(value0)) + fmt.Print("\n") + break + case "dropTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") + flag.Usage() + } + arg249 := flag.Arg(1) + mbTrans250 := thrift.NewMemoryBufferLen(len(arg249)) + defer mbTrans250.Close() + _, err251 := mbTrans250.WriteString(arg249) + if err251 != nil { + Usage() + return + } + factory252 := thrift.NewSimpleJSONProtocolFactory() + jsProt253 := factory252.GetProtocol(mbTrans250) + argvalue0 := meta.NewDropTagIndexReq() + err254 := argvalue0.Read(jsProt253) + if err254 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTagIndex(value0)) + fmt.Print("\n") + break + case "getTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") + flag.Usage() + } + arg255 := flag.Arg(1) + mbTrans256 := thrift.NewMemoryBufferLen(len(arg255)) + defer mbTrans256.Close() + _, err257 := mbTrans256.WriteString(arg255) + if err257 != nil { + Usage() + return + } + factory258 := thrift.NewSimpleJSONProtocolFactory() + jsProt259 := factory258.GetProtocol(mbTrans256) + argvalue0 := meta.NewGetTagIndexReq() + err260 := argvalue0.Read(jsProt259) + if err260 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") + flag.Usage() + } + arg261 := flag.Arg(1) + mbTrans262 := thrift.NewMemoryBufferLen(len(arg261)) + defer mbTrans262.Close() + _, err263 := mbTrans262.WriteString(arg261) + if err263 != nil { + Usage() + return + } + factory264 := thrift.NewSimpleJSONProtocolFactory() + jsProt265 := factory264.GetProtocol(mbTrans262) + argvalue0 := meta.NewListTagIndexesReq() + err266 := argvalue0.Read(jsProt265) + if err266 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexes(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg267 := flag.Arg(1) + mbTrans268 := thrift.NewMemoryBufferLen(len(arg267)) + defer mbTrans268.Close() + _, err269 := mbTrans268.WriteString(arg267) + if err269 != nil { + Usage() + return + } + factory270 := thrift.NewSimpleJSONProtocolFactory() + jsProt271 := factory270.GetProtocol(mbTrans268) + argvalue0 := meta.NewRebuildIndexReq() + err272 := argvalue0.Read(jsProt271) + if err272 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "listTagIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") + flag.Usage() + } + arg273 := flag.Arg(1) + mbTrans274 := thrift.NewMemoryBufferLen(len(arg273)) + defer mbTrans274.Close() + _, err275 := mbTrans274.WriteString(arg273) + if err275 != nil { + Usage() + return + } + factory276 := thrift.NewSimpleJSONProtocolFactory() + jsProt277 := factory276.GetProtocol(mbTrans274) + argvalue0 := meta.NewListIndexStatusReq() + err278 := argvalue0.Read(jsProt277) + if err278 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexStatus(value0)) + fmt.Print("\n") + break + case "createEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") + flag.Usage() + } + arg279 := flag.Arg(1) + mbTrans280 := thrift.NewMemoryBufferLen(len(arg279)) + defer mbTrans280.Close() + _, err281 := mbTrans280.WriteString(arg279) + if err281 != nil { + Usage() + return + } + factory282 := thrift.NewSimpleJSONProtocolFactory() + jsProt283 := factory282.GetProtocol(mbTrans280) + argvalue0 := meta.NewCreateEdgeIndexReq() + err284 := argvalue0.Read(jsProt283) + if err284 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdgeIndex(value0)) + fmt.Print("\n") + break + case "dropEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") + flag.Usage() + } + arg285 := flag.Arg(1) + mbTrans286 := thrift.NewMemoryBufferLen(len(arg285)) + defer mbTrans286.Close() + _, err287 := mbTrans286.WriteString(arg285) + if err287 != nil { + Usage() + return + } + factory288 := thrift.NewSimpleJSONProtocolFactory() + jsProt289 := factory288.GetProtocol(mbTrans286) + argvalue0 := meta.NewDropEdgeIndexReq() + err290 := argvalue0.Read(jsProt289) + if err290 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdgeIndex(value0)) + fmt.Print("\n") + break + case "getEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") + flag.Usage() + } + arg291 := flag.Arg(1) + mbTrans292 := thrift.NewMemoryBufferLen(len(arg291)) + defer mbTrans292.Close() + _, err293 := mbTrans292.WriteString(arg291) + if err293 != nil { + Usage() + return + } + factory294 := thrift.NewSimpleJSONProtocolFactory() + jsProt295 := factory294.GetProtocol(mbTrans292) + argvalue0 := meta.NewGetEdgeIndexReq() + err296 := argvalue0.Read(jsProt295) + if err296 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") + flag.Usage() + } + arg297 := flag.Arg(1) + mbTrans298 := thrift.NewMemoryBufferLen(len(arg297)) + defer mbTrans298.Close() + _, err299 := mbTrans298.WriteString(arg297) + if err299 != nil { + Usage() + return + } + factory300 := thrift.NewSimpleJSONProtocolFactory() + jsProt301 := factory300.GetProtocol(mbTrans298) + argvalue0 := meta.NewListEdgeIndexesReq() + err302 := argvalue0.Read(jsProt301) + if err302 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexes(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg303 := flag.Arg(1) + mbTrans304 := thrift.NewMemoryBufferLen(len(arg303)) + defer mbTrans304.Close() + _, err305 := mbTrans304.WriteString(arg303) + if err305 != nil { + Usage() + return + } + factory306 := thrift.NewSimpleJSONProtocolFactory() + jsProt307 := factory306.GetProtocol(mbTrans304) + argvalue0 := meta.NewRebuildIndexReq() + err308 := argvalue0.Read(jsProt307) + if err308 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "listEdgeIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") + flag.Usage() + } + arg309 := flag.Arg(1) + mbTrans310 := thrift.NewMemoryBufferLen(len(arg309)) + defer mbTrans310.Close() + _, err311 := mbTrans310.WriteString(arg309) + if err311 != nil { + Usage() + return + } + factory312 := thrift.NewSimpleJSONProtocolFactory() + jsProt313 := factory312.GetProtocol(mbTrans310) + argvalue0 := meta.NewListIndexStatusReq() + err314 := argvalue0.Read(jsProt313) + if err314 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexStatus(value0)) + fmt.Print("\n") + break + case "createUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") + flag.Usage() + } + arg315 := flag.Arg(1) + mbTrans316 := thrift.NewMemoryBufferLen(len(arg315)) + defer mbTrans316.Close() + _, err317 := mbTrans316.WriteString(arg315) + if err317 != nil { + Usage() + return + } + factory318 := thrift.NewSimpleJSONProtocolFactory() + jsProt319 := factory318.GetProtocol(mbTrans316) + argvalue0 := meta.NewCreateUserReq() + err320 := argvalue0.Read(jsProt319) + if err320 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateUser(value0)) + fmt.Print("\n") + break + case "dropUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropUser requires 1 args") + flag.Usage() + } + arg321 := flag.Arg(1) + mbTrans322 := thrift.NewMemoryBufferLen(len(arg321)) + defer mbTrans322.Close() + _, err323 := mbTrans322.WriteString(arg321) + if err323 != nil { + Usage() + return + } + factory324 := thrift.NewSimpleJSONProtocolFactory() + jsProt325 := factory324.GetProtocol(mbTrans322) + argvalue0 := meta.NewDropUserReq() + err326 := argvalue0.Read(jsProt325) + if err326 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropUser(value0)) + fmt.Print("\n") + break + case "alterUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") + flag.Usage() + } + arg327 := flag.Arg(1) + mbTrans328 := thrift.NewMemoryBufferLen(len(arg327)) + defer mbTrans328.Close() + _, err329 := mbTrans328.WriteString(arg327) + if err329 != nil { + Usage() + return + } + factory330 := thrift.NewSimpleJSONProtocolFactory() + jsProt331 := factory330.GetProtocol(mbTrans328) + argvalue0 := meta.NewAlterUserReq() + err332 := argvalue0.Read(jsProt331) + if err332 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterUser(value0)) + fmt.Print("\n") + break + case "grantRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") + flag.Usage() + } + arg333 := flag.Arg(1) + mbTrans334 := thrift.NewMemoryBufferLen(len(arg333)) + defer mbTrans334.Close() + _, err335 := mbTrans334.WriteString(arg333) + if err335 != nil { + Usage() + return + } + factory336 := thrift.NewSimpleJSONProtocolFactory() + jsProt337 := factory336.GetProtocol(mbTrans334) + argvalue0 := meta.NewGrantRoleReq() + err338 := argvalue0.Read(jsProt337) + if err338 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GrantRole(value0)) + fmt.Print("\n") + break + case "revokeRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") + flag.Usage() + } + arg339 := flag.Arg(1) + mbTrans340 := thrift.NewMemoryBufferLen(len(arg339)) + defer mbTrans340.Close() + _, err341 := mbTrans340.WriteString(arg339) + if err341 != nil { + Usage() + return + } + factory342 := thrift.NewSimpleJSONProtocolFactory() + jsProt343 := factory342.GetProtocol(mbTrans340) + argvalue0 := meta.NewRevokeRoleReq() + err344 := argvalue0.Read(jsProt343) + if err344 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RevokeRole(value0)) + fmt.Print("\n") + break + case "listUsers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") + flag.Usage() + } + arg345 := flag.Arg(1) + mbTrans346 := thrift.NewMemoryBufferLen(len(arg345)) + defer mbTrans346.Close() + _, err347 := mbTrans346.WriteString(arg345) + if err347 != nil { + Usage() + return + } + factory348 := thrift.NewSimpleJSONProtocolFactory() + jsProt349 := factory348.GetProtocol(mbTrans346) + argvalue0 := meta.NewListUsersReq() + err350 := argvalue0.Read(jsProt349) + if err350 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListUsers(value0)) + fmt.Print("\n") + break + case "listRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") + flag.Usage() + } + arg351 := flag.Arg(1) + mbTrans352 := thrift.NewMemoryBufferLen(len(arg351)) + defer mbTrans352.Close() + _, err353 := mbTrans352.WriteString(arg351) + if err353 != nil { + Usage() + return + } + factory354 := thrift.NewSimpleJSONProtocolFactory() + jsProt355 := factory354.GetProtocol(mbTrans352) + argvalue0 := meta.NewListRolesReq() + err356 := argvalue0.Read(jsProt355) + if err356 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListRoles(value0)) + fmt.Print("\n") + break + case "getUserRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") + flag.Usage() + } + arg357 := flag.Arg(1) + mbTrans358 := thrift.NewMemoryBufferLen(len(arg357)) + defer mbTrans358.Close() + _, err359 := mbTrans358.WriteString(arg357) + if err359 != nil { + Usage() + return + } + factory360 := thrift.NewSimpleJSONProtocolFactory() + jsProt361 := factory360.GetProtocol(mbTrans358) + argvalue0 := meta.NewGetUserRolesReq() + err362 := argvalue0.Read(jsProt361) + if err362 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUserRoles(value0)) + fmt.Print("\n") + break + case "changePassword": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") + flag.Usage() + } + arg363 := flag.Arg(1) + mbTrans364 := thrift.NewMemoryBufferLen(len(arg363)) + defer mbTrans364.Close() + _, err365 := mbTrans364.WriteString(arg363) + if err365 != nil { + Usage() + return + } + factory366 := thrift.NewSimpleJSONProtocolFactory() + jsProt367 := factory366.GetProtocol(mbTrans364) + argvalue0 := meta.NewChangePasswordReq() + err368 := argvalue0.Read(jsProt367) + if err368 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChangePassword(value0)) + fmt.Print("\n") + break + case "heartBeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") + flag.Usage() + } + arg369 := flag.Arg(1) + mbTrans370 := thrift.NewMemoryBufferLen(len(arg369)) + defer mbTrans370.Close() + _, err371 := mbTrans370.WriteString(arg369) + if err371 != nil { + Usage() + return + } + factory372 := thrift.NewSimpleJSONProtocolFactory() + jsProt373 := factory372.GetProtocol(mbTrans370) + argvalue0 := meta.NewHBReq() + err374 := argvalue0.Read(jsProt373) + if err374 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.HeartBeat(value0)) + fmt.Print("\n") + break + case "balance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Balance requires 1 args") + flag.Usage() + } + arg375 := flag.Arg(1) + mbTrans376 := thrift.NewMemoryBufferLen(len(arg375)) + defer mbTrans376.Close() + _, err377 := mbTrans376.WriteString(arg375) + if err377 != nil { + Usage() + return + } + factory378 := thrift.NewSimpleJSONProtocolFactory() + jsProt379 := factory378.GetProtocol(mbTrans376) + argvalue0 := meta.NewBalanceReq() + err380 := argvalue0.Read(jsProt379) + if err380 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Balance(value0)) + fmt.Print("\n") + break + case "leaderBalance": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LeaderBalance requires 1 args") + flag.Usage() + } + arg381 := flag.Arg(1) + mbTrans382 := thrift.NewMemoryBufferLen(len(arg381)) + defer mbTrans382.Close() + _, err383 := mbTrans382.WriteString(arg381) + if err383 != nil { + Usage() + return + } + factory384 := thrift.NewSimpleJSONProtocolFactory() + jsProt385 := factory384.GetProtocol(mbTrans382) + argvalue0 := meta.NewLeaderBalanceReq() + err386 := argvalue0.Read(jsProt385) + if err386 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LeaderBalance(value0)) + fmt.Print("\n") + break + case "regConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") + flag.Usage() + } + arg387 := flag.Arg(1) + mbTrans388 := thrift.NewMemoryBufferLen(len(arg387)) + defer mbTrans388.Close() + _, err389 := mbTrans388.WriteString(arg387) + if err389 != nil { + Usage() + return + } + factory390 := thrift.NewSimpleJSONProtocolFactory() + jsProt391 := factory390.GetProtocol(mbTrans388) + argvalue0 := meta.NewRegConfigReq() + err392 := argvalue0.Read(jsProt391) + if err392 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RegConfig(value0)) + fmt.Print("\n") + break + case "getConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") + flag.Usage() + } + arg393 := flag.Arg(1) + mbTrans394 := thrift.NewMemoryBufferLen(len(arg393)) + defer mbTrans394.Close() + _, err395 := mbTrans394.WriteString(arg393) + if err395 != nil { + Usage() + return + } + factory396 := thrift.NewSimpleJSONProtocolFactory() + jsProt397 := factory396.GetProtocol(mbTrans394) + argvalue0 := meta.NewGetConfigReq() + err398 := argvalue0.Read(jsProt397) + if err398 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetConfig(value0)) + fmt.Print("\n") + break + case "setConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") + flag.Usage() + } + arg399 := flag.Arg(1) + mbTrans400 := thrift.NewMemoryBufferLen(len(arg399)) + defer mbTrans400.Close() + _, err401 := mbTrans400.WriteString(arg399) + if err401 != nil { + Usage() + return + } + factory402 := thrift.NewSimpleJSONProtocolFactory() + jsProt403 := factory402.GetProtocol(mbTrans400) + argvalue0 := meta.NewSetConfigReq() + err404 := argvalue0.Read(jsProt403) + if err404 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetConfig(value0)) + fmt.Print("\n") + break + case "listConfigs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") + flag.Usage() + } + arg405 := flag.Arg(1) + mbTrans406 := thrift.NewMemoryBufferLen(len(arg405)) + defer mbTrans406.Close() + _, err407 := mbTrans406.WriteString(arg405) + if err407 != nil { + Usage() + return + } + factory408 := thrift.NewSimpleJSONProtocolFactory() + jsProt409 := factory408.GetProtocol(mbTrans406) + argvalue0 := meta.NewListConfigsReq() + err410 := argvalue0.Read(jsProt409) + if err410 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListConfigs(value0)) + fmt.Print("\n") + break + case "createSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") + flag.Usage() + } + arg411 := flag.Arg(1) + mbTrans412 := thrift.NewMemoryBufferLen(len(arg411)) + defer mbTrans412.Close() + _, err413 := mbTrans412.WriteString(arg411) + if err413 != nil { + Usage() + return + } + factory414 := thrift.NewSimpleJSONProtocolFactory() + jsProt415 := factory414.GetProtocol(mbTrans412) + argvalue0 := meta.NewCreateSnapshotReq() + err416 := argvalue0.Read(jsProt415) + if err416 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSnapshot(value0)) + fmt.Print("\n") + break + case "dropSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") + flag.Usage() + } + arg417 := flag.Arg(1) + mbTrans418 := thrift.NewMemoryBufferLen(len(arg417)) + defer mbTrans418.Close() + _, err419 := mbTrans418.WriteString(arg417) + if err419 != nil { + Usage() + return + } + factory420 := thrift.NewSimpleJSONProtocolFactory() + jsProt421 := factory420.GetProtocol(mbTrans418) + argvalue0 := meta.NewDropSnapshotReq() + err422 := argvalue0.Read(jsProt421) + if err422 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSnapshot(value0)) + fmt.Print("\n") + break + case "listSnapshots": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") + flag.Usage() + } + arg423 := flag.Arg(1) + mbTrans424 := thrift.NewMemoryBufferLen(len(arg423)) + defer mbTrans424.Close() + _, err425 := mbTrans424.WriteString(arg423) + if err425 != nil { + Usage() + return + } + factory426 := thrift.NewSimpleJSONProtocolFactory() + jsProt427 := factory426.GetProtocol(mbTrans424) + argvalue0 := meta.NewListSnapshotsReq() + err428 := argvalue0.Read(jsProt427) + if err428 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSnapshots(value0)) + fmt.Print("\n") + break + case "runAdminJob": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") + flag.Usage() + } + arg429 := flag.Arg(1) + mbTrans430 := thrift.NewMemoryBufferLen(len(arg429)) + defer mbTrans430.Close() + _, err431 := mbTrans430.WriteString(arg429) + if err431 != nil { + Usage() + return + } + factory432 := thrift.NewSimpleJSONProtocolFactory() + jsProt433 := factory432.GetProtocol(mbTrans430) + argvalue0 := meta.NewAdminJobReq() + err434 := argvalue0.Read(jsProt433) + if err434 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RunAdminJob(value0)) + fmt.Print("\n") + break + case "addZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZone requires 1 args") + flag.Usage() + } + arg435 := flag.Arg(1) + mbTrans436 := thrift.NewMemoryBufferLen(len(arg435)) + defer mbTrans436.Close() + _, err437 := mbTrans436.WriteString(arg435) + if err437 != nil { + Usage() + return + } + factory438 := thrift.NewSimpleJSONProtocolFactory() + jsProt439 := factory438.GetProtocol(mbTrans436) + argvalue0 := meta.NewAddZoneReq() + err440 := argvalue0.Read(jsProt439) + if err440 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZone(value0)) + fmt.Print("\n") + break + case "dropZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZone requires 1 args") + flag.Usage() + } + arg441 := flag.Arg(1) + mbTrans442 := thrift.NewMemoryBufferLen(len(arg441)) + defer mbTrans442.Close() + _, err443 := mbTrans442.WriteString(arg441) + if err443 != nil { + Usage() + return + } + factory444 := thrift.NewSimpleJSONProtocolFactory() + jsProt445 := factory444.GetProtocol(mbTrans442) + argvalue0 := meta.NewDropZoneReq() + err446 := argvalue0.Read(jsProt445) + if err446 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZone(value0)) + fmt.Print("\n") + break + case "addHostIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostIntoZone requires 1 args") + flag.Usage() + } + arg447 := flag.Arg(1) + mbTrans448 := thrift.NewMemoryBufferLen(len(arg447)) + defer mbTrans448.Close() + _, err449 := mbTrans448.WriteString(arg447) + if err449 != nil { + Usage() + return + } + factory450 := thrift.NewSimpleJSONProtocolFactory() + jsProt451 := factory450.GetProtocol(mbTrans448) + argvalue0 := meta.NewAddHostIntoZoneReq() + err452 := argvalue0.Read(jsProt451) + if err452 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostIntoZone(value0)) + fmt.Print("\n") + break + case "dropHostFromZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHostFromZone requires 1 args") + flag.Usage() + } + arg453 := flag.Arg(1) + mbTrans454 := thrift.NewMemoryBufferLen(len(arg453)) + defer mbTrans454.Close() + _, err455 := mbTrans454.WriteString(arg453) + if err455 != nil { + Usage() + return + } + factory456 := thrift.NewSimpleJSONProtocolFactory() + jsProt457 := factory456.GetProtocol(mbTrans454) + argvalue0 := meta.NewDropHostFromZoneReq() + err458 := argvalue0.Read(jsProt457) + if err458 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHostFromZone(value0)) + fmt.Print("\n") + break + case "getZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetZone requires 1 args") + flag.Usage() + } + arg459 := flag.Arg(1) + mbTrans460 := thrift.NewMemoryBufferLen(len(arg459)) + defer mbTrans460.Close() + _, err461 := mbTrans460.WriteString(arg459) + if err461 != nil { + Usage() + return + } + factory462 := thrift.NewSimpleJSONProtocolFactory() + jsProt463 := factory462.GetProtocol(mbTrans460) + argvalue0 := meta.NewGetZoneReq() + err464 := argvalue0.Read(jsProt463) + if err464 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetZone(value0)) + fmt.Print("\n") + break + case "listZones": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListZones requires 1 args") + flag.Usage() + } + arg465 := flag.Arg(1) + mbTrans466 := thrift.NewMemoryBufferLen(len(arg465)) + defer mbTrans466.Close() + _, err467 := mbTrans466.WriteString(arg465) + if err467 != nil { + Usage() + return + } + factory468 := thrift.NewSimpleJSONProtocolFactory() + jsProt469 := factory468.GetProtocol(mbTrans466) + argvalue0 := meta.NewListZonesReq() + err470 := argvalue0.Read(jsProt469) + if err470 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListZones(value0)) + fmt.Print("\n") + break + case "addGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddGroup requires 1 args") + flag.Usage() + } + arg471 := flag.Arg(1) + mbTrans472 := thrift.NewMemoryBufferLen(len(arg471)) + defer mbTrans472.Close() + _, err473 := mbTrans472.WriteString(arg471) + if err473 != nil { + Usage() + return + } + factory474 := thrift.NewSimpleJSONProtocolFactory() + jsProt475 := factory474.GetProtocol(mbTrans472) + argvalue0 := meta.NewAddGroupReq() + err476 := argvalue0.Read(jsProt475) + if err476 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddGroup(value0)) + fmt.Print("\n") + break + case "dropGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropGroup requires 1 args") + flag.Usage() + } + arg477 := flag.Arg(1) + mbTrans478 := thrift.NewMemoryBufferLen(len(arg477)) + defer mbTrans478.Close() + _, err479 := mbTrans478.WriteString(arg477) + if err479 != nil { + Usage() + return + } + factory480 := thrift.NewSimpleJSONProtocolFactory() + jsProt481 := factory480.GetProtocol(mbTrans478) + argvalue0 := meta.NewDropGroupReq() + err482 := argvalue0.Read(jsProt481) + if err482 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropGroup(value0)) + fmt.Print("\n") + break + case "addZoneIntoGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddZoneIntoGroup requires 1 args") + flag.Usage() + } + arg483 := flag.Arg(1) + mbTrans484 := thrift.NewMemoryBufferLen(len(arg483)) + defer mbTrans484.Close() + _, err485 := mbTrans484.WriteString(arg483) + if err485 != nil { + Usage() + return + } + factory486 := thrift.NewSimpleJSONProtocolFactory() + jsProt487 := factory486.GetProtocol(mbTrans484) + argvalue0 := meta.NewAddZoneIntoGroupReq() + err488 := argvalue0.Read(jsProt487) + if err488 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddZoneIntoGroup(value0)) + fmt.Print("\n") + break + case "dropZoneFromGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZoneFromGroup requires 1 args") + flag.Usage() + } + arg489 := flag.Arg(1) + mbTrans490 := thrift.NewMemoryBufferLen(len(arg489)) + defer mbTrans490.Close() + _, err491 := mbTrans490.WriteString(arg489) + if err491 != nil { + Usage() + return + } + factory492 := thrift.NewSimpleJSONProtocolFactory() + jsProt493 := factory492.GetProtocol(mbTrans490) + argvalue0 := meta.NewDropZoneFromGroupReq() + err494 := argvalue0.Read(jsProt493) + if err494 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZoneFromGroup(value0)) + fmt.Print("\n") + break + case "getGroup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetGroup requires 1 args") + flag.Usage() + } + arg495 := flag.Arg(1) + mbTrans496 := thrift.NewMemoryBufferLen(len(arg495)) + defer mbTrans496.Close() + _, err497 := mbTrans496.WriteString(arg495) + if err497 != nil { + Usage() + return + } + factory498 := thrift.NewSimpleJSONProtocolFactory() + jsProt499 := factory498.GetProtocol(mbTrans496) + argvalue0 := meta.NewGetGroupReq() + err500 := argvalue0.Read(jsProt499) + if err500 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetGroup(value0)) + fmt.Print("\n") + break + case "listGroups": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListGroups requires 1 args") + flag.Usage() + } + arg501 := flag.Arg(1) + mbTrans502 := thrift.NewMemoryBufferLen(len(arg501)) + defer mbTrans502.Close() + _, err503 := mbTrans502.WriteString(arg501) + if err503 != nil { + Usage() + return + } + factory504 := thrift.NewSimpleJSONProtocolFactory() + jsProt505 := factory504.GetProtocol(mbTrans502) + argvalue0 := meta.NewListGroupsReq() + err506 := argvalue0.Read(jsProt505) + if err506 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListGroups(value0)) + fmt.Print("\n") + break + case "createBackup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") + flag.Usage() + } + arg507 := flag.Arg(1) + mbTrans508 := thrift.NewMemoryBufferLen(len(arg507)) + defer mbTrans508.Close() + _, err509 := mbTrans508.WriteString(arg507) + if err509 != nil { + Usage() + return + } + factory510 := thrift.NewSimpleJSONProtocolFactory() + jsProt511 := factory510.GetProtocol(mbTrans508) + argvalue0 := meta.NewCreateBackupReq() + err512 := argvalue0.Read(jsProt511) + if err512 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateBackup(value0)) + fmt.Print("\n") + break + case "restoreMeta": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") + flag.Usage() + } + arg513 := flag.Arg(1) + mbTrans514 := thrift.NewMemoryBufferLen(len(arg513)) + defer mbTrans514.Close() + _, err515 := mbTrans514.WriteString(arg513) + if err515 != nil { + Usage() + return + } + factory516 := thrift.NewSimpleJSONProtocolFactory() + jsProt517 := factory516.GetProtocol(mbTrans514) + argvalue0 := meta.NewRestoreMetaReq() + err518 := argvalue0.Read(jsProt517) + if err518 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RestoreMeta(value0)) + fmt.Print("\n") + break + case "addListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddListener requires 1 args") + flag.Usage() + } + arg519 := flag.Arg(1) + mbTrans520 := thrift.NewMemoryBufferLen(len(arg519)) + defer mbTrans520.Close() + _, err521 := mbTrans520.WriteString(arg519) + if err521 != nil { + Usage() + return + } + factory522 := thrift.NewSimpleJSONProtocolFactory() + jsProt523 := factory522.GetProtocol(mbTrans520) + argvalue0 := meta.NewAddListenerReq() + err524 := argvalue0.Read(jsProt523) + if err524 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddListener(value0)) + fmt.Print("\n") + break + case "removeListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") + flag.Usage() + } + arg525 := flag.Arg(1) + mbTrans526 := thrift.NewMemoryBufferLen(len(arg525)) + defer mbTrans526.Close() + _, err527 := mbTrans526.WriteString(arg525) + if err527 != nil { + Usage() + return + } + factory528 := thrift.NewSimpleJSONProtocolFactory() + jsProt529 := factory528.GetProtocol(mbTrans526) + argvalue0 := meta.NewRemoveListenerReq() + err530 := argvalue0.Read(jsProt529) + if err530 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveListener(value0)) + fmt.Print("\n") + break + case "listListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListListener requires 1 args") + flag.Usage() + } + arg531 := flag.Arg(1) + mbTrans532 := thrift.NewMemoryBufferLen(len(arg531)) + defer mbTrans532.Close() + _, err533 := mbTrans532.WriteString(arg531) + if err533 != nil { + Usage() + return + } + factory534 := thrift.NewSimpleJSONProtocolFactory() + jsProt535 := factory534.GetProtocol(mbTrans532) + argvalue0 := meta.NewListListenerReq() + err536 := argvalue0.Read(jsProt535) + if err536 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListListener(value0)) + fmt.Print("\n") + break + case "getStats": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetStats requires 1 args") + flag.Usage() + } + arg537 := flag.Arg(1) + mbTrans538 := thrift.NewMemoryBufferLen(len(arg537)) + defer mbTrans538.Close() + _, err539 := mbTrans538.WriteString(arg537) + if err539 != nil { + Usage() + return + } + factory540 := thrift.NewSimpleJSONProtocolFactory() + jsProt541 := factory540.GetProtocol(mbTrans538) + argvalue0 := meta.NewGetStatsReq() + err542 := argvalue0.Read(jsProt541) + if err542 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetStats(value0)) + fmt.Print("\n") + break + case "signInFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignInFTService requires 1 args") + flag.Usage() + } + arg543 := flag.Arg(1) + mbTrans544 := thrift.NewMemoryBufferLen(len(arg543)) + defer mbTrans544.Close() + _, err545 := mbTrans544.WriteString(arg543) + if err545 != nil { + Usage() + return + } + factory546 := thrift.NewSimpleJSONProtocolFactory() + jsProt547 := factory546.GetProtocol(mbTrans544) + argvalue0 := meta.NewSignInFTServiceReq() + err548 := argvalue0.Read(jsProt547) + if err548 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignInFTService(value0)) + fmt.Print("\n") + break + case "signOutFTService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignOutFTService requires 1 args") + flag.Usage() + } + arg549 := flag.Arg(1) + mbTrans550 := thrift.NewMemoryBufferLen(len(arg549)) + defer mbTrans550.Close() + _, err551 := mbTrans550.WriteString(arg549) + if err551 != nil { + Usage() + return + } + factory552 := thrift.NewSimpleJSONProtocolFactory() + jsProt553 := factory552.GetProtocol(mbTrans550) + argvalue0 := meta.NewSignOutFTServiceReq() + err554 := argvalue0.Read(jsProt553) + if err554 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignOutFTService(value0)) + fmt.Print("\n") + break + case "listFTClients": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTClients requires 1 args") + flag.Usage() + } + arg555 := flag.Arg(1) + mbTrans556 := thrift.NewMemoryBufferLen(len(arg555)) + defer mbTrans556.Close() + _, err557 := mbTrans556.WriteString(arg555) + if err557 != nil { + Usage() + return + } + factory558 := thrift.NewSimpleJSONProtocolFactory() + jsProt559 := factory558.GetProtocol(mbTrans556) + argvalue0 := meta.NewListFTClientsReq() + err560 := argvalue0.Read(jsProt559) + if err560 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTClients(value0)) + fmt.Print("\n") + break + case "createFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateFTIndex requires 1 args") + flag.Usage() + } + arg561 := flag.Arg(1) + mbTrans562 := thrift.NewMemoryBufferLen(len(arg561)) + defer mbTrans562.Close() + _, err563 := mbTrans562.WriteString(arg561) + if err563 != nil { + Usage() + return + } + factory564 := thrift.NewSimpleJSONProtocolFactory() + jsProt565 := factory564.GetProtocol(mbTrans562) + argvalue0 := meta.NewCreateFTIndexReq() + err566 := argvalue0.Read(jsProt565) + if err566 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateFTIndex(value0)) + fmt.Print("\n") + break + case "dropFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropFTIndex requires 1 args") + flag.Usage() + } + arg567 := flag.Arg(1) + mbTrans568 := thrift.NewMemoryBufferLen(len(arg567)) + defer mbTrans568.Close() + _, err569 := mbTrans568.WriteString(arg567) + if err569 != nil { + Usage() + return + } + factory570 := thrift.NewSimpleJSONProtocolFactory() + jsProt571 := factory570.GetProtocol(mbTrans568) + argvalue0 := meta.NewDropFTIndexReq() + err572 := argvalue0.Read(jsProt571) + if err572 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropFTIndex(value0)) + fmt.Print("\n") + break + case "listFTIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTIndexes requires 1 args") + flag.Usage() + } + arg573 := flag.Arg(1) + mbTrans574 := thrift.NewMemoryBufferLen(len(arg573)) + defer mbTrans574.Close() + _, err575 := mbTrans574.WriteString(arg573) + if err575 != nil { + Usage() + return + } + factory576 := thrift.NewSimpleJSONProtocolFactory() + jsProt577 := factory576.GetProtocol(mbTrans574) + argvalue0 := meta.NewListFTIndexesReq() + err578 := argvalue0.Read(jsProt577) + if err578 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTIndexes(value0)) + fmt.Print("\n") + break + case "createSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") + flag.Usage() + } + arg579 := flag.Arg(1) + mbTrans580 := thrift.NewMemoryBufferLen(len(arg579)) + defer mbTrans580.Close() + _, err581 := mbTrans580.WriteString(arg579) + if err581 != nil { + Usage() + return + } + factory582 := thrift.NewSimpleJSONProtocolFactory() + jsProt583 := factory582.GetProtocol(mbTrans580) + argvalue0 := meta.NewCreateSessionReq() + err584 := argvalue0.Read(jsProt583) + if err584 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSession(value0)) + fmt.Print("\n") + break + case "updateSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") + flag.Usage() + } + arg585 := flag.Arg(1) + mbTrans586 := thrift.NewMemoryBufferLen(len(arg585)) + defer mbTrans586.Close() + _, err587 := mbTrans586.WriteString(arg585) + if err587 != nil { + Usage() + return + } + factory588 := thrift.NewSimpleJSONProtocolFactory() + jsProt589 := factory588.GetProtocol(mbTrans586) + argvalue0 := meta.NewUpdateSessionsReq() + err590 := argvalue0.Read(jsProt589) + if err590 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateSessions(value0)) + fmt.Print("\n") + break + case "listSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") + flag.Usage() + } + arg591 := flag.Arg(1) + mbTrans592 := thrift.NewMemoryBufferLen(len(arg591)) + defer mbTrans592.Close() + _, err593 := mbTrans592.WriteString(arg591) + if err593 != nil { + Usage() + return + } + factory594 := thrift.NewSimpleJSONProtocolFactory() + jsProt595 := factory594.GetProtocol(mbTrans592) + argvalue0 := meta.NewListSessionsReq() + err596 := argvalue0.Read(jsProt595) + if err596 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSessions(value0)) + fmt.Print("\n") + break + case "getSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSession requires 1 args") + flag.Usage() + } + arg597 := flag.Arg(1) + mbTrans598 := thrift.NewMemoryBufferLen(len(arg597)) + defer mbTrans598.Close() + _, err599 := mbTrans598.WriteString(arg597) + if err599 != nil { + Usage() + return + } + factory600 := thrift.NewSimpleJSONProtocolFactory() + jsProt601 := factory600.GetProtocol(mbTrans598) + argvalue0 := meta.NewGetSessionReq() + err602 := argvalue0.Read(jsProt601) + if err602 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSession(value0)) + fmt.Print("\n") + break + case "removeSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") + flag.Usage() + } + arg603 := flag.Arg(1) + mbTrans604 := thrift.NewMemoryBufferLen(len(arg603)) + defer mbTrans604.Close() + _, err605 := mbTrans604.WriteString(arg603) + if err605 != nil { + Usage() + return + } + factory606 := thrift.NewSimpleJSONProtocolFactory() + jsProt607 := factory606.GetProtocol(mbTrans604) + argvalue0 := meta.NewRemoveSessionReq() + err608 := argvalue0.Read(jsProt607) + if err608 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveSession(value0)) + fmt.Print("\n") + break + case "killQuery": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "KillQuery requires 1 args") + flag.Usage() + } + arg609 := flag.Arg(1) + mbTrans610 := thrift.NewMemoryBufferLen(len(arg609)) + defer mbTrans610.Close() + _, err611 := mbTrans610.WriteString(arg609) + if err611 != nil { + Usage() + return + } + factory612 := thrift.NewSimpleJSONProtocolFactory() + jsProt613 := factory612.GetProtocol(mbTrans610) + argvalue0 := meta.NewKillQueryReq() + err614 := argvalue0.Read(jsProt613) + if err614 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.KillQuery(value0)) + fmt.Print("\n") + break + case "reportTaskFinish": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") + flag.Usage() + } + arg615 := flag.Arg(1) + mbTrans616 := thrift.NewMemoryBufferLen(len(arg615)) + defer mbTrans616.Close() + _, err617 := mbTrans616.WriteString(arg615) + if err617 != nil { + Usage() + return + } + factory618 := thrift.NewSimpleJSONProtocolFactory() + jsProt619 := factory618.GetProtocol(mbTrans616) + argvalue0 := meta.NewReportTaskReq() + err620 := argvalue0.Read(jsProt619) + if err620 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ReportTaskFinish(value0)) + fmt.Print("\n") + break + case "listCluster": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListCluster requires 1 args") + flag.Usage() + } + arg621 := flag.Arg(1) + mbTrans622 := thrift.NewMemoryBufferLen(len(arg621)) + defer mbTrans622.Close() + _, err623 := mbTrans622.WriteString(arg621) + if err623 != nil { + Usage() + return + } + factory624 := thrift.NewSimpleJSONProtocolFactory() + jsProt625 := factory624.GetProtocol(mbTrans622) + argvalue0 := meta.NewListClusterInfoReq() + err626 := argvalue0.Read(jsProt625) + if err626 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListCluster(value0)) + fmt.Print("\n") + break + case "getMetaDirInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetMetaDirInfo requires 1 args") + flag.Usage() + } + arg627 := flag.Arg(1) + mbTrans628 := thrift.NewMemoryBufferLen(len(arg627)) + defer mbTrans628.Close() + _, err629 := mbTrans628.WriteString(arg627) + if err629 != nil { + Usage() + return + } + factory630 := thrift.NewSimpleJSONProtocolFactory() + jsProt631 := factory630.GetProtocol(mbTrans628) + argvalue0 := meta.NewGetMetaDirInfoReq() + err632 := argvalue0.Read(jsProt631) + if err632 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetMetaDirInfo(value0)) + fmt.Print("\n") + break + case "verifyClientVersion": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "VerifyClientVersion requires 1 args") + flag.Usage() + } + arg633 := flag.Arg(1) + mbTrans634 := thrift.NewMemoryBufferLen(len(arg633)) + defer mbTrans634.Close() + _, err635 := mbTrans634.WriteString(arg633) + if err635 != nil { + Usage() + return + } + factory636 := thrift.NewSimpleJSONProtocolFactory() + jsProt637 := factory636.GetProtocol(mbTrans634) + argvalue0 := meta.NewVerifyClientVersionReq() + err638 := argvalue0.Read(jsProt637) + if err638 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.VerifyClientVersion(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_6_0/meta/metaservice.go b/ccore/nebula/internal/thrift/v2_6_0/meta/metaservice.go new file mode 100644 index 0000000..7f89936 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/meta/metaservice.go @@ -0,0 +1,28228 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +type MetaService interface { + // Parameters: + // - Req + CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateSpaceAs(ctx context.Context, req *CreateSpaceAsReq) (_r *ExecResp, err error) + // Parameters: + // - Req + CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStats(ctx context.Context, req *GetStatsReq) (_r *GetStatsResp, err error) + // Parameters: + // - Req + SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) + // Parameters: + // - Req + VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) +} + +type MetaServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) + // Parameters: + // - Req + ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) + // Parameters: + // - Req + CreateSpaceAs(req *CreateSpaceAsReq) (_r *ExecResp, err error) + // Parameters: + // - Req + CreateTag(req *CreateTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterTag(req *AlterTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTag(req *DropTagReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTag(req *GetTagReq) (_r *GetTagResp, err error) + // Parameters: + // - Req + ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) + // Parameters: + // - Req + CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) + // Parameters: + // - Req + ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) + // Parameters: + // - Req + ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) + // Parameters: + // - Req + GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) + // Parameters: + // - Req + ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) + // Parameters: + // - Req + MultiPut(req *MultiPutReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Get(req *GetReq) (_r *GetResp, err error) + // Parameters: + // - Req + MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) + // Parameters: + // - Req + Remove(req *RemoveReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) + // Parameters: + // - Req + Scan(req *ScanReq) (_r *ScanResp, err error) + // Parameters: + // - Req + CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) + // Parameters: + // - Req + ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) + // Parameters: + // - Req + ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) + // Parameters: + // - Req + CreateUser(req *CreateUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropUser(req *DropUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AlterUser(req *AlterUserReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) + // Parameters: + // - Req + ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) + // Parameters: + // - Req + ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) + // Parameters: + // - Req + HeartBeat(req *HBReq) (_r *HBResp, err error) + // Parameters: + // - Req + Balance(req *BalanceReq) (_r *BalanceResp, err error) + // Parameters: + // - Req + LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RegConfig(req *RegConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) + // Parameters: + // - Req + SetConfig(req *SetConfigReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) + // Parameters: + // - Req + CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) + // Parameters: + // - Req + RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) + // Parameters: + // - Req + AddZone(req *AddZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZone(req *DropZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) + // Parameters: + // - Req + ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) + // Parameters: + // - Req + AddGroup(req *AddGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropGroup(req *DropGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) + // Parameters: + // - Req + GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) + // Parameters: + // - Req + ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) + // Parameters: + // - Req + CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) + // Parameters: + // - Req + RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) + // Parameters: + // - Req + AddListener(req *AddListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) + // Parameters: + // - Req + GetStats(req *GetStatsReq) (_r *GetStatsResp, err error) + // Parameters: + // - Req + SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) + // Parameters: + // - Req + CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) + // Parameters: + // - Req + CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) + // Parameters: + // - Req + UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) + // Parameters: + // - Req + ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) + // Parameters: + // - Req + GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) + // Parameters: + // - Req + RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) + // Parameters: + // - Req + KillQuery(req *KillQueryReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) + // Parameters: + // - Req + ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) + // Parameters: + // - Req + GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) + // Parameters: + // - Req + VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) +} + +type MetaServiceClient struct { + MetaServiceClientInterface + CC thrift.ClientConn +} + +func(client *MetaServiceClient) Open() error { + return client.CC.Open() +} + +func(client *MetaServiceClient) Close() error { + return client.CC.Close() +} + +func(client *MetaServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewMetaServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceClient { + return &MetaServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceClientProtocol(prot thrift.Protocol) *MetaServiceClient { + return NewMetaServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpaceAs(req *CreateSpaceAsReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceAsArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpaceAs", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpaceAs() +} + + +func (p *MetaServiceClient) recvCreateSpaceAs() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceAsResult + err = p.CC.RecvMsg("createSpaceAs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Get(req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetStats(req *GetStatsReq) (_r *GetStatsResp, err error) { + args := MetaServiceGetStatsArgs{ + Req : req, + } + err = p.CC.SendMsg("getStats", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStats() +} + + +func (p *MetaServiceClient) recvGetStats() (value *GetStatsResp, err error) { + var result MetaServiceGetStatsResult + err = p.CC.RecvMsg("getStats", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceClient) VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + args := MetaServiceVerifyClientVersionArgs{ + Req : req, + } + err = p.CC.SendMsg("verifyClientVersion", &args, thrift.CALL) + if err != nil { return } + return p.recvVerifyClientVersion() +} + + +func (p *MetaServiceClient) recvVerifyClientVersion() (value *VerifyClientVersionResp, err error) { + var result MetaServiceVerifyClientVersionResult + err = p.CC.RecvMsg("verifyClientVersion", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceThreadsafeClient struct { + MetaServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *MetaServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *MetaServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *MetaServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewMetaServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewMetaServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *MetaServiceThreadsafeClient { + return &MetaServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewMetaServiceThreadsafeClientProtocol(prot thrift.Protocol) *MetaServiceThreadsafeClient { + return NewMetaServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSpace(req *CreateSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSpace() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceResult + err = p.CC.RecvMsg("createSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSpace(req *DropSpaceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSpace() (value *ExecResp, err error) { + var result MetaServiceDropSpaceResult + err = p.CC.RecvMsg("dropSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSpaceArgs{ + Req : req, + } + err = p.CC.SendMsg("getSpace", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSpace() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSpace() (value *GetSpaceResp, err error) { + var result MetaServiceGetSpaceResult + err = p.CC.RecvMsg("getSpace", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSpacesArgs{ + Req : req, + } + err = p.CC.SendMsg("listSpaces", &args, thrift.CALL) + if err != nil { return } + return p.recvListSpaces() +} + + +func (p *MetaServiceThreadsafeClient) recvListSpaces() (value *ListSpacesResp, err error) { + var result MetaServiceListSpacesResult + err = p.CC.RecvMsg("listSpaces", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSpaceAs(req *CreateSpaceAsReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSpaceAsArgs{ + Req : req, + } + err = p.CC.SendMsg("createSpaceAs", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSpaceAs() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSpaceAs() (value *ExecResp, err error) { + var result MetaServiceCreateSpaceAsResult + err = p.CC.RecvMsg("createSpaceAs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTag(req *CreateTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagArgs{ + Req : req, + } + err = p.CC.SendMsg("createTag", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTag() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTag() (value *ExecResp, err error) { + var result MetaServiceCreateTagResult + err = p.CC.RecvMsg("createTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterTag(req *AlterTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterTagArgs{ + Req : req, + } + err = p.CC.SendMsg("alterTag", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterTag() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterTag() (value *ExecResp, err error) { + var result MetaServiceAlterTagResult + err = p.CC.RecvMsg("alterTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTag(req *DropTagReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTag", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTag() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTag() (value *ExecResp, err error) { + var result MetaServiceDropTagResult + err = p.CC.RecvMsg("dropTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTag(req *GetTagReq) (_r *GetTagResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagArgs{ + Req : req, + } + err = p.CC.SendMsg("getTag", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTag() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTag() (value *GetTagResp, err error) { + var result MetaServiceGetTagResult + err = p.CC.RecvMsg("getTag", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTags(req *ListTagsReq) (_r *ListTagsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("listTags", &args, thrift.CALL) + if err != nil { return } + return p.recvListTags() +} + + +func (p *MetaServiceThreadsafeClient) recvListTags() (value *ListTagsResp, err error) { + var result MetaServiceListTagsResult + err = p.CC.RecvMsg("listTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdge(req *CreateEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdge() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeResult + err = p.CC.RecvMsg("createEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterEdge(req *AlterEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("alterEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterEdge() (value *ExecResp, err error) { + var result MetaServiceAlterEdgeResult + err = p.CC.RecvMsg("alterEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdge(req *DropEdgeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdge() (value *ExecResp, err error) { + var result MetaServiceDropEdgeResult + err = p.CC.RecvMsg("dropEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdge(req *GetEdgeReq) (_r *GetEdgeResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdge() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdge() (value *GetEdgeResp, err error) { + var result MetaServiceGetEdgeResult + err = p.CC.RecvMsg("getEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdges(req *ListEdgesReq) (_r *ListEdgesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdges() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdges() (value *ListEdgesResp, err error) { + var result MetaServiceListEdgesResult + err = p.CC.RecvMsg("listEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListHostsArgs{ + Req : req, + } + err = p.CC.SendMsg("listHosts", &args, thrift.CALL) + if err != nil { return } + return p.recvListHosts() +} + + +func (p *MetaServiceThreadsafeClient) recvListHosts() (value *ListHostsResp, err error) { + var result MetaServiceListHostsResult + err = p.CC.RecvMsg("listHosts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + err = p.CC.SendMsg("getPartsAlloc", &args, thrift.CALL) + if err != nil { return } + return p.recvGetPartsAlloc() +} + + +func (p *MetaServiceThreadsafeClient) recvGetPartsAlloc() (value *GetPartsAllocResp, err error) { + var result MetaServiceGetPartsAllocResult + err = p.CC.RecvMsg("getPartsAlloc", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("listParts", &args, thrift.CALL) + if err != nil { return } + return p.recvListParts() +} + + +func (p *MetaServiceThreadsafeClient) recvListParts() (value *ListPartsResp, err error) { + var result MetaServiceListPartsResult + err = p.CC.RecvMsg("listParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiPut(req *MultiPutReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiPutArgs{ + Req : req, + } + err = p.CC.SendMsg("multiPut", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiPut() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiPut() (value *ExecResp, err error) { + var result MetaServiceMultiPutResult + err = p.CC.RecvMsg("multiPut", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Get(req *GetReq) (_r *GetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *MetaServiceThreadsafeClient) recvGet() (value *GetResp, err error) { + var result MetaServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) MultiGet(req *MultiGetReq) (_r *MultiGetResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceMultiGetArgs{ + Req : req, + } + err = p.CC.SendMsg("multiGet", &args, thrift.CALL) + if err != nil { return } + return p.recvMultiGet() +} + + +func (p *MetaServiceThreadsafeClient) recvMultiGet() (value *MultiGetResp, err error) { + var result MetaServiceMultiGetResult + err = p.CC.RecvMsg("multiGet", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Remove(req *RemoveReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *MetaServiceThreadsafeClient) recvRemove() (value *ExecResp, err error) { + var result MetaServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveRange(req *RemoveRangeReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + err = p.CC.SendMsg("removeRange", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveRange() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveRange() (value *ExecResp, err error) { + var result MetaServiceRemoveRangeResult + err = p.CC.RecvMsg("removeRange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Scan(req *ScanReq) (_r *ScanResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceScanArgs{ + Req : req, + } + err = p.CC.SendMsg("scan", &args, thrift.CALL) + if err != nil { return } + return p.recvScan() +} + + +func (p *MetaServiceThreadsafeClient) recvScan() (value *ScanResp, err error) { + var result MetaServiceScanResult + err = p.CC.RecvMsg("scan", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateTagIndex(req *CreateTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateTagIndex() (value *ExecResp, err error) { + var result MetaServiceCreateTagIndexResult + err = p.CC.RecvMsg("createTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropTagIndex(req *DropTagIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropTagIndex() (value *ExecResp, err error) { + var result MetaServiceDropTagIndexResult + err = p.CC.RecvMsg("dropTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetTagIndex(req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetTagIndex() (value *GetTagIndexResp, err error) { + var result MetaServiceGetTagIndexResult + err = p.CC.RecvMsg("getTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexes(req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexes() (value *ListTagIndexesResp, err error) { + var result MetaServiceListTagIndexesResult + err = p.CC.RecvMsg("listTagIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildTagIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListTagIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listTagIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListTagIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListTagIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListTagIndexStatusResult + err = p.CC.RecvMsg("listTagIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateEdgeIndex(req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceCreateEdgeIndexResult + err = p.CC.RecvMsg("createEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropEdgeIndex(req *DropEdgeIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceDropEdgeIndexResult + err = p.CC.RecvMsg("dropEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetEdgeIndex(req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("getEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvGetEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvGetEdgeIndex() (value *GetEdgeIndexResp, err error) { + var result MetaServiceGetEdgeIndexResult + err = p.CC.RecvMsg("getEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexes(req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexes() (value *ListEdgeIndexesResp, err error) { + var result MetaServiceListEdgeIndexesResult + err = p.CC.RecvMsg("listEdgeIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvRebuildEdgeIndex() (value *ExecResp, err error) { + var result MetaServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListEdgeIndexStatus(req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + err = p.CC.SendMsg("listEdgeIndexStatus", &args, thrift.CALL) + if err != nil { return } + return p.recvListEdgeIndexStatus() +} + + +func (p *MetaServiceThreadsafeClient) recvListEdgeIndexStatus() (value *ListIndexStatusResp, err error) { + var result MetaServiceListEdgeIndexStatusResult + err = p.CC.RecvMsg("listEdgeIndexStatus", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateUser(req *CreateUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateUserArgs{ + Req : req, + } + err = p.CC.SendMsg("createUser", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateUser() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateUser() (value *ExecResp, err error) { + var result MetaServiceCreateUserResult + err = p.CC.RecvMsg("createUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropUser(req *DropUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropUserArgs{ + Req : req, + } + err = p.CC.SendMsg("dropUser", &args, thrift.CALL) + if err != nil { return } + return p.recvDropUser() +} + + +func (p *MetaServiceThreadsafeClient) recvDropUser() (value *ExecResp, err error) { + var result MetaServiceDropUserResult + err = p.CC.RecvMsg("dropUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AlterUser(req *AlterUserReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAlterUserArgs{ + Req : req, + } + err = p.CC.SendMsg("alterUser", &args, thrift.CALL) + if err != nil { return } + return p.recvAlterUser() +} + + +func (p *MetaServiceThreadsafeClient) recvAlterUser() (value *ExecResp, err error) { + var result MetaServiceAlterUserResult + err = p.CC.RecvMsg("alterUser", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GrantRole(req *GrantRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGrantRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("grantRole", &args, thrift.CALL) + if err != nil { return } + return p.recvGrantRole() +} + + +func (p *MetaServiceThreadsafeClient) recvGrantRole() (value *ExecResp, err error) { + var result MetaServiceGrantRoleResult + err = p.CC.RecvMsg("grantRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RevokeRole(req *RevokeRoleReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + err = p.CC.SendMsg("revokeRole", &args, thrift.CALL) + if err != nil { return } + return p.recvRevokeRole() +} + + +func (p *MetaServiceThreadsafeClient) recvRevokeRole() (value *ExecResp, err error) { + var result MetaServiceRevokeRoleResult + err = p.CC.RecvMsg("revokeRole", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListUsers(req *ListUsersReq) (_r *ListUsersResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListUsersArgs{ + Req : req, + } + err = p.CC.SendMsg("listUsers", &args, thrift.CALL) + if err != nil { return } + return p.recvListUsers() +} + + +func (p *MetaServiceThreadsafeClient) recvListUsers() (value *ListUsersResp, err error) { + var result MetaServiceListUsersResult + err = p.CC.RecvMsg("listUsers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListRoles(req *ListRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("listRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvListRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvListRoles() (value *ListRolesResp, err error) { + var result MetaServiceListRolesResult + err = p.CC.RecvMsg("listRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetUserRoles(req *GetUserRolesReq) (_r *ListRolesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + err = p.CC.SendMsg("getUserRoles", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUserRoles() +} + + +func (p *MetaServiceThreadsafeClient) recvGetUserRoles() (value *ListRolesResp, err error) { + var result MetaServiceGetUserRolesResult + err = p.CC.RecvMsg("getUserRoles", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ChangePassword(req *ChangePasswordReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceChangePasswordArgs{ + Req : req, + } + err = p.CC.SendMsg("changePassword", &args, thrift.CALL) + if err != nil { return } + return p.recvChangePassword() +} + + +func (p *MetaServiceThreadsafeClient) recvChangePassword() (value *ExecResp, err error) { + var result MetaServiceChangePasswordResult + err = p.CC.RecvMsg("changePassword", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) HeartBeat(req *HBReq) (_r *HBResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceHeartBeatArgs{ + Req : req, + } + err = p.CC.SendMsg("heartBeat", &args, thrift.CALL) + if err != nil { return } + return p.recvHeartBeat() +} + + +func (p *MetaServiceThreadsafeClient) recvHeartBeat() (value *HBResp, err error) { + var result MetaServiceHeartBeatResult + err = p.CC.RecvMsg("heartBeat", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) Balance(req *BalanceReq) (_r *BalanceResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("balance", &args, thrift.CALL) + if err != nil { return } + return p.recvBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvBalance() (value *BalanceResp, err error) { + var result MetaServiceBalanceResult + err = p.CC.RecvMsg("balance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) LeaderBalance(req *LeaderBalanceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + err = p.CC.SendMsg("leaderBalance", &args, thrift.CALL) + if err != nil { return } + return p.recvLeaderBalance() +} + + +func (p *MetaServiceThreadsafeClient) recvLeaderBalance() (value *ExecResp, err error) { + var result MetaServiceLeaderBalanceResult + err = p.CC.RecvMsg("leaderBalance", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RegConfig(req *RegConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRegConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("regConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvRegConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvRegConfig() (value *ExecResp, err error) { + var result MetaServiceRegConfigResult + err = p.CC.RecvMsg("regConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetConfig(req *GetConfigReq) (_r *GetConfigResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("getConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvGetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvGetConfig() (value *GetConfigResp, err error) { + var result MetaServiceGetConfigResult + err = p.CC.RecvMsg("getConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SetConfig(req *SetConfigReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSetConfigArgs{ + Req : req, + } + err = p.CC.SendMsg("setConfig", &args, thrift.CALL) + if err != nil { return } + return p.recvSetConfig() +} + + +func (p *MetaServiceThreadsafeClient) recvSetConfig() (value *ExecResp, err error) { + var result MetaServiceSetConfigResult + err = p.CC.RecvMsg("setConfig", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListConfigs(req *ListConfigsReq) (_r *ListConfigsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListConfigsArgs{ + Req : req, + } + err = p.CC.SendMsg("listConfigs", &args, thrift.CALL) + if err != nil { return } + return p.recvListConfigs() +} + + +func (p *MetaServiceThreadsafeClient) recvListConfigs() (value *ListConfigsResp, err error) { + var result MetaServiceListConfigsResult + err = p.CC.RecvMsg("listConfigs", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSnapshot(req *CreateSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("createSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSnapshot() (value *ExecResp, err error) { + var result MetaServiceCreateSnapshotResult + err = p.CC.RecvMsg("createSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropSnapshot(req *DropSnapshotReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + err = p.CC.SendMsg("dropSnapshot", &args, thrift.CALL) + if err != nil { return } + return p.recvDropSnapshot() +} + + +func (p *MetaServiceThreadsafeClient) recvDropSnapshot() (value *ExecResp, err error) { + var result MetaServiceDropSnapshotResult + err = p.CC.RecvMsg("dropSnapshot", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSnapshots(req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSnapshots", &args, thrift.CALL) + if err != nil { return } + return p.recvListSnapshots() +} + + +func (p *MetaServiceThreadsafeClient) recvListSnapshots() (value *ListSnapshotsResp, err error) { + var result MetaServiceListSnapshotsResult + err = p.CC.RecvMsg("listSnapshots", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RunAdminJob(req *AdminJobReq) (_r *AdminJobResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + err = p.CC.SendMsg("runAdminJob", &args, thrift.CALL) + if err != nil { return } + return p.recvRunAdminJob() +} + + +func (p *MetaServiceThreadsafeClient) recvRunAdminJob() (value *AdminJobResp, err error) { + var result MetaServiceRunAdminJobResult + err = p.CC.RecvMsg("runAdminJob", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZone(req *AddZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZone() (value *ExecResp, err error) { + var result MetaServiceAddZoneResult + err = p.CC.RecvMsg("addZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZone(req *DropZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZone() (value *ExecResp, err error) { + var result MetaServiceDropZoneResult + err = p.CC.RecvMsg("dropZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddHostIntoZone(req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("addHostIntoZone", &args, thrift.CALL) + if err != nil { return } + return p.recvAddHostIntoZone() +} + + +func (p *MetaServiceThreadsafeClient) recvAddHostIntoZone() (value *ExecResp, err error) { + var result MetaServiceAddHostIntoZoneResult + err = p.CC.RecvMsg("addHostIntoZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropHostFromZone(req *DropHostFromZoneReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("dropHostFromZone", &args, thrift.CALL) + if err != nil { return } + return p.recvDropHostFromZone() +} + + +func (p *MetaServiceThreadsafeClient) recvDropHostFromZone() (value *ExecResp, err error) { + var result MetaServiceDropHostFromZoneResult + err = p.CC.RecvMsg("dropHostFromZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetZoneArgs{ + Req : req, + } + err = p.CC.SendMsg("getZone", &args, thrift.CALL) + if err != nil { return } + return p.recvGetZone() +} + + +func (p *MetaServiceThreadsafeClient) recvGetZone() (value *GetZoneResp, err error) { + var result MetaServiceGetZoneResult + err = p.CC.RecvMsg("getZone", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListZones(req *ListZonesReq) (_r *ListZonesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListZonesArgs{ + Req : req, + } + err = p.CC.SendMsg("listZones", &args, thrift.CALL) + if err != nil { return } + return p.recvListZones() +} + + +func (p *MetaServiceThreadsafeClient) recvListZones() (value *ListZonesResp, err error) { + var result MetaServiceListZonesResult + err = p.CC.RecvMsg("listZones", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddGroup(req *AddGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddGroup() (value *ExecResp, err error) { + var result MetaServiceAddGroupResult + err = p.CC.RecvMsg("addGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropGroup(req *DropGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropGroup() (value *ExecResp, err error) { + var result MetaServiceDropGroupResult + err = p.CC.RecvMsg("dropGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddZoneIntoGroup(req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("addZoneIntoGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvAddZoneIntoGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvAddZoneIntoGroup() (value *ExecResp, err error) { + var result MetaServiceAddZoneIntoGroupResult + err = p.CC.RecvMsg("addZoneIntoGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropZoneFromGroup(req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("dropZoneFromGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvDropZoneFromGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvDropZoneFromGroup() (value *ExecResp, err error) { + var result MetaServiceDropZoneFromGroupResult + err = p.CC.RecvMsg("dropZoneFromGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetGroup(req *GetGroupReq) (_r *GetGroupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetGroupArgs{ + Req : req, + } + err = p.CC.SendMsg("getGroup", &args, thrift.CALL) + if err != nil { return } + return p.recvGetGroup() +} + + +func (p *MetaServiceThreadsafeClient) recvGetGroup() (value *GetGroupResp, err error) { + var result MetaServiceGetGroupResult + err = p.CC.RecvMsg("getGroup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListGroups(req *ListGroupsReq) (_r *ListGroupsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListGroupsArgs{ + Req : req, + } + err = p.CC.SendMsg("listGroups", &args, thrift.CALL) + if err != nil { return } + return p.recvListGroups() +} + + +func (p *MetaServiceThreadsafeClient) recvListGroups() (value *ListGroupsResp, err error) { + var result MetaServiceListGroupsResult + err = p.CC.RecvMsg("listGroups", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateBackupArgs{ + Req : req, + } + err = p.CC.SendMsg("createBackup", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateBackup() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateBackup() (value *CreateBackupResp, err error) { + var result MetaServiceCreateBackupResult + err = p.CC.RecvMsg("createBackup", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RestoreMeta(req *RestoreMetaReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + err = p.CC.SendMsg("restoreMeta", &args, thrift.CALL) + if err != nil { return } + return p.recvRestoreMeta() +} + + +func (p *MetaServiceThreadsafeClient) recvRestoreMeta() (value *ExecResp, err error) { + var result MetaServiceRestoreMetaResult + err = p.CC.RecvMsg("restoreMeta", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) AddListener(req *AddListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceAddListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("addListener", &args, thrift.CALL) + if err != nil { return } + return p.recvAddListener() +} + + +func (p *MetaServiceThreadsafeClient) recvAddListener() (value *ExecResp, err error) { + var result MetaServiceAddListenerResult + err = p.CC.RecvMsg("addListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveListener(req *RemoveListenerReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("removeListener", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveListener() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveListener() (value *ExecResp, err error) { + var result MetaServiceRemoveListenerResult + err = p.CC.RecvMsg("removeListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListListener(req *ListListenerReq) (_r *ListListenerResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListListenerArgs{ + Req : req, + } + err = p.CC.SendMsg("listListener", &args, thrift.CALL) + if err != nil { return } + return p.recvListListener() +} + + +func (p *MetaServiceThreadsafeClient) recvListListener() (value *ListListenerResp, err error) { + var result MetaServiceListListenerResult + err = p.CC.RecvMsg("listListener", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetStats(req *GetStatsReq) (_r *GetStatsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetStatsArgs{ + Req : req, + } + err = p.CC.SendMsg("getStats", &args, thrift.CALL) + if err != nil { return } + return p.recvGetStats() +} + + +func (p *MetaServiceThreadsafeClient) recvGetStats() (value *GetStatsResp, err error) { + var result MetaServiceGetStatsResult + err = p.CC.RecvMsg("getStats", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignInFTService(req *SignInFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signInFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignInFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignInFTService() (value *ExecResp, err error) { + var result MetaServiceSignInFTServiceResult + err = p.CC.RecvMsg("signInFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) SignOutFTService(req *SignOutFTServiceReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + err = p.CC.SendMsg("signOutFTService", &args, thrift.CALL) + if err != nil { return } + return p.recvSignOutFTService() +} + + +func (p *MetaServiceThreadsafeClient) recvSignOutFTService() (value *ExecResp, err error) { + var result MetaServiceSignOutFTServiceResult + err = p.CC.RecvMsg("signOutFTService", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTClients(req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTClientsArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTClients", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTClients() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTClients() (value *ListFTClientsResp, err error) { + var result MetaServiceListFTClientsResult + err = p.CC.RecvMsg("listFTClients", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateFTIndex(req *CreateFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("createFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateFTIndex() (value *ExecResp, err error) { + var result MetaServiceCreateFTIndexResult + err = p.CC.RecvMsg("createFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) DropFTIndex(req *DropFTIndexReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("dropFTIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvDropFTIndex() +} + + +func (p *MetaServiceThreadsafeClient) recvDropFTIndex() (value *ExecResp, err error) { + var result MetaServiceDropFTIndexResult + err = p.CC.RecvMsg("dropFTIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListFTIndexes(req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + err = p.CC.SendMsg("listFTIndexes", &args, thrift.CALL) + if err != nil { return } + return p.recvListFTIndexes() +} + + +func (p *MetaServiceThreadsafeClient) recvListFTIndexes() (value *ListFTIndexesResp, err error) { + var result MetaServiceListFTIndexesResult + err = p.CC.RecvMsg("listFTIndexes", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) CreateSession(req *CreateSessionReq) (_r *CreateSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceCreateSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("createSession", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateSession() +} + + +func (p *MetaServiceThreadsafeClient) recvCreateSession() (value *CreateSessionResp, err error) { + var result MetaServiceCreateSessionResult + err = p.CC.RecvMsg("createSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) UpdateSessions(req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("updateSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvUpdateSessions() (value *UpdateSessionsResp, err error) { + var result MetaServiceUpdateSessionsResult + err = p.CC.RecvMsg("updateSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListSessions(req *ListSessionsReq) (_r *ListSessionsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListSessionsArgs{ + Req : req, + } + err = p.CC.SendMsg("listSessions", &args, thrift.CALL) + if err != nil { return } + return p.recvListSessions() +} + + +func (p *MetaServiceThreadsafeClient) recvListSessions() (value *ListSessionsResp, err error) { + var result MetaServiceListSessionsResult + err = p.CC.RecvMsg("listSessions", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetSession(req *GetSessionReq) (_r *GetSessionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("getSession", &args, thrift.CALL) + if err != nil { return } + return p.recvGetSession() +} + + +func (p *MetaServiceThreadsafeClient) recvGetSession() (value *GetSessionResp, err error) { + var result MetaServiceGetSessionResult + err = p.CC.RecvMsg("getSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) RemoveSession(req *RemoveSessionReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + err = p.CC.SendMsg("removeSession", &args, thrift.CALL) + if err != nil { return } + return p.recvRemoveSession() +} + + +func (p *MetaServiceThreadsafeClient) recvRemoveSession() (value *ExecResp, err error) { + var result MetaServiceRemoveSessionResult + err = p.CC.RecvMsg("removeSession", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) KillQuery(req *KillQueryReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceKillQueryArgs{ + Req : req, + } + err = p.CC.SendMsg("killQuery", &args, thrift.CALL) + if err != nil { return } + return p.recvKillQuery() +} + + +func (p *MetaServiceThreadsafeClient) recvKillQuery() (value *ExecResp, err error) { + var result MetaServiceKillQueryResult + err = p.CC.RecvMsg("killQuery", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ReportTaskFinish(req *ReportTaskReq) (_r *ExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + err = p.CC.SendMsg("reportTaskFinish", &args, thrift.CALL) + if err != nil { return } + return p.recvReportTaskFinish() +} + + +func (p *MetaServiceThreadsafeClient) recvReportTaskFinish() (value *ExecResp, err error) { + var result MetaServiceReportTaskFinishResult + err = p.CC.RecvMsg("reportTaskFinish", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) ListCluster(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceListClusterArgs{ + Req : req, + } + err = p.CC.SendMsg("listCluster", &args, thrift.CALL) + if err != nil { return } + return p.recvListCluster() +} + + +func (p *MetaServiceThreadsafeClient) recvListCluster() (value *ListClusterInfoResp, err error) { + var result MetaServiceListClusterResult + err = p.CC.RecvMsg("listCluster", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) GetMetaDirInfo(req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("getMetaDirInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvGetMetaDirInfo() +} + + +func (p *MetaServiceThreadsafeClient) recvGetMetaDirInfo() (value *GetMetaDirInfoResp, err error) { + var result MetaServiceGetMetaDirInfoResult + err = p.CC.RecvMsg("getMetaDirInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceThreadsafeClient) VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := MetaServiceVerifyClientVersionArgs{ + Req : req, + } + err = p.CC.SendMsg("verifyClientVersion", &args, thrift.CALL) + if err != nil { return } + return p.recvVerifyClientVersion() +} + + +func (p *MetaServiceThreadsafeClient) recvVerifyClientVersion() (value *VerifyClientVersionResp, err error) { + var result MetaServiceVerifyClientVersionResult + err = p.CC.RecvMsg("verifyClientVersion", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *MetaServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *MetaServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *MetaServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewMetaServiceChannelClient(channel thrift.RequestChannel) *MetaServiceChannelClient { + return &MetaServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceArgs{ + Req : req, + } + var result MetaServiceCreateSpaceResult + err = p.RequestChannel.Call(ctx, "createSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, err error) { + args := MetaServiceDropSpaceArgs{ + Req : req, + } + var result MetaServiceDropSpaceResult + err = p.RequestChannel.Call(ctx, "dropSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, err error) { + args := MetaServiceGetSpaceArgs{ + Req : req, + } + var result MetaServiceGetSpaceResult + err = p.RequestChannel.Call(ctx, "getSpace", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, err error) { + args := MetaServiceListSpacesArgs{ + Req : req, + } + var result MetaServiceListSpacesResult + err = p.RequestChannel.Call(ctx, "listSpaces", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSpaceAs(ctx context.Context, req *CreateSpaceAsReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSpaceAsArgs{ + Req : req, + } + var result MetaServiceCreateSpaceAsResult + err = p.RequestChannel.Call(ctx, "createSpaceAs", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagArgs{ + Req : req, + } + var result MetaServiceCreateTagResult + err = p.RequestChannel.Call(ctx, "createTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, err error) { + args := MetaServiceAlterTagArgs{ + Req : req, + } + var result MetaServiceAlterTagResult + err = p.RequestChannel.Call(ctx, "alterTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagArgs{ + Req : req, + } + var result MetaServiceDropTagResult + err = p.RequestChannel.Call(ctx, "dropTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, err error) { + args := MetaServiceGetTagArgs{ + Req : req, + } + var result MetaServiceGetTagResult + err = p.RequestChannel.Call(ctx, "getTag", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, err error) { + args := MetaServiceListTagsArgs{ + Req : req, + } + var result MetaServiceListTagsResult + err = p.RequestChannel.Call(ctx, "listTags", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeArgs{ + Req : req, + } + var result MetaServiceCreateEdgeResult + err = p.RequestChannel.Call(ctx, "createEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceAlterEdgeArgs{ + Req : req, + } + var result MetaServiceAlterEdgeResult + err = p.RequestChannel.Call(ctx, "alterEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeArgs{ + Req : req, + } + var result MetaServiceDropEdgeResult + err = p.RequestChannel.Call(ctx, "dropEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, err error) { + args := MetaServiceGetEdgeArgs{ + Req : req, + } + var result MetaServiceGetEdgeResult + err = p.RequestChannel.Call(ctx, "getEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, err error) { + args := MetaServiceListEdgesArgs{ + Req : req, + } + var result MetaServiceListEdgesResult + err = p.RequestChannel.Call(ctx, "listEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) { + args := MetaServiceListHostsArgs{ + Req : req, + } + var result MetaServiceListHostsResult + err = p.RequestChannel.Call(ctx, "listHosts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) { + args := MetaServiceGetPartsAllocArgs{ + Req : req, + } + var result MetaServiceGetPartsAllocResult + err = p.RequestChannel.Call(ctx, "getPartsAlloc", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) { + args := MetaServiceListPartsArgs{ + Req : req, + } + var result MetaServiceListPartsResult + err = p.RequestChannel.Call(ctx, "listParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiPut(ctx context.Context, req *MultiPutReq) (_r *ExecResp, err error) { + args := MetaServiceMultiPutArgs{ + Req : req, + } + var result MetaServiceMultiPutResult + err = p.RequestChannel.Call(ctx, "multiPut", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Get(ctx context.Context, req *GetReq) (_r *GetResp, err error) { + args := MetaServiceGetArgs{ + Req : req, + } + var result MetaServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) MultiGet(ctx context.Context, req *MultiGetReq) (_r *MultiGetResp, err error) { + args := MetaServiceMultiGetArgs{ + Req : req, + } + var result MetaServiceMultiGetResult + err = p.RequestChannel.Call(ctx, "multiGet", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Remove(ctx context.Context, req *RemoveReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveArgs{ + Req : req, + } + var result MetaServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveRange(ctx context.Context, req *RemoveRangeReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveRangeArgs{ + Req : req, + } + var result MetaServiceRemoveRangeResult + err = p.RequestChannel.Call(ctx, "removeRange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Scan(ctx context.Context, req *ScanReq) (_r *ScanResp, err error) { + args := MetaServiceScanArgs{ + Req : req, + } + var result MetaServiceScanResult + err = p.RequestChannel.Call(ctx, "scan", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateTagIndexArgs{ + Req : req, + } + var result MetaServiceCreateTagIndexResult + err = p.RequestChannel.Call(ctx, "createTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropTagIndexArgs{ + Req : req, + } + var result MetaServiceDropTagIndexResult + err = p.RequestChannel.Call(ctx, "dropTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, err error) { + args := MetaServiceGetTagIndexArgs{ + Req : req, + } + var result MetaServiceGetTagIndexResult + err = p.RequestChannel.Call(ctx, "getTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, err error) { + args := MetaServiceListTagIndexesArgs{ + Req : req, + } + var result MetaServiceListTagIndexesResult + err = p.RequestChannel.Call(ctx, "listTagIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildTagIndexArgs{ + Req : req, + } + var result MetaServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListTagIndexStatusArgs{ + Req : req, + } + var result MetaServiceListTagIndexStatusResult + err = p.RequestChannel.Call(ctx, "listTagIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateEdgeIndexArgs{ + Req : req, + } + var result MetaServiceCreateEdgeIndexResult + err = p.RequestChannel.Call(ctx, "createEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropEdgeIndexArgs{ + Req : req, + } + var result MetaServiceDropEdgeIndexResult + err = p.RequestChannel.Call(ctx, "dropEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, err error) { + args := MetaServiceGetEdgeIndexArgs{ + Req : req, + } + var result MetaServiceGetEdgeIndexResult + err = p.RequestChannel.Call(ctx, "getEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, err error) { + args := MetaServiceListEdgeIndexesArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexesResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, err error) { + args := MetaServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result MetaServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, err error) { + args := MetaServiceListEdgeIndexStatusArgs{ + Req : req, + } + var result MetaServiceListEdgeIndexStatusResult + err = p.RequestChannel.Call(ctx, "listEdgeIndexStatus", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, err error) { + args := MetaServiceCreateUserArgs{ + Req : req, + } + var result MetaServiceCreateUserResult + err = p.RequestChannel.Call(ctx, "createUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, err error) { + args := MetaServiceDropUserArgs{ + Req : req, + } + var result MetaServiceDropUserResult + err = p.RequestChannel.Call(ctx, "dropUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, err error) { + args := MetaServiceAlterUserArgs{ + Req : req, + } + var result MetaServiceAlterUserResult + err = p.RequestChannel.Call(ctx, "alterUser", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, err error) { + args := MetaServiceGrantRoleArgs{ + Req : req, + } + var result MetaServiceGrantRoleResult + err = p.RequestChannel.Call(ctx, "grantRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, err error) { + args := MetaServiceRevokeRoleArgs{ + Req : req, + } + var result MetaServiceRevokeRoleResult + err = p.RequestChannel.Call(ctx, "revokeRole", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, err error) { + args := MetaServiceListUsersArgs{ + Req : req, + } + var result MetaServiceListUsersResult + err = p.RequestChannel.Call(ctx, "listUsers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceListRolesArgs{ + Req : req, + } + var result MetaServiceListRolesResult + err = p.RequestChannel.Call(ctx, "listRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, err error) { + args := MetaServiceGetUserRolesArgs{ + Req : req, + } + var result MetaServiceGetUserRolesResult + err = p.RequestChannel.Call(ctx, "getUserRoles", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, err error) { + args := MetaServiceChangePasswordArgs{ + Req : req, + } + var result MetaServiceChangePasswordResult + err = p.RequestChannel.Call(ctx, "changePassword", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, err error) { + args := MetaServiceHeartBeatArgs{ + Req : req, + } + var result MetaServiceHeartBeatResult + err = p.RequestChannel.Call(ctx, "heartBeat", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) Balance(ctx context.Context, req *BalanceReq) (_r *BalanceResp, err error) { + args := MetaServiceBalanceArgs{ + Req : req, + } + var result MetaServiceBalanceResult + err = p.RequestChannel.Call(ctx, "balance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) LeaderBalance(ctx context.Context, req *LeaderBalanceReq) (_r *ExecResp, err error) { + args := MetaServiceLeaderBalanceArgs{ + Req : req, + } + var result MetaServiceLeaderBalanceResult + err = p.RequestChannel.Call(ctx, "leaderBalance", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, err error) { + args := MetaServiceRegConfigArgs{ + Req : req, + } + var result MetaServiceRegConfigResult + err = p.RequestChannel.Call(ctx, "regConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, err error) { + args := MetaServiceGetConfigArgs{ + Req : req, + } + var result MetaServiceGetConfigResult + err = p.RequestChannel.Call(ctx, "getConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, err error) { + args := MetaServiceSetConfigArgs{ + Req : req, + } + var result MetaServiceSetConfigResult + err = p.RequestChannel.Call(ctx, "setConfig", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, err error) { + args := MetaServiceListConfigsArgs{ + Req : req, + } + var result MetaServiceListConfigsResult + err = p.RequestChannel.Call(ctx, "listConfigs", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceCreateSnapshotArgs{ + Req : req, + } + var result MetaServiceCreateSnapshotResult + err = p.RequestChannel.Call(ctx, "createSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, err error) { + args := MetaServiceDropSnapshotArgs{ + Req : req, + } + var result MetaServiceDropSnapshotResult + err = p.RequestChannel.Call(ctx, "dropSnapshot", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, err error) { + args := MetaServiceListSnapshotsArgs{ + Req : req, + } + var result MetaServiceListSnapshotsResult + err = p.RequestChannel.Call(ctx, "listSnapshots", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, err error) { + args := MetaServiceRunAdminJobArgs{ + Req : req, + } + var result MetaServiceRunAdminJobResult + err = p.RequestChannel.Call(ctx, "runAdminJob", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZone(ctx context.Context, req *AddZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneArgs{ + Req : req, + } + var result MetaServiceAddZoneResult + err = p.RequestChannel.Call(ctx, "addZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneArgs{ + Req : req, + } + var result MetaServiceDropZoneResult + err = p.RequestChannel.Call(ctx, "dropZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddHostIntoZone(ctx context.Context, req *AddHostIntoZoneReq) (_r *ExecResp, err error) { + args := MetaServiceAddHostIntoZoneArgs{ + Req : req, + } + var result MetaServiceAddHostIntoZoneResult + err = p.RequestChannel.Call(ctx, "addHostIntoZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropHostFromZone(ctx context.Context, req *DropHostFromZoneReq) (_r *ExecResp, err error) { + args := MetaServiceDropHostFromZoneArgs{ + Req : req, + } + var result MetaServiceDropHostFromZoneResult + err = p.RequestChannel.Call(ctx, "dropHostFromZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, err error) { + args := MetaServiceGetZoneArgs{ + Req : req, + } + var result MetaServiceGetZoneResult + err = p.RequestChannel.Call(ctx, "getZone", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, err error) { + args := MetaServiceListZonesArgs{ + Req : req, + } + var result MetaServiceListZonesResult + err = p.RequestChannel.Call(ctx, "listZones", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddGroup(ctx context.Context, req *AddGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddGroupArgs{ + Req : req, + } + var result MetaServiceAddGroupResult + err = p.RequestChannel.Call(ctx, "addGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropGroup(ctx context.Context, req *DropGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropGroupArgs{ + Req : req, + } + var result MetaServiceDropGroupResult + err = p.RequestChannel.Call(ctx, "dropGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddZoneIntoGroup(ctx context.Context, req *AddZoneIntoGroupReq) (_r *ExecResp, err error) { + args := MetaServiceAddZoneIntoGroupArgs{ + Req : req, + } + var result MetaServiceAddZoneIntoGroupResult + err = p.RequestChannel.Call(ctx, "addZoneIntoGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropZoneFromGroup(ctx context.Context, req *DropZoneFromGroupReq) (_r *ExecResp, err error) { + args := MetaServiceDropZoneFromGroupArgs{ + Req : req, + } + var result MetaServiceDropZoneFromGroupResult + err = p.RequestChannel.Call(ctx, "dropZoneFromGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetGroup(ctx context.Context, req *GetGroupReq) (_r *GetGroupResp, err error) { + args := MetaServiceGetGroupArgs{ + Req : req, + } + var result MetaServiceGetGroupResult + err = p.RequestChannel.Call(ctx, "getGroup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListGroups(ctx context.Context, req *ListGroupsReq) (_r *ListGroupsResp, err error) { + args := MetaServiceListGroupsArgs{ + Req : req, + } + var result MetaServiceListGroupsResult + err = p.RequestChannel.Call(ctx, "listGroups", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) { + args := MetaServiceCreateBackupArgs{ + Req : req, + } + var result MetaServiceCreateBackupResult + err = p.RequestChannel.Call(ctx, "createBackup", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *ExecResp, err error) { + args := MetaServiceRestoreMetaArgs{ + Req : req, + } + var result MetaServiceRestoreMetaResult + err = p.RequestChannel.Call(ctx, "restoreMeta", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, err error) { + args := MetaServiceAddListenerArgs{ + Req : req, + } + var result MetaServiceAddListenerResult + err = p.RequestChannel.Call(ctx, "addListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveListenerArgs{ + Req : req, + } + var result MetaServiceRemoveListenerResult + err = p.RequestChannel.Call(ctx, "removeListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, err error) { + args := MetaServiceListListenerArgs{ + Req : req, + } + var result MetaServiceListListenerResult + err = p.RequestChannel.Call(ctx, "listListener", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetStats(ctx context.Context, req *GetStatsReq) (_r *GetStatsResp, err error) { + args := MetaServiceGetStatsArgs{ + Req : req, + } + var result MetaServiceGetStatsResult + err = p.RequestChannel.Call(ctx, "getStats", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignInFTService(ctx context.Context, req *SignInFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignInFTServiceArgs{ + Req : req, + } + var result MetaServiceSignInFTServiceResult + err = p.RequestChannel.Call(ctx, "signInFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) SignOutFTService(ctx context.Context, req *SignOutFTServiceReq) (_r *ExecResp, err error) { + args := MetaServiceSignOutFTServiceArgs{ + Req : req, + } + var result MetaServiceSignOutFTServiceResult + err = p.RequestChannel.Call(ctx, "signOutFTService", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTClients(ctx context.Context, req *ListFTClientsReq) (_r *ListFTClientsResp, err error) { + args := MetaServiceListFTClientsArgs{ + Req : req, + } + var result MetaServiceListFTClientsResult + err = p.RequestChannel.Call(ctx, "listFTClients", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceCreateFTIndexArgs{ + Req : req, + } + var result MetaServiceCreateFTIndexResult + err = p.RequestChannel.Call(ctx, "createFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, err error) { + args := MetaServiceDropFTIndexArgs{ + Req : req, + } + var result MetaServiceDropFTIndexResult + err = p.RequestChannel.Call(ctx, "dropFTIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, err error) { + args := MetaServiceListFTIndexesArgs{ + Req : req, + } + var result MetaServiceListFTIndexesResult + err = p.RequestChannel.Call(ctx, "listFTIndexes", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, err error) { + args := MetaServiceCreateSessionArgs{ + Req : req, + } + var result MetaServiceCreateSessionResult + err = p.RequestChannel.Call(ctx, "createSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, err error) { + args := MetaServiceUpdateSessionsArgs{ + Req : req, + } + var result MetaServiceUpdateSessionsResult + err = p.RequestChannel.Call(ctx, "updateSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, err error) { + args := MetaServiceListSessionsArgs{ + Req : req, + } + var result MetaServiceListSessionsResult + err = p.RequestChannel.Call(ctx, "listSessions", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, err error) { + args := MetaServiceGetSessionArgs{ + Req : req, + } + var result MetaServiceGetSessionResult + err = p.RequestChannel.Call(ctx, "getSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *ExecResp, err error) { + args := MetaServiceRemoveSessionArgs{ + Req : req, + } + var result MetaServiceRemoveSessionResult + err = p.RequestChannel.Call(ctx, "removeSession", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, err error) { + args := MetaServiceKillQueryArgs{ + Req : req, + } + var result MetaServiceKillQueryResult + err = p.RequestChannel.Call(ctx, "killQuery", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, err error) { + args := MetaServiceReportTaskFinishArgs{ + Req : req, + } + var result MetaServiceReportTaskFinishResult + err = p.RequestChannel.Call(ctx, "reportTaskFinish", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := MetaServiceListClusterArgs{ + Req : req, + } + var result MetaServiceListClusterResult + err = p.RequestChannel.Call(ctx, "listCluster", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, err error) { + args := MetaServiceGetMetaDirInfoArgs{ + Req : req, + } + var result MetaServiceGetMetaDirInfoResult + err = p.RequestChannel.Call(ctx, "getMetaDirInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *MetaServiceChannelClient) VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) { + args := MetaServiceVerifyClientVersionArgs{ + Req : req, + } + var result MetaServiceVerifyClientVersionResult + err = p.RequestChannel.Call(ctx, "verifyClientVersion", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type MetaServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler MetaService +} + +func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *MetaServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { + self97 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self97.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self97.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self97.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self97.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self97.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} + self97.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self97.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self97.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self97.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self97.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self97.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self97.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self97.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self97.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self97.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self97.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self97.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self97.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self97.processorMap["multiPut"] = &metaServiceProcessorMultiPut{handler:handler} + self97.processorMap["get"] = &metaServiceProcessorGet{handler:handler} + self97.processorMap["multiGet"] = &metaServiceProcessorMultiGet{handler:handler} + self97.processorMap["remove"] = &metaServiceProcessorRemove{handler:handler} + self97.processorMap["removeRange"] = &metaServiceProcessorRemoveRange{handler:handler} + self97.processorMap["scan"] = &metaServiceProcessorScan{handler:handler} + self97.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self97.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self97.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self97.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self97.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self97.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self97.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self97.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self97.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self97.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self97.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self97.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self97.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self97.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self97.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self97.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self97.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self97.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self97.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self97.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self97.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self97.processorMap["balance"] = &metaServiceProcessorBalance{handler:handler} + self97.processorMap["leaderBalance"] = &metaServiceProcessorLeaderBalance{handler:handler} + self97.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self97.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self97.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self97.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self97.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self97.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self97.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self97.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self97.processorMap["addZone"] = &metaServiceProcessorAddZone{handler:handler} + self97.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self97.processorMap["addHostIntoZone"] = &metaServiceProcessorAddHostIntoZone{handler:handler} + self97.processorMap["dropHostFromZone"] = &metaServiceProcessorDropHostFromZone{handler:handler} + self97.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self97.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self97.processorMap["addGroup"] = &metaServiceProcessorAddGroup{handler:handler} + self97.processorMap["dropGroup"] = &metaServiceProcessorDropGroup{handler:handler} + self97.processorMap["addZoneIntoGroup"] = &metaServiceProcessorAddZoneIntoGroup{handler:handler} + self97.processorMap["dropZoneFromGroup"] = &metaServiceProcessorDropZoneFromGroup{handler:handler} + self97.processorMap["getGroup"] = &metaServiceProcessorGetGroup{handler:handler} + self97.processorMap["listGroups"] = &metaServiceProcessorListGroups{handler:handler} + self97.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self97.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self97.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self97.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self97.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self97.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} + self97.processorMap["signInFTService"] = &metaServiceProcessorSignInFTService{handler:handler} + self97.processorMap["signOutFTService"] = &metaServiceProcessorSignOutFTService{handler:handler} + self97.processorMap["listFTClients"] = &metaServiceProcessorListFTClients{handler:handler} + self97.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self97.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self97.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self97.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self97.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self97.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self97.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self97.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self97.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self97.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self97.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self97.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + self97.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} + return self97 +} + +type metaServiceProcessorCreateSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSpace) 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("createSpace", 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 *metaServiceProcessorCreateSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSpaceArgs) + var result MetaServiceCreateSpaceResult + if retval, err := p.handler.CreateSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSpace) 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("dropSpace", 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 *metaServiceProcessorDropSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSpaceArgs) + var result MetaServiceDropSpaceResult + if retval, err := p.handler.DropSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSpaceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSpace) 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("getSpace", 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 *metaServiceProcessorGetSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSpaceArgs) + var result MetaServiceGetSpaceResult + if retval, err := p.handler.GetSpace(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSpace: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSpaces struct { + handler MetaService +} + +func (p *metaServiceProcessorListSpaces) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSpacesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSpaces) 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("listSpaces", 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 *metaServiceProcessorListSpaces) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSpacesArgs) + var result MetaServiceListSpacesResult + if retval, err := p.handler.ListSpaces(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSpaces: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSpaceAs struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpaceAs) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSpaceAsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSpaceAs) 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("createSpaceAs", 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 *metaServiceProcessorCreateSpaceAs) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSpaceAsArgs) + var result MetaServiceCreateSpaceAsResult + if retval, err := p.handler.CreateSpaceAs(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpaceAs: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTag struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTag) 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("createTag", 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 *metaServiceProcessorCreateTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagArgs) + var result MetaServiceCreateTagResult + if retval, err := p.handler.CreateTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterTag struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterTag) 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("alterTag", 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 *metaServiceProcessorAlterTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterTagArgs) + var result MetaServiceAlterTagResult + if retval, err := p.handler.AlterTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTag struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTag) 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("dropTag", 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 *metaServiceProcessorDropTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagArgs) + var result MetaServiceDropTagResult + if retval, err := p.handler.DropTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTag struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTag) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTag) 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("getTag", 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 *metaServiceProcessorGetTag) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagArgs) + var result MetaServiceGetTagResult + if retval, err := p.handler.GetTag(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTag: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTags struct { + handler MetaService +} + +func (p *metaServiceProcessorListTags) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTags) 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("listTags", 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 *metaServiceProcessorListTags) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagsArgs) + var result MetaServiceListTagsResult + if retval, err := p.handler.ListTags(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTags: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdge) 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("createEdge", 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 *metaServiceProcessorCreateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeArgs) + var result MetaServiceCreateEdgeResult + if retval, err := p.handler.CreateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterEdge) 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("alterEdge", 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 *metaServiceProcessorAlterEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterEdgeArgs) + var result MetaServiceAlterEdgeResult + if retval, err := p.handler.AlterEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdge) 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("dropEdge", 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 *metaServiceProcessorDropEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeArgs) + var result MetaServiceDropEdgeResult + if retval, err := p.handler.DropEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdge) 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("getEdge", 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 *metaServiceProcessorGetEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeArgs) + var result MetaServiceGetEdgeResult + if retval, err := p.handler.GetEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdges struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdges) 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("listEdges", 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 *metaServiceProcessorListEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgesArgs) + var result MetaServiceListEdgesResult + if retval, err := p.handler.ListEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorListHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListHostsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListHosts) 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("listHosts", 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 *metaServiceProcessorListHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListHostsArgs) + var result MetaServiceListHostsResult + if retval, err := p.handler.ListHosts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listHosts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetPartsAlloc struct { + handler MetaService +} + +func (p *metaServiceProcessorGetPartsAlloc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetPartsAllocArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetPartsAlloc) 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("getPartsAlloc", 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 *metaServiceProcessorGetPartsAlloc) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetPartsAllocArgs) + var result MetaServiceGetPartsAllocResult + if retval, err := p.handler.GetPartsAlloc(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartsAlloc: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListParts struct { + handler MetaService +} + +func (p *metaServiceProcessorListParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListParts) 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("listParts", 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 *metaServiceProcessorListParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListPartsArgs) + var result MetaServiceListPartsResult + if retval, err := p.handler.ListParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiPut struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiPutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiPut) 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("multiPut", 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 *metaServiceProcessorMultiPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiPutArgs) + var result MetaServiceMultiPutResult + if retval, err := p.handler.MultiPut(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiPut: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGet struct { + handler MetaService +} + +func (p *metaServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetArgs) + var result MetaServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorMultiGet struct { + handler MetaService +} + +func (p *metaServiceProcessorMultiGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceMultiGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorMultiGet) 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("multiGet", 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 *metaServiceProcessorMultiGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceMultiGetArgs) + var result MetaServiceMultiGetResult + if retval, err := p.handler.MultiGet(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multiGet: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemove struct { + handler MetaService +} + +func (p *metaServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *metaServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveArgs) + var result MetaServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveRange struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveRange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveRangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveRange) 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("removeRange", 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 *metaServiceProcessorRemoveRange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveRangeArgs) + var result MetaServiceRemoveRangeResult + if retval, err := p.handler.RemoveRange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeRange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorScan struct { + handler MetaService +} + +func (p *metaServiceProcessorScan) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceScanArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorScan) 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("scan", 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 *metaServiceProcessorScan) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceScanArgs) + var result MetaServiceScanResult + if retval, err := p.handler.Scan(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateTagIndex) 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("createTagIndex", 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 *metaServiceProcessorCreateTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateTagIndexArgs) + var result MetaServiceCreateTagIndexResult + if retval, err := p.handler.CreateTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropTagIndex) 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("dropTagIndex", 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 *metaServiceProcessorDropTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropTagIndexArgs) + var result MetaServiceDropTagIndexResult + if retval, err := p.handler.DropTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetTagIndex) 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("getTagIndex", 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 *metaServiceProcessorGetTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetTagIndexArgs) + var result MetaServiceGetTagIndexResult + if retval, err := p.handler.GetTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexes) 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("listTagIndexes", 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 *metaServiceProcessorListTagIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexesArgs) + var result MetaServiceListTagIndexesResult + if retval, err := p.handler.ListTagIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *metaServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildTagIndexArgs) + var result MetaServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListTagIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListTagIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListTagIndexStatus) 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("listTagIndexStatus", 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 *metaServiceProcessorListTagIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListTagIndexStatusArgs) + var result MetaServiceListTagIndexStatusResult + if retval, err := p.handler.ListTagIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateEdgeIndex) 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("createEdgeIndex", 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 *metaServiceProcessorCreateEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateEdgeIndexArgs) + var result MetaServiceCreateEdgeIndexResult + if retval, err := p.handler.CreateEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropEdgeIndex) 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("dropEdgeIndex", 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 *metaServiceProcessorDropEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropEdgeIndexArgs) + var result MetaServiceDropEdgeIndexResult + if retval, err := p.handler.DropEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetEdgeIndex) 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("getEdgeIndex", 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 *metaServiceProcessorGetEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetEdgeIndexArgs) + var result MetaServiceGetEdgeIndexResult + if retval, err := p.handler.GetEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexes) 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("listEdgeIndexes", 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 *metaServiceProcessorListEdgeIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexesArgs) + var result MetaServiceListEdgeIndexesResult + if retval, err := p.handler.ListEdgeIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRebuildEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *metaServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRebuildEdgeIndexArgs) + var result MetaServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListEdgeIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexStatus) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListEdgeIndexStatusArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListEdgeIndexStatus) 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("listEdgeIndexStatus", 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 *metaServiceProcessorListEdgeIndexStatus) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListEdgeIndexStatusArgs) + var result MetaServiceListEdgeIndexStatusResult + if retval, err := p.handler.ListEdgeIndexStatus(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexStatus: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateUser struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateUser) 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("createUser", 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 *metaServiceProcessorCreateUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateUserArgs) + var result MetaServiceCreateUserResult + if retval, err := p.handler.CreateUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropUser struct { + handler MetaService +} + +func (p *metaServiceProcessorDropUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropUser) 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("dropUser", 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 *metaServiceProcessorDropUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropUserArgs) + var result MetaServiceDropUserResult + if retval, err := p.handler.DropUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAlterUser struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterUser) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAlterUserArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAlterUser) 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("alterUser", 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 *metaServiceProcessorAlterUser) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAlterUserArgs) + var result MetaServiceAlterUserResult + if retval, err := p.handler.AlterUser(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterUser: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGrantRole struct { + handler MetaService +} + +func (p *metaServiceProcessorGrantRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGrantRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGrantRole) 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("grantRole", 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 *metaServiceProcessorGrantRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGrantRoleArgs) + var result MetaServiceGrantRoleResult + if retval, err := p.handler.GrantRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grantRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRevokeRole struct { + handler MetaService +} + +func (p *metaServiceProcessorRevokeRole) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRevokeRoleArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRevokeRole) 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("revokeRole", 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 *metaServiceProcessorRevokeRole) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRevokeRoleArgs) + var result MetaServiceRevokeRoleResult + if retval, err := p.handler.RevokeRole(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeRole: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListUsers struct { + handler MetaService +} + +func (p *metaServiceProcessorListUsers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListUsersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListUsers) 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("listUsers", 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 *metaServiceProcessorListUsers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListUsersArgs) + var result MetaServiceListUsersResult + if retval, err := p.handler.ListUsers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listUsers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorListRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListRoles) 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("listRoles", 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 *metaServiceProcessorListRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListRolesArgs) + var result MetaServiceListRolesResult + if retval, err := p.handler.ListRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetUserRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorGetUserRoles) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetUserRolesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetUserRoles) 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("getUserRoles", 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 *metaServiceProcessorGetUserRoles) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetUserRolesArgs) + var result MetaServiceGetUserRolesResult + if retval, err := p.handler.GetUserRoles(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUserRoles: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorChangePassword struct { + handler MetaService +} + +func (p *metaServiceProcessorChangePassword) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceChangePasswordArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorChangePassword) 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("changePassword", 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 *metaServiceProcessorChangePassword) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceChangePasswordArgs) + var result MetaServiceChangePasswordResult + if retval, err := p.handler.ChangePassword(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changePassword: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorHeartBeat struct { + handler MetaService +} + +func (p *metaServiceProcessorHeartBeat) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceHeartBeatArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorHeartBeat) 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("heartBeat", 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 *metaServiceProcessorHeartBeat) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceHeartBeatArgs) + var result MetaServiceHeartBeatResult + if retval, err := p.handler.HeartBeat(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing heartBeat: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorBalance) 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("balance", 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 *metaServiceProcessorBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceBalanceArgs) + var result MetaServiceBalanceResult + if retval, err := p.handler.Balance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing balance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorLeaderBalance struct { + handler MetaService +} + +func (p *metaServiceProcessorLeaderBalance) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceLeaderBalanceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorLeaderBalance) 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("leaderBalance", 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 *metaServiceProcessorLeaderBalance) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceLeaderBalanceArgs) + var result MetaServiceLeaderBalanceResult + if retval, err := p.handler.LeaderBalance(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing leaderBalance: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRegConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorRegConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRegConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRegConfig) 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("regConfig", 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 *metaServiceProcessorRegConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRegConfigArgs) + var result MetaServiceRegConfigResult + if retval, err := p.handler.RegConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing regConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorGetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetConfig) 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("getConfig", 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 *metaServiceProcessorGetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetConfigArgs) + var result MetaServiceGetConfigResult + if retval, err := p.handler.GetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorSetConfig) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSetConfigArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSetConfig) 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("setConfig", 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 *metaServiceProcessorSetConfig) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSetConfigArgs) + var result MetaServiceSetConfigResult + if retval, err := p.handler.SetConfig(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setConfig: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListConfigs struct { + handler MetaService +} + +func (p *metaServiceProcessorListConfigs) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListConfigsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListConfigs) 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("listConfigs", 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 *metaServiceProcessorListConfigs) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListConfigsArgs) + var result MetaServiceListConfigsResult + if retval, err := p.handler.ListConfigs(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listConfigs: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSnapshot) 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("createSnapshot", 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 *metaServiceProcessorCreateSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSnapshotArgs) + var result MetaServiceCreateSnapshotResult + if retval, err := p.handler.CreateSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSnapshot) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropSnapshotArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropSnapshot) 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("dropSnapshot", 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 *metaServiceProcessorDropSnapshot) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropSnapshotArgs) + var result MetaServiceDropSnapshotResult + if retval, err := p.handler.DropSnapshot(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSnapshot: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSnapshots struct { + handler MetaService +} + +func (p *metaServiceProcessorListSnapshots) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSnapshotsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSnapshots) 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("listSnapshots", 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 *metaServiceProcessorListSnapshots) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSnapshotsArgs) + var result MetaServiceListSnapshotsResult + if retval, err := p.handler.ListSnapshots(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSnapshots: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRunAdminJob struct { + handler MetaService +} + +func (p *metaServiceProcessorRunAdminJob) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRunAdminJobArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRunAdminJob) 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("runAdminJob", 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 *metaServiceProcessorRunAdminJob) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRunAdminJobArgs) + var result MetaServiceRunAdminJobResult + if retval, err := p.handler.RunAdminJob(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing runAdminJob: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneArgs) + var result MetaServiceAddZoneResult + if retval, err := p.handler.AddZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZone) 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("dropZone", 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 *metaServiceProcessorDropZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneArgs) + var result MetaServiceDropZoneResult + if retval, err := p.handler.DropZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddHostIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddHostIntoZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddHostIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("addHostIntoZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorAddHostIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddHostIntoZoneArgs) + var result MetaServiceAddHostIntoZoneResult + if retval, err := p.handler.AddHostIntoZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostIntoZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropHostFromZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHostFromZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropHostFromZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropHostFromZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("dropHostFromZone", messageType, seqId); err2 != nil { + 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 *metaServiceProcessorDropHostFromZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropHostFromZoneArgs) + var result MetaServiceDropHostFromZoneResult + if retval, err := p.handler.DropHostFromZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHostFromZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetZone struct { + handler MetaService +} + +func (p *metaServiceProcessorGetZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetZoneArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetZone) 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("getZone", 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 *metaServiceProcessorGetZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetZoneArgs) + var result MetaServiceGetZoneResult + if retval, err := p.handler.GetZone(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getZone: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListZones struct { + handler MetaService +} + +func (p *metaServiceProcessorListZones) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListZonesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListZones) 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("listZones", 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 *metaServiceProcessorListZones) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListZonesArgs) + var result MetaServiceListZonesResult + if retval, err := p.handler.ListZones(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listZones: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddGroup) 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("addGroup", 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 *metaServiceProcessorAddGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddGroupArgs) + var result MetaServiceAddGroupResult + if retval, err := p.handler.AddGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropGroup) 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("dropGroup", 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 *metaServiceProcessorDropGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropGroupArgs) + var result MetaServiceDropGroupResult + if retval, err := p.handler.DropGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddZoneIntoGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorAddZoneIntoGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddZoneIntoGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddZoneIntoGroup) 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("addZoneIntoGroup", 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 *metaServiceProcessorAddZoneIntoGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddZoneIntoGroupArgs) + var result MetaServiceAddZoneIntoGroupResult + if retval, err := p.handler.AddZoneIntoGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addZoneIntoGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropZoneFromGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZoneFromGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropZoneFromGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropZoneFromGroup) 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("dropZoneFromGroup", 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 *metaServiceProcessorDropZoneFromGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropZoneFromGroupArgs) + var result MetaServiceDropZoneFromGroupResult + if retval, err := p.handler.DropZoneFromGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZoneFromGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetGroup struct { + handler MetaService +} + +func (p *metaServiceProcessorGetGroup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetGroupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetGroup) 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("getGroup", 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 *metaServiceProcessorGetGroup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetGroupArgs) + var result MetaServiceGetGroupResult + if retval, err := p.handler.GetGroup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getGroup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListGroups struct { + handler MetaService +} + +func (p *metaServiceProcessorListGroups) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListGroupsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListGroups) 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("listGroups", 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 *metaServiceProcessorListGroups) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListGroupsArgs) + var result MetaServiceListGroupsResult + if retval, err := p.handler.ListGroups(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listGroups: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateBackup struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateBackup) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateBackupArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateBackup) 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("createBackup", 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 *metaServiceProcessorCreateBackup) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateBackupArgs) + var result MetaServiceCreateBackupResult + if retval, err := p.handler.CreateBackup(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createBackup: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRestoreMeta struct { + handler MetaService +} + +func (p *metaServiceProcessorRestoreMeta) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRestoreMetaArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRestoreMeta) 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("restoreMeta", 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 *metaServiceProcessorRestoreMeta) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRestoreMetaArgs) + var result MetaServiceRestoreMetaResult + if retval, err := p.handler.RestoreMeta(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restoreMeta: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorAddListener struct { + handler MetaService +} + +func (p *metaServiceProcessorAddListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceAddListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorAddListener) 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("addListener", 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 *metaServiceProcessorAddListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceAddListenerArgs) + var result MetaServiceAddListenerResult + if retval, err := p.handler.AddListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveListener struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveListener) 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("removeListener", 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 *metaServiceProcessorRemoveListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveListenerArgs) + var result MetaServiceRemoveListenerResult + if retval, err := p.handler.RemoveListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListListener struct { + handler MetaService +} + +func (p *metaServiceProcessorListListener) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListListenerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListListener) 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("listListener", 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 *metaServiceProcessorListListener) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListListenerArgs) + var result MetaServiceListListenerResult + if retval, err := p.handler.ListListener(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listListener: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetStats struct { + handler MetaService +} + +func (p *metaServiceProcessorGetStats) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetStatsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetStats) 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("getStats", 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 *metaServiceProcessorGetStats) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetStatsArgs) + var result MetaServiceGetStatsResult + if retval, err := p.handler.GetStats(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStats: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignInFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignInFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignInFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignInFTService) 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("signInFTService", 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 *metaServiceProcessorSignInFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignInFTServiceArgs) + var result MetaServiceSignInFTServiceResult + if retval, err := p.handler.SignInFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorSignOutFTService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignOutFTService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceSignOutFTServiceArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorSignOutFTService) 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("signOutFTService", 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 *metaServiceProcessorSignOutFTService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceSignOutFTServiceArgs) + var result MetaServiceSignOutFTServiceResult + if retval, err := p.handler.SignOutFTService(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutFTService: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTClients struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTClients) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTClientsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTClients) 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("listFTClients", 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 *metaServiceProcessorListFTClients) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTClientsArgs) + var result MetaServiceListFTClientsResult + if retval, err := p.handler.ListFTClients(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTClients: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateFTIndex) 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("createFTIndex", 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 *metaServiceProcessorCreateFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateFTIndexArgs) + var result MetaServiceCreateFTIndexResult + if retval, err := p.handler.CreateFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorDropFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropFTIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceDropFTIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorDropFTIndex) 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("dropFTIndex", 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 *metaServiceProcessorDropFTIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceDropFTIndexArgs) + var result MetaServiceDropFTIndexResult + if retval, err := p.handler.DropFTIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropFTIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListFTIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTIndexes) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListFTIndexesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListFTIndexes) 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("listFTIndexes", 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 *metaServiceProcessorListFTIndexes) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListFTIndexesArgs) + var result MetaServiceListFTIndexesResult + if retval, err := p.handler.ListFTIndexes(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTIndexes: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorCreateSession struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceCreateSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorCreateSession) 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("createSession", 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 *metaServiceProcessorCreateSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceCreateSessionArgs) + var result MetaServiceCreateSessionResult + if retval, err := p.handler.CreateSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorUpdateSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorUpdateSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceUpdateSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorUpdateSessions) 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("updateSessions", 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 *metaServiceProcessorUpdateSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceUpdateSessionsArgs) + var result MetaServiceUpdateSessionsResult + if retval, err := p.handler.UpdateSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorListSessions) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListSessionsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListSessions) 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("listSessions", 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 *metaServiceProcessorListSessions) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListSessionsArgs) + var result MetaServiceListSessionsResult + if retval, err := p.handler.ListSessions(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSessions: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetSession struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetSession) 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("getSession", 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 *metaServiceProcessorGetSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetSessionArgs) + var result MetaServiceGetSessionResult + if retval, err := p.handler.GetSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorRemoveSession struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveSession) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceRemoveSessionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorRemoveSession) 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("removeSession", 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 *metaServiceProcessorRemoveSession) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceRemoveSessionArgs) + var result MetaServiceRemoveSessionResult + if retval, err := p.handler.RemoveSession(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeSession: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorKillQuery struct { + handler MetaService +} + +func (p *metaServiceProcessorKillQuery) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceKillQueryArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorKillQuery) 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("killQuery", 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 *metaServiceProcessorKillQuery) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceKillQueryArgs) + var result MetaServiceKillQueryResult + if retval, err := p.handler.KillQuery(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killQuery: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorReportTaskFinish struct { + handler MetaService +} + +func (p *metaServiceProcessorReportTaskFinish) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceReportTaskFinishArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorReportTaskFinish) 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("reportTaskFinish", 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 *metaServiceProcessorReportTaskFinish) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceReportTaskFinishArgs) + var result MetaServiceReportTaskFinishResult + if retval, err := p.handler.ReportTaskFinish(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reportTaskFinish: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorListCluster struct { + handler MetaService +} + +func (p *metaServiceProcessorListCluster) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceListClusterArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorListCluster) 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("listCluster", 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 *metaServiceProcessorListCluster) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceListClusterArgs) + var result MetaServiceListClusterResult + if retval, err := p.handler.ListCluster(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listCluster: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorGetMetaDirInfo struct { + handler MetaService +} + +func (p *metaServiceProcessorGetMetaDirInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceGetMetaDirInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorGetMetaDirInfo) 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("getMetaDirInfo", 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 *metaServiceProcessorGetMetaDirInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceGetMetaDirInfoArgs) + var result MetaServiceGetMetaDirInfoResult + if retval, err := p.handler.GetMetaDirInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMetaDirInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type metaServiceProcessorVerifyClientVersion struct { + handler MetaService +} + +func (p *metaServiceProcessorVerifyClientVersion) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := MetaServiceVerifyClientVersionArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *metaServiceProcessorVerifyClientVersion) 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("verifyClientVersion", 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 *metaServiceProcessorVerifyClientVersion) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*MetaServiceVerifyClientVersionArgs) + var result MetaServiceVerifyClientVersionResult + if retval, err := p.handler.VerifyClientVersion(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyClientVersion: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type MetaServiceCreateSpaceArgs struct { + thrift.IRequest + Req *CreateSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceArgs() *MetaServiceCreateSpaceArgs { + return &MetaServiceCreateSpaceArgs{ + Req: NewCreateSpaceReq(), + } +} + +var MetaServiceCreateSpaceArgs_Req_DEFAULT *CreateSpaceReq +func (p *MetaServiceCreateSpaceArgs) GetReq() *CreateSpaceReq { + if !p.IsSetReq() { + return MetaServiceCreateSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceArgs) 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 *MetaServiceCreateSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSpaceResult() *MetaServiceCreateSpaceResult { + return &MetaServiceCreateSpaceResult{} +} + +var MetaServiceCreateSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpace_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 *MetaServiceCreateSpaceResult) 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 *MetaServiceCreateSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSpaceArgs struct { + thrift.IRequest + Req *DropSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSpaceArgs() *MetaServiceDropSpaceArgs { + return &MetaServiceDropSpaceArgs{ + Req: NewDropSpaceReq(), + } +} + +var MetaServiceDropSpaceArgs_Req_DEFAULT *DropSpaceReq +func (p *MetaServiceDropSpaceArgs) GetReq() *DropSpaceReq { + if !p.IsSetReq() { + return MetaServiceDropSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceArgs) 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 *MetaServiceDropSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSpaceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSpaceResult() *MetaServiceDropSpaceResult { + return &MetaServiceDropSpaceResult{} +} + +var MetaServiceDropSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSpace_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 *MetaServiceDropSpaceResult) 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 *MetaServiceDropSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSpaceArgs struct { + thrift.IRequest + Req *GetSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSpaceArgs() *MetaServiceGetSpaceArgs { + return &MetaServiceGetSpaceArgs{ + Req: NewGetSpaceReq(), + } +} + +var MetaServiceGetSpaceArgs_Req_DEFAULT *GetSpaceReq +func (p *MetaServiceGetSpaceArgs) GetReq() *GetSpaceReq { + if !p.IsSetReq() { + return MetaServiceGetSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSpaceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSpaceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceArgs) 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 *MetaServiceGetSpaceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSpaceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSpaceResult struct { + thrift.IResponse + Success *GetSpaceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSpaceResult() *MetaServiceGetSpaceResult { + return &MetaServiceGetSpaceResult{} +} + +var MetaServiceGetSpaceResult_Success_DEFAULT *GetSpaceResp +func (p *MetaServiceGetSpaceResult) GetSuccess() *GetSpaceResp { + if !p.IsSetSuccess() { + return MetaServiceGetSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSpaceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSpaceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSpace_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 *MetaServiceGetSpaceResult) 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 *MetaServiceGetSpaceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSpaceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSpacesArgs struct { + thrift.IRequest + Req *ListSpacesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSpacesArgs() *MetaServiceListSpacesArgs { + return &MetaServiceListSpacesArgs{ + Req: NewListSpacesReq(), + } +} + +var MetaServiceListSpacesArgs_Req_DEFAULT *ListSpacesReq +func (p *MetaServiceListSpacesArgs) GetReq() *ListSpacesReq { + if !p.IsSetReq() { + return MetaServiceListSpacesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSpacesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSpacesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesArgs) 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 *MetaServiceListSpacesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSpacesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSpacesResult struct { + thrift.IResponse + Success *ListSpacesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSpacesResult() *MetaServiceListSpacesResult { + return &MetaServiceListSpacesResult{} +} + +var MetaServiceListSpacesResult_Success_DEFAULT *ListSpacesResp +func (p *MetaServiceListSpacesResult) GetSuccess() *ListSpacesResp { + if !p.IsSetSuccess() { + return MetaServiceListSpacesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSpacesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSpacesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSpaces_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 *MetaServiceListSpacesResult) 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 *MetaServiceListSpacesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSpacesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSpaceAsArgs struct { + thrift.IRequest + Req *CreateSpaceAsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceAsArgs() *MetaServiceCreateSpaceAsArgs { + return &MetaServiceCreateSpaceAsArgs{ + Req: NewCreateSpaceAsReq(), + } +} + +var MetaServiceCreateSpaceAsArgs_Req_DEFAULT *CreateSpaceAsReq +func (p *MetaServiceCreateSpaceAsArgs) GetReq() *CreateSpaceAsReq { + if !p.IsSetReq() { + return MetaServiceCreateSpaceAsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSpaceAsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSpaceAsArgs) 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 *MetaServiceCreateSpaceAsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSpaceAsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpaceAs_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 *MetaServiceCreateSpaceAsArgs) 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 *MetaServiceCreateSpaceAsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSpaceAsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceAsResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSpaceAsResult() *MetaServiceCreateSpaceAsResult { + return &MetaServiceCreateSpaceAsResult{} +} + +var MetaServiceCreateSpaceAsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSpaceAsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSpaceAsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSpaceAsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSpaceAsResult) 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 *MetaServiceCreateSpaceAsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSpaceAs_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 *MetaServiceCreateSpaceAsResult) 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 *MetaServiceCreateSpaceAsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSpaceAsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagArgs struct { + thrift.IRequest + Req *CreateTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagArgs() *MetaServiceCreateTagArgs { + return &MetaServiceCreateTagArgs{ + Req: NewCreateTagReq(), + } +} + +var MetaServiceCreateTagArgs_Req_DEFAULT *CreateTagReq +func (p *MetaServiceCreateTagArgs) GetReq() *CreateTagReq { + if !p.IsSetReq() { + return MetaServiceCreateTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagArgs) 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 *MetaServiceCreateTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagResult() *MetaServiceCreateTagResult { + return &MetaServiceCreateTagResult{} +} + +var MetaServiceCreateTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTag_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 *MetaServiceCreateTagResult) 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 *MetaServiceCreateTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterTagArgs struct { + thrift.IRequest + Req *AlterTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterTagArgs() *MetaServiceAlterTagArgs { + return &MetaServiceAlterTagArgs{ + Req: NewAlterTagReq(), + } +} + +var MetaServiceAlterTagArgs_Req_DEFAULT *AlterTagReq +func (p *MetaServiceAlterTagArgs) GetReq() *AlterTagReq { + if !p.IsSetReq() { + return MetaServiceAlterTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagArgs) 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 *MetaServiceAlterTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterTagResult() *MetaServiceAlterTagResult { + return &MetaServiceAlterTagResult{} +} + +var MetaServiceAlterTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterTag_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 *MetaServiceAlterTagResult) 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 *MetaServiceAlterTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagArgs struct { + thrift.IRequest + Req *DropTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagArgs() *MetaServiceDropTagArgs { + return &MetaServiceDropTagArgs{ + Req: NewDropTagReq(), + } +} + +var MetaServiceDropTagArgs_Req_DEFAULT *DropTagReq +func (p *MetaServiceDropTagArgs) GetReq() *DropTagReq { + if !p.IsSetReq() { + return MetaServiceDropTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagArgs) 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 *MetaServiceDropTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagResult() *MetaServiceDropTagResult { + return &MetaServiceDropTagResult{} +} + +var MetaServiceDropTagResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTag_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 *MetaServiceDropTagResult) 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 *MetaServiceDropTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagArgs struct { + thrift.IRequest + Req *GetTagReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagArgs() *MetaServiceGetTagArgs { + return &MetaServiceGetTagArgs{ + Req: NewGetTagReq(), + } +} + +var MetaServiceGetTagArgs_Req_DEFAULT *GetTagReq +func (p *MetaServiceGetTagArgs) GetReq() *GetTagReq { + if !p.IsSetReq() { + return MetaServiceGetTagArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagArgs) 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 *MetaServiceGetTagArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagResult struct { + thrift.IResponse + Success *GetTagResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagResult() *MetaServiceGetTagResult { + return &MetaServiceGetTagResult{} +} + +var MetaServiceGetTagResult_Success_DEFAULT *GetTagResp +func (p *MetaServiceGetTagResult) GetSuccess() *GetTagResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTag_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 *MetaServiceGetTagResult) 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 *MetaServiceGetTagResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagsArgs struct { + thrift.IRequest + Req *ListTagsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagsArgs() *MetaServiceListTagsArgs { + return &MetaServiceListTagsArgs{ + Req: NewListTagsReq(), + } +} + +var MetaServiceListTagsArgs_Req_DEFAULT *ListTagsReq +func (p *MetaServiceListTagsArgs) GetReq() *ListTagsReq { + if !p.IsSetReq() { + return MetaServiceListTagsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsArgs) 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 *MetaServiceListTagsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagsResult struct { + thrift.IResponse + Success *ListTagsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagsResult() *MetaServiceListTagsResult { + return &MetaServiceListTagsResult{} +} + +var MetaServiceListTagsResult_Success_DEFAULT *ListTagsResp +func (p *MetaServiceListTagsResult) GetSuccess() *ListTagsResp { + if !p.IsSetSuccess() { + return MetaServiceListTagsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTags_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 *MetaServiceListTagsResult) 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 *MetaServiceListTagsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeArgs struct { + thrift.IRequest + Req *CreateEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeArgs() *MetaServiceCreateEdgeArgs { + return &MetaServiceCreateEdgeArgs{ + Req: NewCreateEdgeReq(), + } +} + +var MetaServiceCreateEdgeArgs_Req_DEFAULT *CreateEdgeReq +func (p *MetaServiceCreateEdgeArgs) GetReq() *CreateEdgeReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeArgs) 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 *MetaServiceCreateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeResult() *MetaServiceCreateEdgeResult { + return &MetaServiceCreateEdgeResult{} +} + +var MetaServiceCreateEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdge_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 *MetaServiceCreateEdgeResult) 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 *MetaServiceCreateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterEdgeArgs struct { + thrift.IRequest + Req *AlterEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterEdgeArgs() *MetaServiceAlterEdgeArgs { + return &MetaServiceAlterEdgeArgs{ + Req: NewAlterEdgeReq(), + } +} + +var MetaServiceAlterEdgeArgs_Req_DEFAULT *AlterEdgeReq +func (p *MetaServiceAlterEdgeArgs) GetReq() *AlterEdgeReq { + if !p.IsSetReq() { + return MetaServiceAlterEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeArgs) 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 *MetaServiceAlterEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterEdgeResult() *MetaServiceAlterEdgeResult { + return &MetaServiceAlterEdgeResult{} +} + +var MetaServiceAlterEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterEdge_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 *MetaServiceAlterEdgeResult) 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 *MetaServiceAlterEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeArgs struct { + thrift.IRequest + Req *DropEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeArgs() *MetaServiceDropEdgeArgs { + return &MetaServiceDropEdgeArgs{ + Req: NewDropEdgeReq(), + } +} + +var MetaServiceDropEdgeArgs_Req_DEFAULT *DropEdgeReq +func (p *MetaServiceDropEdgeArgs) GetReq() *DropEdgeReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeArgs) 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 *MetaServiceDropEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeResult() *MetaServiceDropEdgeResult { + return &MetaServiceDropEdgeResult{} +} + +var MetaServiceDropEdgeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdge_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 *MetaServiceDropEdgeResult) 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 *MetaServiceDropEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeArgs struct { + thrift.IRequest + Req *GetEdgeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeArgs() *MetaServiceGetEdgeArgs { + return &MetaServiceGetEdgeArgs{ + Req: NewGetEdgeReq(), + } +} + +var MetaServiceGetEdgeArgs_Req_DEFAULT *GetEdgeReq +func (p *MetaServiceGetEdgeArgs) GetReq() *GetEdgeReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeArgs) 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 *MetaServiceGetEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeResult struct { + thrift.IResponse + Success *GetEdgeResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeResult() *MetaServiceGetEdgeResult { + return &MetaServiceGetEdgeResult{} +} + +var MetaServiceGetEdgeResult_Success_DEFAULT *GetEdgeResp +func (p *MetaServiceGetEdgeResult) GetSuccess() *GetEdgeResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdge_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 *MetaServiceGetEdgeResult) 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 *MetaServiceGetEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgesArgs struct { + thrift.IRequest + Req *ListEdgesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgesArgs() *MetaServiceListEdgesArgs { + return &MetaServiceListEdgesArgs{ + Req: NewListEdgesReq(), + } +} + +var MetaServiceListEdgesArgs_Req_DEFAULT *ListEdgesReq +func (p *MetaServiceListEdgesArgs) GetReq() *ListEdgesReq { + if !p.IsSetReq() { + return MetaServiceListEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesArgs) 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 *MetaServiceListEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgesResult struct { + thrift.IResponse + Success *ListEdgesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgesResult() *MetaServiceListEdgesResult { + return &MetaServiceListEdgesResult{} +} + +var MetaServiceListEdgesResult_Success_DEFAULT *ListEdgesResp +func (p *MetaServiceListEdgesResult) GetSuccess() *ListEdgesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdges_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 *MetaServiceListEdgesResult) 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 *MetaServiceListEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListHostsArgs struct { + thrift.IRequest + Req *ListHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListHostsArgs() *MetaServiceListHostsArgs { + return &MetaServiceListHostsArgs{ + Req: NewListHostsReq(), + } +} + +var MetaServiceListHostsArgs_Req_DEFAULT *ListHostsReq +func (p *MetaServiceListHostsArgs) GetReq() *ListHostsReq { + if !p.IsSetReq() { + return MetaServiceListHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListHostsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListHostsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsArgs) 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 *MetaServiceListHostsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListHostsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListHostsResult struct { + thrift.IResponse + Success *ListHostsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListHostsResult() *MetaServiceListHostsResult { + return &MetaServiceListHostsResult{} +} + +var MetaServiceListHostsResult_Success_DEFAULT *ListHostsResp +func (p *MetaServiceListHostsResult) GetSuccess() *ListHostsResp { + if !p.IsSetSuccess() { + return MetaServiceListHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListHostsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListHostsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listHosts_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 *MetaServiceListHostsResult) 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 *MetaServiceListHostsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListHostsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetPartsAllocArgs struct { + thrift.IRequest + Req *GetPartsAllocReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetPartsAllocArgs() *MetaServiceGetPartsAllocArgs { + return &MetaServiceGetPartsAllocArgs{ + Req: NewGetPartsAllocReq(), + } +} + +var MetaServiceGetPartsAllocArgs_Req_DEFAULT *GetPartsAllocReq +func (p *MetaServiceGetPartsAllocArgs) GetReq() *GetPartsAllocReq { + if !p.IsSetReq() { + return MetaServiceGetPartsAllocArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetPartsAllocArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPartsAllocReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocArgs) 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 *MetaServiceGetPartsAllocArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetPartsAllocArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetPartsAllocResult struct { + thrift.IResponse + Success *GetPartsAllocResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetPartsAllocResult() *MetaServiceGetPartsAllocResult { + return &MetaServiceGetPartsAllocResult{} +} + +var MetaServiceGetPartsAllocResult_Success_DEFAULT *GetPartsAllocResp +func (p *MetaServiceGetPartsAllocResult) GetSuccess() *GetPartsAllocResp { + if !p.IsSetSuccess() { + return MetaServiceGetPartsAllocResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetPartsAllocResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPartsAllocResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getPartsAlloc_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 *MetaServiceGetPartsAllocResult) 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 *MetaServiceGetPartsAllocResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetPartsAllocResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListPartsArgs struct { + thrift.IRequest + Req *ListPartsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListPartsArgs() *MetaServiceListPartsArgs { + return &MetaServiceListPartsArgs{ + Req: NewListPartsReq(), + } +} + +var MetaServiceListPartsArgs_Req_DEFAULT *ListPartsReq +func (p *MetaServiceListPartsArgs) GetReq() *ListPartsReq { + if !p.IsSetReq() { + return MetaServiceListPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListPartsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsArgs) 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 *MetaServiceListPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListPartsResult struct { + thrift.IResponse + Success *ListPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListPartsResult() *MetaServiceListPartsResult { + return &MetaServiceListPartsResult{} +} + +var MetaServiceListPartsResult_Success_DEFAULT *ListPartsResp +func (p *MetaServiceListPartsResult) GetSuccess() *ListPartsResp { + if !p.IsSetSuccess() { + return MetaServiceListPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listParts_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 *MetaServiceListPartsResult) 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 *MetaServiceListPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiPutArgs struct { + thrift.IRequest + Req *MultiPutReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiPutArgs() *MetaServiceMultiPutArgs { + return &MetaServiceMultiPutArgs{ + Req: NewMultiPutReq(), + } +} + +var MetaServiceMultiPutArgs_Req_DEFAULT *MultiPutReq +func (p *MetaServiceMultiPutArgs) GetReq() *MultiPutReq { + if !p.IsSetReq() { + return MetaServiceMultiPutArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiPutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiPutReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiPutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutArgs) 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 *MetaServiceMultiPutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiPutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiPutResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiPutResult() *MetaServiceMultiPutResult { + return &MetaServiceMultiPutResult{} +} + +var MetaServiceMultiPutResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMultiPutResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceMultiPutResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiPutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiPutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiPut_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 *MetaServiceMultiPutResult) 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 *MetaServiceMultiPutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiPutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetArgs struct { + thrift.IRequest + Req *GetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetArgs() *MetaServiceGetArgs { + return &MetaServiceGetArgs{ + Req: NewGetReq(), + } +} + +var MetaServiceGetArgs_Req_DEFAULT *GetReq +func (p *MetaServiceGetArgs) GetReq() *GetReq { + if !p.IsSetReq() { + return MetaServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetArgs) 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 *MetaServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetResult struct { + thrift.IResponse + Success *GetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetResult() *MetaServiceGetResult { + return &MetaServiceGetResult{} +} + +var MetaServiceGetResult_Success_DEFAULT *GetResp +func (p *MetaServiceGetResult) GetSuccess() *GetResp { + if !p.IsSetSuccess() { + return MetaServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetResult) 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 *MetaServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceMultiGetArgs struct { + thrift.IRequest + Req *MultiGetReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMultiGetArgs() *MetaServiceMultiGetArgs { + return &MetaServiceMultiGetArgs{ + Req: NewMultiGetReq(), + } +} + +var MetaServiceMultiGetArgs_Req_DEFAULT *MultiGetReq +func (p *MetaServiceMultiGetArgs) GetReq() *MultiGetReq { + if !p.IsSetReq() { + return MetaServiceMultiGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMultiGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMultiGetReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMultiGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetArgs) 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 *MetaServiceMultiGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceMultiGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceMultiGetResult struct { + thrift.IResponse + Success *MultiGetResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMultiGetResult() *MetaServiceMultiGetResult { + return &MetaServiceMultiGetResult{} +} + +var MetaServiceMultiGetResult_Success_DEFAULT *MultiGetResp +func (p *MetaServiceMultiGetResult) GetSuccess() *MultiGetResp { + if !p.IsSetSuccess() { + return MetaServiceMultiGetResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMultiGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewMultiGetResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMultiGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("multiGet_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 *MetaServiceMultiGetResult) 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 *MetaServiceMultiGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceMultiGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveArgs struct { + thrift.IRequest + Req *RemoveReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveArgs() *MetaServiceRemoveArgs { + return &MetaServiceRemoveArgs{ + Req: NewRemoveReq(), + } +} + +var MetaServiceRemoveArgs_Req_DEFAULT *RemoveReq +func (p *MetaServiceRemoveArgs) GetReq() *RemoveReq { + if !p.IsSetReq() { + return MetaServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveArgs) 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 *MetaServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveResult() *MetaServiceRemoveResult { + return &MetaServiceRemoveResult{} +} + +var MetaServiceRemoveResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveResult) 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 *MetaServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveRangeArgs struct { + thrift.IRequest + Req *RemoveRangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveRangeArgs() *MetaServiceRemoveRangeArgs { + return &MetaServiceRemoveRangeArgs{ + Req: NewRemoveRangeReq(), + } +} + +var MetaServiceRemoveRangeArgs_Req_DEFAULT *RemoveRangeReq +func (p *MetaServiceRemoveRangeArgs) GetReq() *RemoveRangeReq { + if !p.IsSetReq() { + return MetaServiceRemoveRangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveRangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveRangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeArgs) 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 *MetaServiceRemoveRangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveRangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveRangeResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveRangeResult() *MetaServiceRemoveRangeResult { + return &MetaServiceRemoveRangeResult{} +} + +var MetaServiceRemoveRangeResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveRangeResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveRangeResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveRangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveRangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeRange_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 *MetaServiceRemoveRangeResult) 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 *MetaServiceRemoveRangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveRangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceScanArgs struct { + thrift.IRequest + Req *ScanReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceScanArgs() *MetaServiceScanArgs { + return &MetaServiceScanArgs{ + Req: NewScanReq(), + } +} + +var MetaServiceScanArgs_Req_DEFAULT *ScanReq +func (p *MetaServiceScanArgs) GetReq() *ScanReq { + if !p.IsSetReq() { + return MetaServiceScanArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceScanArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceScanArgs) 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 *MetaServiceScanArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceScanArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanArgs) 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 *MetaServiceScanArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceScanArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceScanResult struct { + thrift.IResponse + Success *ScanResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceScanResult() *MetaServiceScanResult { + return &MetaServiceScanResult{} +} + +var MetaServiceScanResult_Success_DEFAULT *ScanResp +func (p *MetaServiceScanResult) GetSuccess() *ScanResp { + if !p.IsSetSuccess() { + return MetaServiceScanResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceScanResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceScanResult) 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 *MetaServiceScanResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceScanResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scan_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 *MetaServiceScanResult) 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 *MetaServiceScanResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceScanResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateTagIndexArgs struct { + thrift.IRequest + Req *CreateTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateTagIndexArgs() *MetaServiceCreateTagIndexArgs { + return &MetaServiceCreateTagIndexArgs{ + Req: NewCreateTagIndexReq(), + } +} + +var MetaServiceCreateTagIndexArgs_Req_DEFAULT *CreateTagIndexReq +func (p *MetaServiceCreateTagIndexArgs) GetReq() *CreateTagIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexArgs) 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 *MetaServiceCreateTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateTagIndexResult() *MetaServiceCreateTagIndexResult { + return &MetaServiceCreateTagIndexResult{} +} + +var MetaServiceCreateTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createTagIndex_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 *MetaServiceCreateTagIndexResult) 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 *MetaServiceCreateTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropTagIndexArgs struct { + thrift.IRequest + Req *DropTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropTagIndexArgs() *MetaServiceDropTagIndexArgs { + return &MetaServiceDropTagIndexArgs{ + Req: NewDropTagIndexReq(), + } +} + +var MetaServiceDropTagIndexArgs_Req_DEFAULT *DropTagIndexReq +func (p *MetaServiceDropTagIndexArgs) GetReq() *DropTagIndexReq { + if !p.IsSetReq() { + return MetaServiceDropTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexArgs) 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 *MetaServiceDropTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropTagIndexResult() *MetaServiceDropTagIndexResult { + return &MetaServiceDropTagIndexResult{} +} + +var MetaServiceDropTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropTagIndex_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 *MetaServiceDropTagIndexResult) 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 *MetaServiceDropTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetTagIndexArgs struct { + thrift.IRequest + Req *GetTagIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetTagIndexArgs() *MetaServiceGetTagIndexArgs { + return &MetaServiceGetTagIndexArgs{ + Req: NewGetTagIndexReq(), + } +} + +var MetaServiceGetTagIndexArgs_Req_DEFAULT *GetTagIndexReq +func (p *MetaServiceGetTagIndexArgs) GetReq() *GetTagIndexReq { + if !p.IsSetReq() { + return MetaServiceGetTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetTagIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexArgs) 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 *MetaServiceGetTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetTagIndexResult struct { + thrift.IResponse + Success *GetTagIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetTagIndexResult() *MetaServiceGetTagIndexResult { + return &MetaServiceGetTagIndexResult{} +} + +var MetaServiceGetTagIndexResult_Success_DEFAULT *GetTagIndexResp +func (p *MetaServiceGetTagIndexResult) GetSuccess() *GetTagIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetTagIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getTagIndex_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 *MetaServiceGetTagIndexResult) 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 *MetaServiceGetTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexesArgs struct { + thrift.IRequest + Req *ListTagIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexesArgs() *MetaServiceListTagIndexesArgs { + return &MetaServiceListTagIndexesArgs{ + Req: NewListTagIndexesReq(), + } +} + +var MetaServiceListTagIndexesArgs_Req_DEFAULT *ListTagIndexesReq +func (p *MetaServiceListTagIndexesArgs) GetReq() *ListTagIndexesReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListTagIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesArgs) 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 *MetaServiceListTagIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexesResult struct { + thrift.IResponse + Success *ListTagIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexesResult() *MetaServiceListTagIndexesResult { + return &MetaServiceListTagIndexesResult{} +} + +var MetaServiceListTagIndexesResult_Success_DEFAULT *ListTagIndexesResp +func (p *MetaServiceListTagIndexesResult) GetSuccess() *ListTagIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListTagIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexes_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 *MetaServiceListTagIndexesResult) 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 *MetaServiceListTagIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildTagIndexArgs() *MetaServiceRebuildTagIndexArgs { + return &MetaServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildTagIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexArgs) 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 *MetaServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildTagIndexResult() *MetaServiceRebuildTagIndexResult { + return &MetaServiceRebuildTagIndexResult{} +} + +var MetaServiceRebuildTagIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildTagIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *MetaServiceRebuildTagIndexResult) 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 *MetaServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListTagIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListTagIndexStatusArgs() *MetaServiceListTagIndexStatusArgs { + return &MetaServiceListTagIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListTagIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListTagIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListTagIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListTagIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusArgs) 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 *MetaServiceListTagIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListTagIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListTagIndexStatusResult() *MetaServiceListTagIndexStatusResult { + return &MetaServiceListTagIndexStatusResult{} +} + +var MetaServiceListTagIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListTagIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListTagIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListTagIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listTagIndexStatus_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 *MetaServiceListTagIndexStatusResult) 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 *MetaServiceListTagIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListTagIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateEdgeIndexArgs struct { + thrift.IRequest + Req *CreateEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateEdgeIndexArgs() *MetaServiceCreateEdgeIndexArgs { + return &MetaServiceCreateEdgeIndexArgs{ + Req: NewCreateEdgeIndexReq(), + } +} + +var MetaServiceCreateEdgeIndexArgs_Req_DEFAULT *CreateEdgeIndexReq +func (p *MetaServiceCreateEdgeIndexArgs) GetReq() *CreateEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexArgs) 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 *MetaServiceCreateEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateEdgeIndexResult() *MetaServiceCreateEdgeIndexResult { + return &MetaServiceCreateEdgeIndexResult{} +} + +var MetaServiceCreateEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createEdgeIndex_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 *MetaServiceCreateEdgeIndexResult) 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 *MetaServiceCreateEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropEdgeIndexArgs struct { + thrift.IRequest + Req *DropEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropEdgeIndexArgs() *MetaServiceDropEdgeIndexArgs { + return &MetaServiceDropEdgeIndexArgs{ + Req: NewDropEdgeIndexReq(), + } +} + +var MetaServiceDropEdgeIndexArgs_Req_DEFAULT *DropEdgeIndexReq +func (p *MetaServiceDropEdgeIndexArgs) GetReq() *DropEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceDropEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexArgs) 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 *MetaServiceDropEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropEdgeIndexResult() *MetaServiceDropEdgeIndexResult { + return &MetaServiceDropEdgeIndexResult{} +} + +var MetaServiceDropEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropEdgeIndex_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 *MetaServiceDropEdgeIndexResult) 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 *MetaServiceDropEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetEdgeIndexArgs struct { + thrift.IRequest + Req *GetEdgeIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetEdgeIndexArgs() *MetaServiceGetEdgeIndexArgs { + return &MetaServiceGetEdgeIndexArgs{ + Req: NewGetEdgeIndexReq(), + } +} + +var MetaServiceGetEdgeIndexArgs_Req_DEFAULT *GetEdgeIndexReq +func (p *MetaServiceGetEdgeIndexArgs) GetReq() *GetEdgeIndexReq { + if !p.IsSetReq() { + return MetaServiceGetEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetEdgeIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexArgs) 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 *MetaServiceGetEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetEdgeIndexResult struct { + thrift.IResponse + Success *GetEdgeIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetEdgeIndexResult() *MetaServiceGetEdgeIndexResult { + return &MetaServiceGetEdgeIndexResult{} +} + +var MetaServiceGetEdgeIndexResult_Success_DEFAULT *GetEdgeIndexResp +func (p *MetaServiceGetEdgeIndexResult) GetSuccess() *GetEdgeIndexResp { + if !p.IsSetSuccess() { + return MetaServiceGetEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetEdgeIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getEdgeIndex_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 *MetaServiceGetEdgeIndexResult) 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 *MetaServiceGetEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexesArgs struct { + thrift.IRequest + Req *ListEdgeIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexesArgs() *MetaServiceListEdgeIndexesArgs { + return &MetaServiceListEdgeIndexesArgs{ + Req: NewListEdgeIndexesReq(), + } +} + +var MetaServiceListEdgeIndexesArgs_Req_DEFAULT *ListEdgeIndexesReq +func (p *MetaServiceListEdgeIndexesArgs) GetReq() *ListEdgeIndexesReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListEdgeIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesArgs) 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 *MetaServiceListEdgeIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexesResult struct { + thrift.IResponse + Success *ListEdgeIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexesResult() *MetaServiceListEdgeIndexesResult { + return &MetaServiceListEdgeIndexesResult{} +} + +var MetaServiceListEdgeIndexesResult_Success_DEFAULT *ListEdgeIndexesResp +func (p *MetaServiceListEdgeIndexesResult) GetSuccess() *ListEdgeIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListEdgeIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexes_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 *MetaServiceListEdgeIndexesResult) 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 *MetaServiceListEdgeIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRebuildEdgeIndexArgs() *MetaServiceRebuildEdgeIndexArgs { + return &MetaServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexReq(), + } +} + +var MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexReq +func (p *MetaServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexReq { + if !p.IsSetReq() { + return MetaServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexArgs) 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 *MetaServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRebuildEdgeIndexResult() *MetaServiceRebuildEdgeIndexResult { + return &MetaServiceRebuildEdgeIndexResult{} +} + +var MetaServiceRebuildEdgeIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRebuildEdgeIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *MetaServiceRebuildEdgeIndexResult) 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 *MetaServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListEdgeIndexStatusArgs struct { + thrift.IRequest + Req *ListIndexStatusReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListEdgeIndexStatusArgs() *MetaServiceListEdgeIndexStatusArgs { + return &MetaServiceListEdgeIndexStatusArgs{ + Req: NewListIndexStatusReq(), + } +} + +var MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT *ListIndexStatusReq +func (p *MetaServiceListEdgeIndexStatusArgs) GetReq() *ListIndexStatusReq { + if !p.IsSetReq() { + return MetaServiceListEdgeIndexStatusArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListEdgeIndexStatusArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListIndexStatusReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusArgs) 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 *MetaServiceListEdgeIndexStatusArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListEdgeIndexStatusResult struct { + thrift.IResponse + Success *ListIndexStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListEdgeIndexStatusResult() *MetaServiceListEdgeIndexStatusResult { + return &MetaServiceListEdgeIndexStatusResult{} +} + +var MetaServiceListEdgeIndexStatusResult_Success_DEFAULT *ListIndexStatusResp +func (p *MetaServiceListEdgeIndexStatusResult) GetSuccess() *ListIndexStatusResp { + if !p.IsSetSuccess() { + return MetaServiceListEdgeIndexStatusResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListEdgeIndexStatusResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListIndexStatusResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listEdgeIndexStatus_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 *MetaServiceListEdgeIndexStatusResult) 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 *MetaServiceListEdgeIndexStatusResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListEdgeIndexStatusResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateUserArgs struct { + thrift.IRequest + Req *CreateUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateUserArgs() *MetaServiceCreateUserArgs { + return &MetaServiceCreateUserArgs{ + Req: NewCreateUserReq(), + } +} + +var MetaServiceCreateUserArgs_Req_DEFAULT *CreateUserReq +func (p *MetaServiceCreateUserArgs) GetReq() *CreateUserReq { + if !p.IsSetReq() { + return MetaServiceCreateUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserArgs) 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 *MetaServiceCreateUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateUserResult() *MetaServiceCreateUserResult { + return &MetaServiceCreateUserResult{} +} + +var MetaServiceCreateUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createUser_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 *MetaServiceCreateUserResult) 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 *MetaServiceCreateUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropUserArgs struct { + thrift.IRequest + Req *DropUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropUserArgs() *MetaServiceDropUserArgs { + return &MetaServiceDropUserArgs{ + Req: NewDropUserReq(), + } +} + +var MetaServiceDropUserArgs_Req_DEFAULT *DropUserReq +func (p *MetaServiceDropUserArgs) GetReq() *DropUserReq { + if !p.IsSetReq() { + return MetaServiceDropUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserArgs) 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 *MetaServiceDropUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropUserResult() *MetaServiceDropUserResult { + return &MetaServiceDropUserResult{} +} + +var MetaServiceDropUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropUser_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 *MetaServiceDropUserResult) 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 *MetaServiceDropUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAlterUserArgs struct { + thrift.IRequest + Req *AlterUserReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterUserArgs() *MetaServiceAlterUserArgs { + return &MetaServiceAlterUserArgs{ + Req: NewAlterUserReq(), + } +} + +var MetaServiceAlterUserArgs_Req_DEFAULT *AlterUserReq +func (p *MetaServiceAlterUserArgs) GetReq() *AlterUserReq { + if !p.IsSetReq() { + return MetaServiceAlterUserArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterUserArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAlterUserReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserArgs) 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 *MetaServiceAlterUserArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAlterUserArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAlterUserResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterUserResult() *MetaServiceAlterUserResult { + return &MetaServiceAlterUserResult{} +} + +var MetaServiceAlterUserResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterUserResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterUserResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterUserResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("alterUser_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 *MetaServiceAlterUserResult) 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 *MetaServiceAlterUserResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAlterUserResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGrantRoleArgs struct { + thrift.IRequest + Req *GrantRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGrantRoleArgs() *MetaServiceGrantRoleArgs { + return &MetaServiceGrantRoleArgs{ + Req: NewGrantRoleReq(), + } +} + +var MetaServiceGrantRoleArgs_Req_DEFAULT *GrantRoleReq +func (p *MetaServiceGrantRoleArgs) GetReq() *GrantRoleReq { + if !p.IsSetReq() { + return MetaServiceGrantRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGrantRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGrantRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleArgs) 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 *MetaServiceGrantRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGrantRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGrantRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGrantRoleResult() *MetaServiceGrantRoleResult { + return &MetaServiceGrantRoleResult{} +} + +var MetaServiceGrantRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceGrantRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceGrantRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGrantRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("grantRole_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 *MetaServiceGrantRoleResult) 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 *MetaServiceGrantRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGrantRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRevokeRoleArgs struct { + thrift.IRequest + Req *RevokeRoleReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRevokeRoleArgs() *MetaServiceRevokeRoleArgs { + return &MetaServiceRevokeRoleArgs{ + Req: NewRevokeRoleReq(), + } +} + +var MetaServiceRevokeRoleArgs_Req_DEFAULT *RevokeRoleReq +func (p *MetaServiceRevokeRoleArgs) GetReq() *RevokeRoleReq { + if !p.IsSetReq() { + return MetaServiceRevokeRoleArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRevokeRoleArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRevokeRoleReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleArgs) 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 *MetaServiceRevokeRoleArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRevokeRoleArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRevokeRoleResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRevokeRoleResult() *MetaServiceRevokeRoleResult { + return &MetaServiceRevokeRoleResult{} +} + +var MetaServiceRevokeRoleResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRevokeRoleResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRevokeRoleResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRevokeRoleResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("revokeRole_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 *MetaServiceRevokeRoleResult) 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 *MetaServiceRevokeRoleResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRevokeRoleResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListUsersArgs struct { + thrift.IRequest + Req *ListUsersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListUsersArgs() *MetaServiceListUsersArgs { + return &MetaServiceListUsersArgs{ + Req: NewListUsersReq(), + } +} + +var MetaServiceListUsersArgs_Req_DEFAULT *ListUsersReq +func (p *MetaServiceListUsersArgs) GetReq() *ListUsersReq { + if !p.IsSetReq() { + return MetaServiceListUsersArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListUsersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListUsersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersArgs) 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 *MetaServiceListUsersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListUsersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListUsersResult struct { + thrift.IResponse + Success *ListUsersResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListUsersResult() *MetaServiceListUsersResult { + return &MetaServiceListUsersResult{} +} + +var MetaServiceListUsersResult_Success_DEFAULT *ListUsersResp +func (p *MetaServiceListUsersResult) GetSuccess() *ListUsersResp { + if !p.IsSetSuccess() { + return MetaServiceListUsersResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListUsersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListUsersResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listUsers_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 *MetaServiceListUsersResult) 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 *MetaServiceListUsersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListUsersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListRolesArgs struct { + thrift.IRequest + Req *ListRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListRolesArgs() *MetaServiceListRolesArgs { + return &MetaServiceListRolesArgs{ + Req: NewListRolesReq(), + } +} + +var MetaServiceListRolesArgs_Req_DEFAULT *ListRolesReq +func (p *MetaServiceListRolesArgs) GetReq() *ListRolesReq { + if !p.IsSetReq() { + return MetaServiceListRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesArgs) 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 *MetaServiceListRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListRolesResult() *MetaServiceListRolesResult { + return &MetaServiceListRolesResult{} +} + +var MetaServiceListRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceListRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceListRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listRoles_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 *MetaServiceListRolesResult) 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 *MetaServiceListRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetUserRolesArgs struct { + thrift.IRequest + Req *GetUserRolesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetUserRolesArgs() *MetaServiceGetUserRolesArgs { + return &MetaServiceGetUserRolesArgs{ + Req: NewGetUserRolesReq(), + } +} + +var MetaServiceGetUserRolesArgs_Req_DEFAULT *GetUserRolesReq +func (p *MetaServiceGetUserRolesArgs) GetReq() *GetUserRolesReq { + if !p.IsSetReq() { + return MetaServiceGetUserRolesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetUserRolesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUserRolesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesArgs) 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 *MetaServiceGetUserRolesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetUserRolesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetUserRolesResult struct { + thrift.IResponse + Success *ListRolesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetUserRolesResult() *MetaServiceGetUserRolesResult { + return &MetaServiceGetUserRolesResult{} +} + +var MetaServiceGetUserRolesResult_Success_DEFAULT *ListRolesResp +func (p *MetaServiceGetUserRolesResult) GetSuccess() *ListRolesResp { + if !p.IsSetSuccess() { + return MetaServiceGetUserRolesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetUserRolesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListRolesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUserRoles_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 *MetaServiceGetUserRolesResult) 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 *MetaServiceGetUserRolesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetUserRolesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceChangePasswordArgs struct { + thrift.IRequest + Req *ChangePasswordReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceChangePasswordArgs() *MetaServiceChangePasswordArgs { + return &MetaServiceChangePasswordArgs{ + Req: NewChangePasswordReq(), + } +} + +var MetaServiceChangePasswordArgs_Req_DEFAULT *ChangePasswordReq +func (p *MetaServiceChangePasswordArgs) GetReq() *ChangePasswordReq { + if !p.IsSetReq() { + return MetaServiceChangePasswordArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceChangePasswordArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewChangePasswordReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordArgs) 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 *MetaServiceChangePasswordArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceChangePasswordArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceChangePasswordResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceChangePasswordResult() *MetaServiceChangePasswordResult { + return &MetaServiceChangePasswordResult{} +} + +var MetaServiceChangePasswordResult_Success_DEFAULT *ExecResp +func (p *MetaServiceChangePasswordResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceChangePasswordResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceChangePasswordResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("changePassword_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 *MetaServiceChangePasswordResult) 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 *MetaServiceChangePasswordResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceChangePasswordResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceHeartBeatArgs struct { + thrift.IRequest + Req *HBReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceHeartBeatArgs() *MetaServiceHeartBeatArgs { + return &MetaServiceHeartBeatArgs{ + Req: NewHBReq(), + } +} + +var MetaServiceHeartBeatArgs_Req_DEFAULT *HBReq +func (p *MetaServiceHeartBeatArgs) GetReq() *HBReq { + if !p.IsSetReq() { + return MetaServiceHeartBeatArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceHeartBeatArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewHBReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatArgs) 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 *MetaServiceHeartBeatArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceHeartBeatArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceHeartBeatResult struct { + thrift.IResponse + Success *HBResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceHeartBeatResult() *MetaServiceHeartBeatResult { + return &MetaServiceHeartBeatResult{} +} + +var MetaServiceHeartBeatResult_Success_DEFAULT *HBResp +func (p *MetaServiceHeartBeatResult) GetSuccess() *HBResp { + if !p.IsSetSuccess() { + return MetaServiceHeartBeatResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceHeartBeatResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewHBResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("heartBeat_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 *MetaServiceHeartBeatResult) 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 *MetaServiceHeartBeatResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceHeartBeatResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceBalanceArgs struct { + thrift.IRequest + Req *BalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceBalanceArgs() *MetaServiceBalanceArgs { + return &MetaServiceBalanceArgs{ + Req: NewBalanceReq(), + } +} + +var MetaServiceBalanceArgs_Req_DEFAULT *BalanceReq +func (p *MetaServiceBalanceArgs) GetReq() *BalanceReq { + if !p.IsSetReq() { + return MetaServiceBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceArgs) 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 *MetaServiceBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceBalanceResult struct { + thrift.IResponse + Success *BalanceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceBalanceResult() *MetaServiceBalanceResult { + return &MetaServiceBalanceResult{} +} + +var MetaServiceBalanceResult_Success_DEFAULT *BalanceResp +func (p *MetaServiceBalanceResult) GetSuccess() *BalanceResp { + if !p.IsSetSuccess() { + return MetaServiceBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewBalanceResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("balance_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 *MetaServiceBalanceResult) 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 *MetaServiceBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceLeaderBalanceArgs struct { + thrift.IRequest + Req *LeaderBalanceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceLeaderBalanceArgs() *MetaServiceLeaderBalanceArgs { + return &MetaServiceLeaderBalanceArgs{ + Req: NewLeaderBalanceReq(), + } +} + +var MetaServiceLeaderBalanceArgs_Req_DEFAULT *LeaderBalanceReq +func (p *MetaServiceLeaderBalanceArgs) GetReq() *LeaderBalanceReq { + if !p.IsSetReq() { + return MetaServiceLeaderBalanceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceLeaderBalanceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLeaderBalanceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceArgs) 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 *MetaServiceLeaderBalanceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceLeaderBalanceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceLeaderBalanceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceLeaderBalanceResult() *MetaServiceLeaderBalanceResult { + return &MetaServiceLeaderBalanceResult{} +} + +var MetaServiceLeaderBalanceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceLeaderBalanceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceLeaderBalanceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceLeaderBalanceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceLeaderBalanceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("leaderBalance_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 *MetaServiceLeaderBalanceResult) 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 *MetaServiceLeaderBalanceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceLeaderBalanceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRegConfigArgs struct { + thrift.IRequest + Req *RegConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRegConfigArgs() *MetaServiceRegConfigArgs { + return &MetaServiceRegConfigArgs{ + Req: NewRegConfigReq(), + } +} + +var MetaServiceRegConfigArgs_Req_DEFAULT *RegConfigReq +func (p *MetaServiceRegConfigArgs) GetReq() *RegConfigReq { + if !p.IsSetReq() { + return MetaServiceRegConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRegConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRegConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigArgs) 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 *MetaServiceRegConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRegConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRegConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRegConfigResult() *MetaServiceRegConfigResult { + return &MetaServiceRegConfigResult{} +} + +var MetaServiceRegConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRegConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRegConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRegConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("regConfig_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 *MetaServiceRegConfigResult) 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 *MetaServiceRegConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRegConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetConfigArgs struct { + thrift.IRequest + Req *GetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetConfigArgs() *MetaServiceGetConfigArgs { + return &MetaServiceGetConfigArgs{ + Req: NewGetConfigReq(), + } +} + +var MetaServiceGetConfigArgs_Req_DEFAULT *GetConfigReq +func (p *MetaServiceGetConfigArgs) GetReq() *GetConfigReq { + if !p.IsSetReq() { + return MetaServiceGetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigArgs) 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 *MetaServiceGetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetConfigResult struct { + thrift.IResponse + Success *GetConfigResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetConfigResult() *MetaServiceGetConfigResult { + return &MetaServiceGetConfigResult{} +} + +var MetaServiceGetConfigResult_Success_DEFAULT *GetConfigResp +func (p *MetaServiceGetConfigResult) GetSuccess() *GetConfigResp { + if !p.IsSetSuccess() { + return MetaServiceGetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetConfigResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getConfig_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 *MetaServiceGetConfigResult) 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 *MetaServiceGetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSetConfigArgs struct { + thrift.IRequest + Req *SetConfigReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSetConfigArgs() *MetaServiceSetConfigArgs { + return &MetaServiceSetConfigArgs{ + Req: NewSetConfigReq(), + } +} + +var MetaServiceSetConfigArgs_Req_DEFAULT *SetConfigReq +func (p *MetaServiceSetConfigArgs) GetReq() *SetConfigReq { + if !p.IsSetReq() { + return MetaServiceSetConfigArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSetConfigArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSetConfigReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigArgs) 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 *MetaServiceSetConfigArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSetConfigArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSetConfigResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSetConfigResult() *MetaServiceSetConfigResult { + return &MetaServiceSetConfigResult{} +} + +var MetaServiceSetConfigResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSetConfigResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSetConfigResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSetConfigResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("setConfig_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 *MetaServiceSetConfigResult) 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 *MetaServiceSetConfigResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSetConfigResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListConfigsArgs struct { + thrift.IRequest + Req *ListConfigsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListConfigsArgs() *MetaServiceListConfigsArgs { + return &MetaServiceListConfigsArgs{ + Req: NewListConfigsReq(), + } +} + +var MetaServiceListConfigsArgs_Req_DEFAULT *ListConfigsReq +func (p *MetaServiceListConfigsArgs) GetReq() *ListConfigsReq { + if !p.IsSetReq() { + return MetaServiceListConfigsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListConfigsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListConfigsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsArgs) 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 *MetaServiceListConfigsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListConfigsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListConfigsResult struct { + thrift.IResponse + Success *ListConfigsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListConfigsResult() *MetaServiceListConfigsResult { + return &MetaServiceListConfigsResult{} +} + +var MetaServiceListConfigsResult_Success_DEFAULT *ListConfigsResp +func (p *MetaServiceListConfigsResult) GetSuccess() *ListConfigsResp { + if !p.IsSetSuccess() { + return MetaServiceListConfigsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListConfigsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListConfigsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listConfigs_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 *MetaServiceListConfigsResult) 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 *MetaServiceListConfigsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListConfigsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSnapshotArgs struct { + thrift.IRequest + Req *CreateSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSnapshotArgs() *MetaServiceCreateSnapshotArgs { + return &MetaServiceCreateSnapshotArgs{ + Req: NewCreateSnapshotReq(), + } +} + +var MetaServiceCreateSnapshotArgs_Req_DEFAULT *CreateSnapshotReq +func (p *MetaServiceCreateSnapshotArgs) GetReq() *CreateSnapshotReq { + if !p.IsSetReq() { + return MetaServiceCreateSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotArgs) 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 *MetaServiceCreateSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSnapshotResult() *MetaServiceCreateSnapshotResult { + return &MetaServiceCreateSnapshotResult{} +} + +var MetaServiceCreateSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSnapshot_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 *MetaServiceCreateSnapshotResult) 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 *MetaServiceCreateSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropSnapshotArgs struct { + thrift.IRequest + Req *DropSnapshotReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropSnapshotArgs() *MetaServiceDropSnapshotArgs { + return &MetaServiceDropSnapshotArgs{ + Req: NewDropSnapshotReq(), + } +} + +var MetaServiceDropSnapshotArgs_Req_DEFAULT *DropSnapshotReq +func (p *MetaServiceDropSnapshotArgs) GetReq() *DropSnapshotReq { + if !p.IsSetReq() { + return MetaServiceDropSnapshotArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropSnapshotArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropSnapshotReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotArgs) 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 *MetaServiceDropSnapshotArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropSnapshotArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropSnapshotResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropSnapshotResult() *MetaServiceDropSnapshotResult { + return &MetaServiceDropSnapshotResult{} +} + +var MetaServiceDropSnapshotResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropSnapshotResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropSnapshotResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropSnapshotResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropSnapshot_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 *MetaServiceDropSnapshotResult) 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 *MetaServiceDropSnapshotResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropSnapshotResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSnapshotsArgs struct { + thrift.IRequest + Req *ListSnapshotsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSnapshotsArgs() *MetaServiceListSnapshotsArgs { + return &MetaServiceListSnapshotsArgs{ + Req: NewListSnapshotsReq(), + } +} + +var MetaServiceListSnapshotsArgs_Req_DEFAULT *ListSnapshotsReq +func (p *MetaServiceListSnapshotsArgs) GetReq() *ListSnapshotsReq { + if !p.IsSetReq() { + return MetaServiceListSnapshotsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSnapshotsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSnapshotsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsArgs) 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 *MetaServiceListSnapshotsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSnapshotsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSnapshotsResult struct { + thrift.IResponse + Success *ListSnapshotsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSnapshotsResult() *MetaServiceListSnapshotsResult { + return &MetaServiceListSnapshotsResult{} +} + +var MetaServiceListSnapshotsResult_Success_DEFAULT *ListSnapshotsResp +func (p *MetaServiceListSnapshotsResult) GetSuccess() *ListSnapshotsResp { + if !p.IsSetSuccess() { + return MetaServiceListSnapshotsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSnapshotsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSnapshotsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSnapshots_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 *MetaServiceListSnapshotsResult) 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 *MetaServiceListSnapshotsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSnapshotsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRunAdminJobArgs struct { + thrift.IRequest + Req *AdminJobReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRunAdminJobArgs() *MetaServiceRunAdminJobArgs { + return &MetaServiceRunAdminJobArgs{ + Req: NewAdminJobReq(), + } +} + +var MetaServiceRunAdminJobArgs_Req_DEFAULT *AdminJobReq +func (p *MetaServiceRunAdminJobArgs) GetReq() *AdminJobReq { + if !p.IsSetReq() { + return MetaServiceRunAdminJobArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRunAdminJobArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAdminJobReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobArgs) 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 *MetaServiceRunAdminJobArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRunAdminJobArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRunAdminJobResult struct { + thrift.IResponse + Success *AdminJobResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRunAdminJobResult() *MetaServiceRunAdminJobResult { + return &MetaServiceRunAdminJobResult{} +} + +var MetaServiceRunAdminJobResult_Success_DEFAULT *AdminJobResp +func (p *MetaServiceRunAdminJobResult) GetSuccess() *AdminJobResp { + if !p.IsSetSuccess() { + return MetaServiceRunAdminJobResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRunAdminJobResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminJobResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("runAdminJob_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 *MetaServiceRunAdminJobResult) 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 *MetaServiceRunAdminJobResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRunAdminJobResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneArgs struct { + thrift.IRequest + Req *AddZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneArgs() *MetaServiceAddZoneArgs { + return &MetaServiceAddZoneArgs{ + Req: NewAddZoneReq(), + } +} + +var MetaServiceAddZoneArgs_Req_DEFAULT *AddZoneReq +func (p *MetaServiceAddZoneArgs) GetReq() *AddZoneReq { + if !p.IsSetReq() { + return MetaServiceAddZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_args"); err != nil { + 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 *MetaServiceAddZoneArgs) 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 *MetaServiceAddZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneResult() *MetaServiceAddZoneResult { + return &MetaServiceAddZoneResult{} +} + +var MetaServiceAddZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZone_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 *MetaServiceAddZoneResult) 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 *MetaServiceAddZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneArgs struct { + thrift.IRequest + Req *DropZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneArgs() *MetaServiceDropZoneArgs { + return &MetaServiceDropZoneArgs{ + Req: NewDropZoneReq(), + } +} + +var MetaServiceDropZoneArgs_Req_DEFAULT *DropZoneReq +func (p *MetaServiceDropZoneArgs) GetReq() *DropZoneReq { + if !p.IsSetReq() { + return MetaServiceDropZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneArgs) 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 *MetaServiceDropZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneResult() *MetaServiceDropZoneResult { + return &MetaServiceDropZoneResult{} +} + +var MetaServiceDropZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZone_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 *MetaServiceDropZoneResult) 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 *MetaServiceDropZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddHostIntoZoneArgs struct { + thrift.IRequest + Req *AddHostIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostIntoZoneArgs() *MetaServiceAddHostIntoZoneArgs { + return &MetaServiceAddHostIntoZoneArgs{ + Req: NewAddHostIntoZoneReq(), + } +} + +var MetaServiceAddHostIntoZoneArgs_Req_DEFAULT *AddHostIntoZoneReq +func (p *MetaServiceAddHostIntoZoneArgs) GetReq() *AddHostIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostIntoZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddHostIntoZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_args"); err != nil { + 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 *MetaServiceAddHostIntoZoneArgs) 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 *MetaServiceAddHostIntoZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddHostIntoZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostIntoZoneResult() *MetaServiceAddHostIntoZoneResult { + return &MetaServiceAddHostIntoZoneResult{} +} + +var MetaServiceAddHostIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostIntoZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostIntoZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addHostIntoZone_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 *MetaServiceAddHostIntoZoneResult) 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 *MetaServiceAddHostIntoZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddHostIntoZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropHostFromZoneArgs struct { + thrift.IRequest + Req *DropHostFromZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostFromZoneArgs() *MetaServiceDropHostFromZoneArgs { + return &MetaServiceDropHostFromZoneArgs{ + Req: NewDropHostFromZoneReq(), + } +} + +var MetaServiceDropHostFromZoneArgs_Req_DEFAULT *DropHostFromZoneReq +func (p *MetaServiceDropHostFromZoneArgs) GetReq() *DropHostFromZoneReq { + if !p.IsSetReq() { + return MetaServiceDropHostFromZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostFromZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropHostFromZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_args"); err != nil { + 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 *MetaServiceDropHostFromZoneArgs) 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 *MetaServiceDropHostFromZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropHostFromZoneResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostFromZoneResult() *MetaServiceDropHostFromZoneResult { + return &MetaServiceDropHostFromZoneResult{} +} + +var MetaServiceDropHostFromZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostFromZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostFromZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostFromZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostFromZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropHostFromZone_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 *MetaServiceDropHostFromZoneResult) 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 *MetaServiceDropHostFromZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropHostFromZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetZoneArgs struct { + thrift.IRequest + Req *GetZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetZoneArgs() *MetaServiceGetZoneArgs { + return &MetaServiceGetZoneArgs{ + Req: NewGetZoneReq(), + } +} + +var MetaServiceGetZoneArgs_Req_DEFAULT *GetZoneReq +func (p *MetaServiceGetZoneArgs) GetReq() *GetZoneReq { + if !p.IsSetReq() { + return MetaServiceGetZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetZoneArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetZoneReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneArgs) 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 *MetaServiceGetZoneArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetZoneArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetZoneResult struct { + thrift.IResponse + Success *GetZoneResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetZoneResult() *MetaServiceGetZoneResult { + return &MetaServiceGetZoneResult{} +} + +var MetaServiceGetZoneResult_Success_DEFAULT *GetZoneResp +func (p *MetaServiceGetZoneResult) GetSuccess() *GetZoneResp { + if !p.IsSetSuccess() { + return MetaServiceGetZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetZoneResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetZoneResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getZone_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 *MetaServiceGetZoneResult) 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 *MetaServiceGetZoneResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetZoneResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListZonesArgs struct { + thrift.IRequest + Req *ListZonesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListZonesArgs() *MetaServiceListZonesArgs { + return &MetaServiceListZonesArgs{ + Req: NewListZonesReq(), + } +} + +var MetaServiceListZonesArgs_Req_DEFAULT *ListZonesReq +func (p *MetaServiceListZonesArgs) GetReq() *ListZonesReq { + if !p.IsSetReq() { + return MetaServiceListZonesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListZonesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListZonesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesArgs) 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 *MetaServiceListZonesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListZonesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListZonesResult struct { + thrift.IResponse + Success *ListZonesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListZonesResult() *MetaServiceListZonesResult { + return &MetaServiceListZonesResult{} +} + +var MetaServiceListZonesResult_Success_DEFAULT *ListZonesResp +func (p *MetaServiceListZonesResult) GetSuccess() *ListZonesResp { + if !p.IsSetSuccess() { + return MetaServiceListZonesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListZonesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListZonesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listZones_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 *MetaServiceListZonesResult) 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 *MetaServiceListZonesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListZonesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddGroupArgs struct { + thrift.IRequest + Req *AddGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddGroupArgs() *MetaServiceAddGroupArgs { + return &MetaServiceAddGroupArgs{ + Req: NewAddGroupReq(), + } +} + +var MetaServiceAddGroupArgs_Req_DEFAULT *AddGroupReq +func (p *MetaServiceAddGroupArgs) GetReq() *AddGroupReq { + if !p.IsSetReq() { + return MetaServiceAddGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupArgs) 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 *MetaServiceAddGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddGroupResult() *MetaServiceAddGroupResult { + return &MetaServiceAddGroupResult{} +} + +var MetaServiceAddGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addGroup_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 *MetaServiceAddGroupResult) 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 *MetaServiceAddGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropGroupArgs struct { + thrift.IRequest + Req *DropGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropGroupArgs() *MetaServiceDropGroupArgs { + return &MetaServiceDropGroupArgs{ + Req: NewDropGroupReq(), + } +} + +var MetaServiceDropGroupArgs_Req_DEFAULT *DropGroupReq +func (p *MetaServiceDropGroupArgs) GetReq() *DropGroupReq { + if !p.IsSetReq() { + return MetaServiceDropGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupArgs) 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 *MetaServiceDropGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropGroupResult() *MetaServiceDropGroupResult { + return &MetaServiceDropGroupResult{} +} + +var MetaServiceDropGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropGroup_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 *MetaServiceDropGroupResult) 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 *MetaServiceDropGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddZoneIntoGroupArgs struct { + thrift.IRequest + Req *AddZoneIntoGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddZoneIntoGroupArgs() *MetaServiceAddZoneIntoGroupArgs { + return &MetaServiceAddZoneIntoGroupArgs{ + Req: NewAddZoneIntoGroupReq(), + } +} + +var MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT *AddZoneIntoGroupReq +func (p *MetaServiceAddZoneIntoGroupArgs) GetReq() *AddZoneIntoGroupReq { + if !p.IsSetReq() { + return MetaServiceAddZoneIntoGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddZoneIntoGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddZoneIntoGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupArgs) 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 *MetaServiceAddZoneIntoGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddZoneIntoGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddZoneIntoGroupResult() *MetaServiceAddZoneIntoGroupResult { + return &MetaServiceAddZoneIntoGroupResult{} +} + +var MetaServiceAddZoneIntoGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddZoneIntoGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddZoneIntoGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddZoneIntoGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddZoneIntoGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addZoneIntoGroup_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 *MetaServiceAddZoneIntoGroupResult) 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 *MetaServiceAddZoneIntoGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddZoneIntoGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropZoneFromGroupArgs struct { + thrift.IRequest + Req *DropZoneFromGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropZoneFromGroupArgs() *MetaServiceDropZoneFromGroupArgs { + return &MetaServiceDropZoneFromGroupArgs{ + Req: NewDropZoneFromGroupReq(), + } +} + +var MetaServiceDropZoneFromGroupArgs_Req_DEFAULT *DropZoneFromGroupReq +func (p *MetaServiceDropZoneFromGroupArgs) GetReq() *DropZoneFromGroupReq { + if !p.IsSetReq() { + return MetaServiceDropZoneFromGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropZoneFromGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropZoneFromGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupArgs) 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 *MetaServiceDropZoneFromGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropZoneFromGroupResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropZoneFromGroupResult() *MetaServiceDropZoneFromGroupResult { + return &MetaServiceDropZoneFromGroupResult{} +} + +var MetaServiceDropZoneFromGroupResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropZoneFromGroupResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropZoneFromGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropZoneFromGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneFromGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropZoneFromGroup_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 *MetaServiceDropZoneFromGroupResult) 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 *MetaServiceDropZoneFromGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropZoneFromGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetGroupArgs struct { + thrift.IRequest + Req *GetGroupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetGroupArgs() *MetaServiceGetGroupArgs { + return &MetaServiceGetGroupArgs{ + Req: NewGetGroupReq(), + } +} + +var MetaServiceGetGroupArgs_Req_DEFAULT *GetGroupReq +func (p *MetaServiceGetGroupArgs) GetReq() *GetGroupReq { + if !p.IsSetReq() { + return MetaServiceGetGroupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetGroupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetGroupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetGroupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupArgs) 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 *MetaServiceGetGroupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetGroupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetGroupResult struct { + thrift.IResponse + Success *GetGroupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetGroupResult() *MetaServiceGetGroupResult { + return &MetaServiceGetGroupResult{} +} + +var MetaServiceGetGroupResult_Success_DEFAULT *GetGroupResp +func (p *MetaServiceGetGroupResult) GetSuccess() *GetGroupResp { + if !p.IsSetSuccess() { + return MetaServiceGetGroupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetGroupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetGroupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetGroupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getGroup_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 *MetaServiceGetGroupResult) 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 *MetaServiceGetGroupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetGroupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListGroupsArgs struct { + thrift.IRequest + Req *ListGroupsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListGroupsArgs() *MetaServiceListGroupsArgs { + return &MetaServiceListGroupsArgs{ + Req: NewListGroupsReq(), + } +} + +var MetaServiceListGroupsArgs_Req_DEFAULT *ListGroupsReq +func (p *MetaServiceListGroupsArgs) GetReq() *ListGroupsReq { + if !p.IsSetReq() { + return MetaServiceListGroupsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListGroupsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListGroupsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListGroupsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsArgs) 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 *MetaServiceListGroupsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListGroupsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListGroupsResult struct { + thrift.IResponse + Success *ListGroupsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListGroupsResult() *MetaServiceListGroupsResult { + return &MetaServiceListGroupsResult{} +} + +var MetaServiceListGroupsResult_Success_DEFAULT *ListGroupsResp +func (p *MetaServiceListGroupsResult) GetSuccess() *ListGroupsResp { + if !p.IsSetSuccess() { + return MetaServiceListGroupsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListGroupsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListGroupsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListGroupsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listGroups_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 *MetaServiceListGroupsResult) 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 *MetaServiceListGroupsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListGroupsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateBackupArgs struct { + thrift.IRequest + Req *CreateBackupReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateBackupArgs() *MetaServiceCreateBackupArgs { + return &MetaServiceCreateBackupArgs{ + Req: NewCreateBackupReq(), + } +} + +var MetaServiceCreateBackupArgs_Req_DEFAULT *CreateBackupReq +func (p *MetaServiceCreateBackupArgs) GetReq() *CreateBackupReq { + if !p.IsSetReq() { + return MetaServiceCreateBackupArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateBackupArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateBackupReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupArgs) 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 *MetaServiceCreateBackupArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateBackupArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateBackupResult struct { + thrift.IResponse + Success *CreateBackupResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateBackupResult() *MetaServiceCreateBackupResult { + return &MetaServiceCreateBackupResult{} +} + +var MetaServiceCreateBackupResult_Success_DEFAULT *CreateBackupResp +func (p *MetaServiceCreateBackupResult) GetSuccess() *CreateBackupResp { + if !p.IsSetSuccess() { + return MetaServiceCreateBackupResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateBackupResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateBackupResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createBackup_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 *MetaServiceCreateBackupResult) 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 *MetaServiceCreateBackupResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateBackupResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRestoreMetaArgs struct { + thrift.IRequest + Req *RestoreMetaReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRestoreMetaArgs() *MetaServiceRestoreMetaArgs { + return &MetaServiceRestoreMetaArgs{ + Req: NewRestoreMetaReq(), + } +} + +var MetaServiceRestoreMetaArgs_Req_DEFAULT *RestoreMetaReq +func (p *MetaServiceRestoreMetaArgs) GetReq() *RestoreMetaReq { + if !p.IsSetReq() { + return MetaServiceRestoreMetaArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRestoreMetaArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRestoreMetaReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaArgs) 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 *MetaServiceRestoreMetaArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRestoreMetaArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRestoreMetaResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { + return &MetaServiceRestoreMetaResult{} +} + +var MetaServiceRestoreMetaResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRestoreMetaResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("restoreMeta_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 *MetaServiceRestoreMetaResult) 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 *MetaServiceRestoreMetaResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRestoreMetaResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceAddListenerArgs struct { + thrift.IRequest + Req *AddListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddListenerArgs() *MetaServiceAddListenerArgs { + return &MetaServiceAddListenerArgs{ + Req: NewAddListenerReq(), + } +} + +var MetaServiceAddListenerArgs_Req_DEFAULT *AddListenerReq +func (p *MetaServiceAddListenerArgs) GetReq() *AddListenerReq { + if !p.IsSetReq() { + return MetaServiceAddListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerArgs) 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 *MetaServiceAddListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceAddListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceAddListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddListenerResult() *MetaServiceAddListenerResult { + return &MetaServiceAddListenerResult{} +} + +var MetaServiceAddListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addListener_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 *MetaServiceAddListenerResult) 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 *MetaServiceAddListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceAddListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveListenerArgs struct { + thrift.IRequest + Req *RemoveListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveListenerArgs() *MetaServiceRemoveListenerArgs { + return &MetaServiceRemoveListenerArgs{ + Req: NewRemoveListenerReq(), + } +} + +var MetaServiceRemoveListenerArgs_Req_DEFAULT *RemoveListenerReq +func (p *MetaServiceRemoveListenerArgs) GetReq() *RemoveListenerReq { + if !p.IsSetReq() { + return MetaServiceRemoveListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerArgs) 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 *MetaServiceRemoveListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveListenerResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveListenerResult() *MetaServiceRemoveListenerResult { + return &MetaServiceRemoveListenerResult{} +} + +var MetaServiceRemoveListenerResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveListenerResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeListener_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 *MetaServiceRemoveListenerResult) 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 *MetaServiceRemoveListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListListenerArgs struct { + thrift.IRequest + Req *ListListenerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListListenerArgs() *MetaServiceListListenerArgs { + return &MetaServiceListListenerArgs{ + Req: NewListListenerReq(), + } +} + +var MetaServiceListListenerArgs_Req_DEFAULT *ListListenerReq +func (p *MetaServiceListListenerArgs) GetReq() *ListListenerReq { + if !p.IsSetReq() { + return MetaServiceListListenerArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListListenerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListListenerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerArgs) 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 *MetaServiceListListenerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListListenerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListListenerResult struct { + thrift.IResponse + Success *ListListenerResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListListenerResult() *MetaServiceListListenerResult { + return &MetaServiceListListenerResult{} +} + +var MetaServiceListListenerResult_Success_DEFAULT *ListListenerResp +func (p *MetaServiceListListenerResult) GetSuccess() *ListListenerResp { + if !p.IsSetSuccess() { + return MetaServiceListListenerResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListListenerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListListenerResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listListener_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 *MetaServiceListListenerResult) 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 *MetaServiceListListenerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListListenerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetStatsArgs struct { + thrift.IRequest + Req *GetStatsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetStatsArgs() *MetaServiceGetStatsArgs { + return &MetaServiceGetStatsArgs{ + Req: NewGetStatsReq(), + } +} + +var MetaServiceGetStatsArgs_Req_DEFAULT *GetStatsReq +func (p *MetaServiceGetStatsArgs) GetReq() *GetStatsReq { + if !p.IsSetReq() { + return MetaServiceGetStatsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetStatsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetStatsArgs) 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 *MetaServiceGetStatsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetStatsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetStatsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStats_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 *MetaServiceGetStatsArgs) 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 *MetaServiceGetStatsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetStatsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetStatsResult struct { + thrift.IResponse + Success *GetStatsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetStatsResult() *MetaServiceGetStatsResult { + return &MetaServiceGetStatsResult{} +} + +var MetaServiceGetStatsResult_Success_DEFAULT *GetStatsResp +func (p *MetaServiceGetStatsResult) GetSuccess() *GetStatsResp { + if !p.IsSetSuccess() { + return MetaServiceGetStatsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetStatsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetStatsResult) 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 *MetaServiceGetStatsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetStatsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetStatsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getStats_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 *MetaServiceGetStatsResult) 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 *MetaServiceGetStatsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetStatsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignInFTServiceArgs struct { + thrift.IRequest + Req *SignInFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignInFTServiceArgs() *MetaServiceSignInFTServiceArgs { + return &MetaServiceSignInFTServiceArgs{ + Req: NewSignInFTServiceReq(), + } +} + +var MetaServiceSignInFTServiceArgs_Req_DEFAULT *SignInFTServiceReq +func (p *MetaServiceSignInFTServiceArgs) GetReq() *SignInFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignInFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignInFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignInFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceArgs) 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 *MetaServiceSignInFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignInFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignInFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignInFTServiceResult() *MetaServiceSignInFTServiceResult { + return &MetaServiceSignInFTServiceResult{} +} + +var MetaServiceSignInFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignInFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignInFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignInFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignInFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signInFTService_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 *MetaServiceSignInFTServiceResult) 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 *MetaServiceSignInFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignInFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceSignOutFTServiceArgs struct { + thrift.IRequest + Req *SignOutFTServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignOutFTServiceArgs() *MetaServiceSignOutFTServiceArgs { + return &MetaServiceSignOutFTServiceArgs{ + Req: NewSignOutFTServiceReq(), + } +} + +var MetaServiceSignOutFTServiceArgs_Req_DEFAULT *SignOutFTServiceReq +func (p *MetaServiceSignOutFTServiceArgs) GetReq() *SignOutFTServiceReq { + if !p.IsSetReq() { + return MetaServiceSignOutFTServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignOutFTServiceArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewSignOutFTServiceReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceArgs) 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 *MetaServiceSignOutFTServiceArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceSignOutFTServiceResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignOutFTServiceResult() *MetaServiceSignOutFTServiceResult { + return &MetaServiceSignOutFTServiceResult{} +} + +var MetaServiceSignOutFTServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignOutFTServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignOutFTServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignOutFTServiceResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignOutFTServiceResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("signOutFTService_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 *MetaServiceSignOutFTServiceResult) 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 *MetaServiceSignOutFTServiceResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceSignOutFTServiceResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTClientsArgs struct { + thrift.IRequest + Req *ListFTClientsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTClientsArgs() *MetaServiceListFTClientsArgs { + return &MetaServiceListFTClientsArgs{ + Req: NewListFTClientsReq(), + } +} + +var MetaServiceListFTClientsArgs_Req_DEFAULT *ListFTClientsReq +func (p *MetaServiceListFTClientsArgs) GetReq() *ListFTClientsReq { + if !p.IsSetReq() { + return MetaServiceListFTClientsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTClientsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTClientsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTClientsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsArgs) 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 *MetaServiceListFTClientsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTClientsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTClientsResult struct { + thrift.IResponse + Success *ListFTClientsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTClientsResult() *MetaServiceListFTClientsResult { + return &MetaServiceListFTClientsResult{} +} + +var MetaServiceListFTClientsResult_Success_DEFAULT *ListFTClientsResp +func (p *MetaServiceListFTClientsResult) GetSuccess() *ListFTClientsResp { + if !p.IsSetSuccess() { + return MetaServiceListFTClientsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTClientsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTClientsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTClientsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTClients_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 *MetaServiceListFTClientsResult) 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 *MetaServiceListFTClientsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTClientsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateFTIndexArgs struct { + thrift.IRequest + Req *CreateFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateFTIndexArgs() *MetaServiceCreateFTIndexArgs { + return &MetaServiceCreateFTIndexArgs{ + Req: NewCreateFTIndexReq(), + } +} + +var MetaServiceCreateFTIndexArgs_Req_DEFAULT *CreateFTIndexReq +func (p *MetaServiceCreateFTIndexArgs) GetReq() *CreateFTIndexReq { + if !p.IsSetReq() { + return MetaServiceCreateFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexArgs) 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 *MetaServiceCreateFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateFTIndexResult() *MetaServiceCreateFTIndexResult { + return &MetaServiceCreateFTIndexResult{} +} + +var MetaServiceCreateFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceCreateFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceCreateFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createFTIndex_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 *MetaServiceCreateFTIndexResult) 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 *MetaServiceCreateFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceDropFTIndexArgs struct { + thrift.IRequest + Req *DropFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropFTIndexArgs() *MetaServiceDropFTIndexArgs { + return &MetaServiceDropFTIndexArgs{ + Req: NewDropFTIndexReq(), + } +} + +var MetaServiceDropFTIndexArgs_Req_DEFAULT *DropFTIndexReq +func (p *MetaServiceDropFTIndexArgs) GetReq() *DropFTIndexReq { + if !p.IsSetReq() { + return MetaServiceDropFTIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropFTIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropFTIndexReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexArgs) 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 *MetaServiceDropFTIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceDropFTIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceDropFTIndexResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropFTIndexResult() *MetaServiceDropFTIndexResult { + return &MetaServiceDropFTIndexResult{} +} + +var MetaServiceDropFTIndexResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropFTIndexResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropFTIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropFTIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropFTIndex_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 *MetaServiceDropFTIndexResult) 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 *MetaServiceDropFTIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceDropFTIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListFTIndexesArgs struct { + thrift.IRequest + Req *ListFTIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTIndexesArgs() *MetaServiceListFTIndexesArgs { + return &MetaServiceListFTIndexesArgs{ + Req: NewListFTIndexesReq(), + } +} + +var MetaServiceListFTIndexesArgs_Req_DEFAULT *ListFTIndexesReq +func (p *MetaServiceListFTIndexesArgs) GetReq() *ListFTIndexesReq { + if !p.IsSetReq() { + return MetaServiceListFTIndexesArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListFTIndexesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListFTIndexesReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesArgs) 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 *MetaServiceListFTIndexesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListFTIndexesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListFTIndexesResult struct { + thrift.IResponse + Success *ListFTIndexesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListFTIndexesResult() *MetaServiceListFTIndexesResult { + return &MetaServiceListFTIndexesResult{} +} + +var MetaServiceListFTIndexesResult_Success_DEFAULT *ListFTIndexesResp +func (p *MetaServiceListFTIndexesResult) GetSuccess() *ListFTIndexesResp { + if !p.IsSetSuccess() { + return MetaServiceListFTIndexesResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListFTIndexesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListFTIndexesResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listFTIndexes_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 *MetaServiceListFTIndexesResult) 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 *MetaServiceListFTIndexesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListFTIndexesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceCreateSessionArgs struct { + thrift.IRequest + Req *CreateSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSessionArgs() *MetaServiceCreateSessionArgs { + return &MetaServiceCreateSessionArgs{ + Req: NewCreateSessionReq(), + } +} + +var MetaServiceCreateSessionArgs_Req_DEFAULT *CreateSessionReq +func (p *MetaServiceCreateSessionArgs) GetReq() *CreateSessionReq { + if !p.IsSetReq() { + return MetaServiceCreateSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceCreateSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionArgs) 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 *MetaServiceCreateSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceCreateSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceCreateSessionResult struct { + thrift.IResponse + Success *CreateSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceCreateSessionResult() *MetaServiceCreateSessionResult { + return &MetaServiceCreateSessionResult{} +} + +var MetaServiceCreateSessionResult_Success_DEFAULT *CreateSessionResp +func (p *MetaServiceCreateSessionResult) GetSuccess() *CreateSessionResp { + if !p.IsSetSuccess() { + return MetaServiceCreateSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceCreateSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createSession_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 *MetaServiceCreateSessionResult) 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 *MetaServiceCreateSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceCreateSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceUpdateSessionsArgs struct { + thrift.IRequest + Req *UpdateSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceUpdateSessionsArgs() *MetaServiceUpdateSessionsArgs { + return &MetaServiceUpdateSessionsArgs{ + Req: NewUpdateSessionsReq(), + } +} + +var MetaServiceUpdateSessionsArgs_Req_DEFAULT *UpdateSessionsReq +func (p *MetaServiceUpdateSessionsArgs) GetReq() *UpdateSessionsReq { + if !p.IsSetReq() { + return MetaServiceUpdateSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceUpdateSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsArgs) 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 *MetaServiceUpdateSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceUpdateSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceUpdateSessionsResult struct { + thrift.IResponse + Success *UpdateSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceUpdateSessionsResult() *MetaServiceUpdateSessionsResult { + return &MetaServiceUpdateSessionsResult{} +} + +var MetaServiceUpdateSessionsResult_Success_DEFAULT *UpdateSessionsResp +func (p *MetaServiceUpdateSessionsResult) GetSuccess() *UpdateSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceUpdateSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceUpdateSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateSessions_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 *MetaServiceUpdateSessionsResult) 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 *MetaServiceUpdateSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceUpdateSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListSessionsArgs struct { + thrift.IRequest + Req *ListSessionsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListSessionsArgs() *MetaServiceListSessionsArgs { + return &MetaServiceListSessionsArgs{ + Req: NewListSessionsReq(), + } +} + +var MetaServiceListSessionsArgs_Req_DEFAULT *ListSessionsReq +func (p *MetaServiceListSessionsArgs) GetReq() *ListSessionsReq { + if !p.IsSetReq() { + return MetaServiceListSessionsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListSessionsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListSessionsReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsArgs) 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 *MetaServiceListSessionsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListSessionsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListSessionsResult struct { + thrift.IResponse + Success *ListSessionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListSessionsResult() *MetaServiceListSessionsResult { + return &MetaServiceListSessionsResult{} +} + +var MetaServiceListSessionsResult_Success_DEFAULT *ListSessionsResp +func (p *MetaServiceListSessionsResult) GetSuccess() *ListSessionsResp { + if !p.IsSetSuccess() { + return MetaServiceListSessionsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListSessionsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListSessionsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listSessions_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 *MetaServiceListSessionsResult) 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 *MetaServiceListSessionsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListSessionsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetSessionArgs struct { + thrift.IRequest + Req *GetSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSessionArgs() *MetaServiceGetSessionArgs { + return &MetaServiceGetSessionArgs{ + Req: NewGetSessionReq(), + } +} + +var MetaServiceGetSessionArgs_Req_DEFAULT *GetSessionReq +func (p *MetaServiceGetSessionArgs) GetReq() *GetSessionReq { + if !p.IsSetReq() { + return MetaServiceGetSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionArgs) 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 *MetaServiceGetSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetSessionResult struct { + thrift.IResponse + Success *GetSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSessionResult() *MetaServiceGetSessionResult { + return &MetaServiceGetSessionResult{} +} + +var MetaServiceGetSessionResult_Success_DEFAULT *GetSessionResp +func (p *MetaServiceGetSessionResult) GetSuccess() *GetSessionResp { + if !p.IsSetSuccess() { + return MetaServiceGetSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetSessionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getSession_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 *MetaServiceGetSessionResult) 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 *MetaServiceGetSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceRemoveSessionArgs struct { + thrift.IRequest + Req *RemoveSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRemoveSessionArgs() *MetaServiceRemoveSessionArgs { + return &MetaServiceRemoveSessionArgs{ + Req: NewRemoveSessionReq(), + } +} + +var MetaServiceRemoveSessionArgs_Req_DEFAULT *RemoveSessionReq +func (p *MetaServiceRemoveSessionArgs) GetReq() *RemoveSessionReq { + if !p.IsSetReq() { + return MetaServiceRemoveSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRemoveSessionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemoveSessionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionArgs) 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 *MetaServiceRemoveSessionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceRemoveSessionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceRemoveSessionResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveSessionResult() *MetaServiceRemoveSessionResult { + return &MetaServiceRemoveSessionResult{} +} + +var MetaServiceRemoveSessionResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRemoveSessionResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveSessionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removeSession_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 *MetaServiceRemoveSessionResult) 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 *MetaServiceRemoveSessionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceRemoveSessionResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceKillQueryArgs struct { + thrift.IRequest + Req *KillQueryReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceKillQueryArgs() *MetaServiceKillQueryArgs { + return &MetaServiceKillQueryArgs{ + Req: NewKillQueryReq(), + } +} + +var MetaServiceKillQueryArgs_Req_DEFAULT *KillQueryReq +func (p *MetaServiceKillQueryArgs) GetReq() *KillQueryReq { + if !p.IsSetReq() { + return MetaServiceKillQueryArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceKillQueryArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKillQueryReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceKillQueryArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryArgs) 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 *MetaServiceKillQueryArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceKillQueryArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceKillQueryResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceKillQueryResult() *MetaServiceKillQueryResult { + return &MetaServiceKillQueryResult{} +} + +var MetaServiceKillQueryResult_Success_DEFAULT *ExecResp +func (p *MetaServiceKillQueryResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceKillQueryResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceKillQueryResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceKillQueryResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("killQuery_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 *MetaServiceKillQueryResult) 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 *MetaServiceKillQueryResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceKillQueryResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceReportTaskFinishArgs struct { + thrift.IRequest + Req *ReportTaskReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceReportTaskFinishArgs() *MetaServiceReportTaskFinishArgs { + return &MetaServiceReportTaskFinishArgs{ + Req: NewReportTaskReq(), + } +} + +var MetaServiceReportTaskFinishArgs_Req_DEFAULT *ReportTaskReq +func (p *MetaServiceReportTaskFinishArgs) GetReq() *ReportTaskReq { + if !p.IsSetReq() { + return MetaServiceReportTaskFinishArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceReportTaskFinishArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewReportTaskReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishArgs) 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 *MetaServiceReportTaskFinishArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceReportTaskFinishArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceReportTaskFinishResult struct { + thrift.IResponse + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceReportTaskFinishResult() *MetaServiceReportTaskFinishResult { + return &MetaServiceReportTaskFinishResult{} +} + +var MetaServiceReportTaskFinishResult_Success_DEFAULT *ExecResp +func (p *MetaServiceReportTaskFinishResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceReportTaskFinishResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceReportTaskFinishResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("reportTaskFinish_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 *MetaServiceReportTaskFinishResult) 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 *MetaServiceReportTaskFinishResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceReportTaskFinishResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceListClusterArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListClusterArgs() *MetaServiceListClusterArgs { + return &MetaServiceListClusterArgs{ + Req: NewListClusterInfoReq(), + } +} + +var MetaServiceListClusterArgs_Req_DEFAULT *ListClusterInfoReq +func (p *MetaServiceListClusterArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return MetaServiceListClusterArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListClusterArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListClusterArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterArgs) 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 *MetaServiceListClusterArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceListClusterArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceListClusterResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListClusterResult() *MetaServiceListClusterResult { + return &MetaServiceListClusterResult{} +} + +var MetaServiceListClusterResult_Success_DEFAULT *ListClusterInfoResp +func (p *MetaServiceListClusterResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return MetaServiceListClusterResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListClusterResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListClusterResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listCluster_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 *MetaServiceListClusterResult) 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 *MetaServiceListClusterResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceListClusterResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceGetMetaDirInfoArgs struct { + thrift.IRequest + Req *GetMetaDirInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetMetaDirInfoArgs() *MetaServiceGetMetaDirInfoArgs { + return &MetaServiceGetMetaDirInfoArgs{ + Req: NewGetMetaDirInfoReq(), + } +} + +var MetaServiceGetMetaDirInfoArgs_Req_DEFAULT *GetMetaDirInfoReq +func (p *MetaServiceGetMetaDirInfoArgs) GetReq() *GetMetaDirInfoReq { + if !p.IsSetReq() { + return MetaServiceGetMetaDirInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetMetaDirInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetMetaDirInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoArgs) 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 *MetaServiceGetMetaDirInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceGetMetaDirInfoResult struct { + thrift.IResponse + Success *GetMetaDirInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetMetaDirInfoResult() *MetaServiceGetMetaDirInfoResult { + return &MetaServiceGetMetaDirInfoResult{} +} + +var MetaServiceGetMetaDirInfoResult_Success_DEFAULT *GetMetaDirInfoResp +func (p *MetaServiceGetMetaDirInfoResult) GetSuccess() *GetMetaDirInfoResp { + if !p.IsSetSuccess() { + return MetaServiceGetMetaDirInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetMetaDirInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetMetaDirInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getMetaDirInfo_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 *MetaServiceGetMetaDirInfoResult) 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 *MetaServiceGetMetaDirInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type MetaServiceVerifyClientVersionArgs struct { + thrift.IRequest + Req *VerifyClientVersionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceVerifyClientVersionArgs() *MetaServiceVerifyClientVersionArgs { + return &MetaServiceVerifyClientVersionArgs{ + Req: NewVerifyClientVersionReq(), + } +} + +var MetaServiceVerifyClientVersionArgs_Req_DEFAULT *VerifyClientVersionReq +func (p *MetaServiceVerifyClientVersionArgs) GetReq() *VerifyClientVersionReq { + if !p.IsSetReq() { + return MetaServiceVerifyClientVersionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceVerifyClientVersionArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *MetaServiceVerifyClientVersionArgs) 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 *MetaServiceVerifyClientVersionArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewVerifyClientVersionReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("verifyClientVersion_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 *MetaServiceVerifyClientVersionArgs) 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 *MetaServiceVerifyClientVersionArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("MetaServiceVerifyClientVersionArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type MetaServiceVerifyClientVersionResult struct { + thrift.IResponse + Success *VerifyClientVersionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceVerifyClientVersionResult() *MetaServiceVerifyClientVersionResult { + return &MetaServiceVerifyClientVersionResult{} +} + +var MetaServiceVerifyClientVersionResult_Success_DEFAULT *VerifyClientVersionResp +func (p *MetaServiceVerifyClientVersionResult) GetSuccess() *VerifyClientVersionResp { + if !p.IsSetSuccess() { + return MetaServiceVerifyClientVersionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceVerifyClientVersionResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *MetaServiceVerifyClientVersionResult) 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 *MetaServiceVerifyClientVersionResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewVerifyClientVersionResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("verifyClientVersion_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 *MetaServiceVerifyClientVersionResult) 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 *MetaServiceVerifyClientVersionResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("MetaServiceVerifyClientVersionResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_6_0/meta/ttypes.go b/ccore/nebula/internal/thrift/v2_6_0/meta/ttypes.go new file mode 100644 index 0000000..47b66ef --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/meta/ttypes.go @@ -0,0 +1,27225 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package meta + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type AlterSchemaOp int64 +const ( + AlterSchemaOp_ADD AlterSchemaOp = 1 + AlterSchemaOp_CHANGE AlterSchemaOp = 2 + AlterSchemaOp_DROP AlterSchemaOp = 3 + AlterSchemaOp_UNKNOWN AlterSchemaOp = 4 +) + +var AlterSchemaOpToName = map[AlterSchemaOp]string { + AlterSchemaOp_ADD: "ADD", + AlterSchemaOp_CHANGE: "CHANGE", + AlterSchemaOp_DROP: "DROP", + AlterSchemaOp_UNKNOWN: "UNKNOWN", +} + +var AlterSchemaOpToValue = map[string]AlterSchemaOp { + "ADD": AlterSchemaOp_ADD, + "CHANGE": AlterSchemaOp_CHANGE, + "DROP": AlterSchemaOp_DROP, + "UNKNOWN": AlterSchemaOp_UNKNOWN, +} + +var AlterSchemaOpNames = []string { + "ADD", + "CHANGE", + "DROP", + "UNKNOWN", +} + +var AlterSchemaOpValues = []AlterSchemaOp { + AlterSchemaOp_ADD, + AlterSchemaOp_CHANGE, + AlterSchemaOp_DROP, + AlterSchemaOp_UNKNOWN, +} + +func (p AlterSchemaOp) String() string { + if v, ok := AlterSchemaOpToName[p]; ok { + return v + } + return "" +} + +func AlterSchemaOpFromString(s string) (AlterSchemaOp, error) { + if v, ok := AlterSchemaOpToValue[s]; ok { + return v, nil + } + return AlterSchemaOp(0), fmt.Errorf("not a valid AlterSchemaOp string") +} + +func AlterSchemaOpPtr(v AlterSchemaOp) *AlterSchemaOp { return &v } + +type RoleType int64 +const ( + RoleType_GOD RoleType = 1 + RoleType_ADMIN RoleType = 2 + RoleType_DBA RoleType = 3 + RoleType_USER RoleType = 4 + RoleType_GUEST RoleType = 5 +) + +var RoleTypeToName = map[RoleType]string { + RoleType_GOD: "GOD", + RoleType_ADMIN: "ADMIN", + RoleType_DBA: "DBA", + RoleType_USER: "USER", + RoleType_GUEST: "GUEST", +} + +var RoleTypeToValue = map[string]RoleType { + "GOD": RoleType_GOD, + "ADMIN": RoleType_ADMIN, + "DBA": RoleType_DBA, + "USER": RoleType_USER, + "GUEST": RoleType_GUEST, +} + +var RoleTypeNames = []string { + "GOD", + "ADMIN", + "DBA", + "USER", + "GUEST", +} + +var RoleTypeValues = []RoleType { + RoleType_GOD, + RoleType_ADMIN, + RoleType_DBA, + RoleType_USER, + RoleType_GUEST, +} + +func (p RoleType) String() string { + if v, ok := RoleTypeToName[p]; ok { + return v + } + return "" +} + +func RoleTypeFromString(s string) (RoleType, error) { + if v, ok := RoleTypeToValue[s]; ok { + return v, nil + } + return RoleType(0), fmt.Errorf("not a valid RoleType string") +} + +func RoleTypePtr(v RoleType) *RoleType { return &v } + +type GeoShape int64 +const ( + GeoShape_ANY GeoShape = 0 + GeoShape_POINT GeoShape = 1 + GeoShape_LINESTRING GeoShape = 2 + GeoShape_POLYGON GeoShape = 3 +) + +var GeoShapeToName = map[GeoShape]string { + GeoShape_ANY: "ANY", + GeoShape_POINT: "POINT", + GeoShape_LINESTRING: "LINESTRING", + GeoShape_POLYGON: "POLYGON", +} + +var GeoShapeToValue = map[string]GeoShape { + "ANY": GeoShape_ANY, + "POINT": GeoShape_POINT, + "LINESTRING": GeoShape_LINESTRING, + "POLYGON": GeoShape_POLYGON, +} + +var GeoShapeNames = []string { + "ANY", + "POINT", + "LINESTRING", + "POLYGON", +} + +var GeoShapeValues = []GeoShape { + GeoShape_ANY, + GeoShape_POINT, + GeoShape_LINESTRING, + GeoShape_POLYGON, +} + +func (p GeoShape) String() string { + if v, ok := GeoShapeToName[p]; ok { + return v + } + return "" +} + +func GeoShapeFromString(s string) (GeoShape, error) { + if v, ok := GeoShapeToValue[s]; ok { + return v, nil + } + return GeoShape(0), fmt.Errorf("not a valid GeoShape string") +} + +func GeoShapePtr(v GeoShape) *GeoShape { return &v } + +type PropertyType int64 +const ( + PropertyType_UNKNOWN PropertyType = 0 + PropertyType_BOOL PropertyType = 1 + PropertyType_INT64 PropertyType = 2 + PropertyType_VID PropertyType = 3 + PropertyType_FLOAT PropertyType = 4 + PropertyType_DOUBLE PropertyType = 5 + PropertyType_STRING PropertyType = 6 + PropertyType_FIXED_STRING PropertyType = 7 + PropertyType_INT8 PropertyType = 8 + PropertyType_INT16 PropertyType = 9 + PropertyType_INT32 PropertyType = 10 + PropertyType_TIMESTAMP PropertyType = 21 + PropertyType_DATE PropertyType = 24 + PropertyType_DATETIME PropertyType = 25 + PropertyType_TIME PropertyType = 26 + PropertyType_GEOGRAPHY PropertyType = 31 +) + +var PropertyTypeToName = map[PropertyType]string { + PropertyType_UNKNOWN: "UNKNOWN", + PropertyType_BOOL: "BOOL", + PropertyType_INT64: "INT64", + PropertyType_VID: "VID", + PropertyType_FLOAT: "FLOAT", + PropertyType_DOUBLE: "DOUBLE", + PropertyType_STRING: "STRING", + PropertyType_FIXED_STRING: "FIXED_STRING", + PropertyType_INT8: "INT8", + PropertyType_INT16: "INT16", + PropertyType_INT32: "INT32", + PropertyType_TIMESTAMP: "TIMESTAMP", + PropertyType_DATE: "DATE", + PropertyType_DATETIME: "DATETIME", + PropertyType_TIME: "TIME", + PropertyType_GEOGRAPHY: "GEOGRAPHY", +} + +var PropertyTypeToValue = map[string]PropertyType { + "UNKNOWN": PropertyType_UNKNOWN, + "BOOL": PropertyType_BOOL, + "INT64": PropertyType_INT64, + "VID": PropertyType_VID, + "FLOAT": PropertyType_FLOAT, + "DOUBLE": PropertyType_DOUBLE, + "STRING": PropertyType_STRING, + "FIXED_STRING": PropertyType_FIXED_STRING, + "INT8": PropertyType_INT8, + "INT16": PropertyType_INT16, + "INT32": PropertyType_INT32, + "TIMESTAMP": PropertyType_TIMESTAMP, + "DATE": PropertyType_DATE, + "DATETIME": PropertyType_DATETIME, + "TIME": PropertyType_TIME, + "GEOGRAPHY": PropertyType_GEOGRAPHY, +} + +var PropertyTypeNames = []string { + "UNKNOWN", + "BOOL", + "INT64", + "VID", + "FLOAT", + "DOUBLE", + "STRING", + "FIXED_STRING", + "INT8", + "INT16", + "INT32", + "TIMESTAMP", + "DATE", + "DATETIME", + "TIME", + "GEOGRAPHY", +} + +var PropertyTypeValues = []PropertyType { + PropertyType_UNKNOWN, + PropertyType_BOOL, + PropertyType_INT64, + PropertyType_VID, + PropertyType_FLOAT, + PropertyType_DOUBLE, + PropertyType_STRING, + PropertyType_FIXED_STRING, + PropertyType_INT8, + PropertyType_INT16, + PropertyType_INT32, + PropertyType_TIMESTAMP, + PropertyType_DATE, + PropertyType_DATETIME, + PropertyType_TIME, + PropertyType_GEOGRAPHY, +} + +func (p PropertyType) String() string { + if v, ok := PropertyTypeToName[p]; ok { + return v + } + return "" +} + +func PropertyTypeFromString(s string) (PropertyType, error) { + if v, ok := PropertyTypeToValue[s]; ok { + return v, nil + } + return PropertyType(0), fmt.Errorf("not a valid PropertyType string") +} + +func PropertyTypePtr(v PropertyType) *PropertyType { return &v } + +type IsolationLevel int64 +const ( + IsolationLevel_DEFAULT IsolationLevel = 0 + IsolationLevel_TOSS IsolationLevel = 1 +) + +var IsolationLevelToName = map[IsolationLevel]string { + IsolationLevel_DEFAULT: "DEFAULT", + IsolationLevel_TOSS: "TOSS", +} + +var IsolationLevelToValue = map[string]IsolationLevel { + "DEFAULT": IsolationLevel_DEFAULT, + "TOSS": IsolationLevel_TOSS, +} + +var IsolationLevelNames = []string { + "DEFAULT", + "TOSS", +} + +var IsolationLevelValues = []IsolationLevel { + IsolationLevel_DEFAULT, + IsolationLevel_TOSS, +} + +func (p IsolationLevel) String() string { + if v, ok := IsolationLevelToName[p]; ok { + return v + } + return "" +} + +func IsolationLevelFromString(s string) (IsolationLevel, error) { + if v, ok := IsolationLevelToValue[s]; ok { + return v, nil + } + return IsolationLevel(0), fmt.Errorf("not a valid IsolationLevel string") +} + +func IsolationLevelPtr(v IsolationLevel) *IsolationLevel { return &v } + +type HostStatus int64 +const ( + HostStatus_ONLINE HostStatus = 0 + HostStatus_OFFLINE HostStatus = 1 + HostStatus_UNKNOWN HostStatus = 2 +) + +var HostStatusToName = map[HostStatus]string { + HostStatus_ONLINE: "ONLINE", + HostStatus_OFFLINE: "OFFLINE", + HostStatus_UNKNOWN: "UNKNOWN", +} + +var HostStatusToValue = map[string]HostStatus { + "ONLINE": HostStatus_ONLINE, + "OFFLINE": HostStatus_OFFLINE, + "UNKNOWN": HostStatus_UNKNOWN, +} + +var HostStatusNames = []string { + "ONLINE", + "OFFLINE", + "UNKNOWN", +} + +var HostStatusValues = []HostStatus { + HostStatus_ONLINE, + HostStatus_OFFLINE, + HostStatus_UNKNOWN, +} + +func (p HostStatus) String() string { + if v, ok := HostStatusToName[p]; ok { + return v + } + return "" +} + +func HostStatusFromString(s string) (HostStatus, error) { + if v, ok := HostStatusToValue[s]; ok { + return v, nil + } + return HostStatus(0), fmt.Errorf("not a valid HostStatus string") +} + +func HostStatusPtr(v HostStatus) *HostStatus { return &v } + +type SnapshotStatus int64 +const ( + SnapshotStatus_VALID SnapshotStatus = 0 + SnapshotStatus_INVALID SnapshotStatus = 1 +) + +var SnapshotStatusToName = map[SnapshotStatus]string { + SnapshotStatus_VALID: "VALID", + SnapshotStatus_INVALID: "INVALID", +} + +var SnapshotStatusToValue = map[string]SnapshotStatus { + "VALID": SnapshotStatus_VALID, + "INVALID": SnapshotStatus_INVALID, +} + +var SnapshotStatusNames = []string { + "VALID", + "INVALID", +} + +var SnapshotStatusValues = []SnapshotStatus { + SnapshotStatus_VALID, + SnapshotStatus_INVALID, +} + +func (p SnapshotStatus) String() string { + if v, ok := SnapshotStatusToName[p]; ok { + return v + } + return "" +} + +func SnapshotStatusFromString(s string) (SnapshotStatus, error) { + if v, ok := SnapshotStatusToValue[s]; ok { + return v, nil + } + return SnapshotStatus(0), fmt.Errorf("not a valid SnapshotStatus string") +} + +func SnapshotStatusPtr(v SnapshotStatus) *SnapshotStatus { return &v } + +type AdminJobOp int64 +const ( + AdminJobOp_ADD AdminJobOp = 1 + AdminJobOp_SHOW_All AdminJobOp = 2 + AdminJobOp_SHOW AdminJobOp = 3 + AdminJobOp_STOP AdminJobOp = 4 + AdminJobOp_RECOVER AdminJobOp = 5 +) + +var AdminJobOpToName = map[AdminJobOp]string { + AdminJobOp_ADD: "ADD", + AdminJobOp_SHOW_All: "SHOW_All", + AdminJobOp_SHOW: "SHOW", + AdminJobOp_STOP: "STOP", + AdminJobOp_RECOVER: "RECOVER", +} + +var AdminJobOpToValue = map[string]AdminJobOp { + "ADD": AdminJobOp_ADD, + "SHOW_All": AdminJobOp_SHOW_All, + "SHOW": AdminJobOp_SHOW, + "STOP": AdminJobOp_STOP, + "RECOVER": AdminJobOp_RECOVER, +} + +var AdminJobOpNames = []string { + "ADD", + "SHOW_All", + "SHOW", + "STOP", + "RECOVER", +} + +var AdminJobOpValues = []AdminJobOp { + AdminJobOp_ADD, + AdminJobOp_SHOW_All, + AdminJobOp_SHOW, + AdminJobOp_STOP, + AdminJobOp_RECOVER, +} + +func (p AdminJobOp) String() string { + if v, ok := AdminJobOpToName[p]; ok { + return v + } + return "" +} + +func AdminJobOpFromString(s string) (AdminJobOp, error) { + if v, ok := AdminJobOpToValue[s]; ok { + return v, nil + } + return AdminJobOp(0), fmt.Errorf("not a valid AdminJobOp string") +} + +func AdminJobOpPtr(v AdminJobOp) *AdminJobOp { return &v } + +type AdminCmd int64 +const ( + AdminCmd_COMPACT AdminCmd = 0 + AdminCmd_FLUSH AdminCmd = 1 + AdminCmd_REBUILD_TAG_INDEX AdminCmd = 2 + AdminCmd_REBUILD_EDGE_INDEX AdminCmd = 3 + AdminCmd_REBUILD_FULLTEXT_INDEX AdminCmd = 4 + AdminCmd_STATS AdminCmd = 5 + AdminCmd_DATA_BALANCE AdminCmd = 6 + AdminCmd_DOWNLOAD AdminCmd = 7 + AdminCmd_INGEST AdminCmd = 8 + AdminCmd_UNKNOWN AdminCmd = 99 +) + +var AdminCmdToName = map[AdminCmd]string { + AdminCmd_COMPACT: "COMPACT", + AdminCmd_FLUSH: "FLUSH", + AdminCmd_REBUILD_TAG_INDEX: "REBUILD_TAG_INDEX", + AdminCmd_REBUILD_EDGE_INDEX: "REBUILD_EDGE_INDEX", + AdminCmd_REBUILD_FULLTEXT_INDEX: "REBUILD_FULLTEXT_INDEX", + AdminCmd_STATS: "STATS", + AdminCmd_DATA_BALANCE: "DATA_BALANCE", + AdminCmd_DOWNLOAD: "DOWNLOAD", + AdminCmd_INGEST: "INGEST", + AdminCmd_UNKNOWN: "UNKNOWN", +} + +var AdminCmdToValue = map[string]AdminCmd { + "COMPACT": AdminCmd_COMPACT, + "FLUSH": AdminCmd_FLUSH, + "REBUILD_TAG_INDEX": AdminCmd_REBUILD_TAG_INDEX, + "REBUILD_EDGE_INDEX": AdminCmd_REBUILD_EDGE_INDEX, + "REBUILD_FULLTEXT_INDEX": AdminCmd_REBUILD_FULLTEXT_INDEX, + "STATS": AdminCmd_STATS, + "DATA_BALANCE": AdminCmd_DATA_BALANCE, + "DOWNLOAD": AdminCmd_DOWNLOAD, + "INGEST": AdminCmd_INGEST, + "UNKNOWN": AdminCmd_UNKNOWN, +} + +var AdminCmdNames = []string { + "COMPACT", + "FLUSH", + "REBUILD_TAG_INDEX", + "REBUILD_EDGE_INDEX", + "REBUILD_FULLTEXT_INDEX", + "STATS", + "DATA_BALANCE", + "DOWNLOAD", + "INGEST", + "UNKNOWN", +} + +var AdminCmdValues = []AdminCmd { + AdminCmd_COMPACT, + AdminCmd_FLUSH, + AdminCmd_REBUILD_TAG_INDEX, + AdminCmd_REBUILD_EDGE_INDEX, + AdminCmd_REBUILD_FULLTEXT_INDEX, + AdminCmd_STATS, + AdminCmd_DATA_BALANCE, + AdminCmd_DOWNLOAD, + AdminCmd_INGEST, + AdminCmd_UNKNOWN, +} + +func (p AdminCmd) String() string { + if v, ok := AdminCmdToName[p]; ok { + return v + } + return "" +} + +func AdminCmdFromString(s string) (AdminCmd, error) { + if v, ok := AdminCmdToValue[s]; ok { + return v, nil + } + return AdminCmd(0), fmt.Errorf("not a valid AdminCmd string") +} + +func AdminCmdPtr(v AdminCmd) *AdminCmd { return &v } + +type JobStatus int64 +const ( + JobStatus_QUEUE JobStatus = 1 + JobStatus_RUNNING JobStatus = 2 + JobStatus_FINISHED JobStatus = 3 + JobStatus_FAILED JobStatus = 4 + JobStatus_STOPPED JobStatus = 5 + JobStatus_INVALID JobStatus = 255 +) + +var JobStatusToName = map[JobStatus]string { + JobStatus_QUEUE: "QUEUE", + JobStatus_RUNNING: "RUNNING", + JobStatus_FINISHED: "FINISHED", + JobStatus_FAILED: "FAILED", + JobStatus_STOPPED: "STOPPED", + JobStatus_INVALID: "INVALID", +} + +var JobStatusToValue = map[string]JobStatus { + "QUEUE": JobStatus_QUEUE, + "RUNNING": JobStatus_RUNNING, + "FINISHED": JobStatus_FINISHED, + "FAILED": JobStatus_FAILED, + "STOPPED": JobStatus_STOPPED, + "INVALID": JobStatus_INVALID, +} + +var JobStatusNames = []string { + "QUEUE", + "RUNNING", + "FINISHED", + "FAILED", + "STOPPED", + "INVALID", +} + +var JobStatusValues = []JobStatus { + JobStatus_QUEUE, + JobStatus_RUNNING, + JobStatus_FINISHED, + JobStatus_FAILED, + JobStatus_STOPPED, + JobStatus_INVALID, +} + +func (p JobStatus) String() string { + if v, ok := JobStatusToName[p]; ok { + return v + } + return "" +} + +func JobStatusFromString(s string) (JobStatus, error) { + if v, ok := JobStatusToValue[s]; ok { + return v, nil + } + return JobStatus(0), fmt.Errorf("not a valid JobStatus string") +} + +func JobStatusPtr(v JobStatus) *JobStatus { return &v } + +type ListHostType int64 +const ( + ListHostType_ALLOC ListHostType = 0 + ListHostType_GRAPH ListHostType = 1 + ListHostType_META ListHostType = 2 + ListHostType_STORAGE ListHostType = 3 +) + +var ListHostTypeToName = map[ListHostType]string { + ListHostType_ALLOC: "ALLOC", + ListHostType_GRAPH: "GRAPH", + ListHostType_META: "META", + ListHostType_STORAGE: "STORAGE", +} + +var ListHostTypeToValue = map[string]ListHostType { + "ALLOC": ListHostType_ALLOC, + "GRAPH": ListHostType_GRAPH, + "META": ListHostType_META, + "STORAGE": ListHostType_STORAGE, +} + +var ListHostTypeNames = []string { + "ALLOC", + "GRAPH", + "META", + "STORAGE", +} + +var ListHostTypeValues = []ListHostType { + ListHostType_ALLOC, + ListHostType_GRAPH, + ListHostType_META, + ListHostType_STORAGE, +} + +func (p ListHostType) String() string { + if v, ok := ListHostTypeToName[p]; ok { + return v + } + return "" +} + +func ListHostTypeFromString(s string) (ListHostType, error) { + if v, ok := ListHostTypeToValue[s]; ok { + return v, nil + } + return ListHostType(0), fmt.Errorf("not a valid ListHostType string") +} + +func ListHostTypePtr(v ListHostType) *ListHostType { return &v } + +type HostRole int64 +const ( + HostRole_GRAPH HostRole = 0 + HostRole_META HostRole = 1 + HostRole_STORAGE HostRole = 2 + HostRole_LISTENER HostRole = 3 + HostRole_UNKNOWN HostRole = 4 +) + +var HostRoleToName = map[HostRole]string { + HostRole_GRAPH: "GRAPH", + HostRole_META: "META", + HostRole_STORAGE: "STORAGE", + HostRole_LISTENER: "LISTENER", + HostRole_UNKNOWN: "UNKNOWN", +} + +var HostRoleToValue = map[string]HostRole { + "GRAPH": HostRole_GRAPH, + "META": HostRole_META, + "STORAGE": HostRole_STORAGE, + "LISTENER": HostRole_LISTENER, + "UNKNOWN": HostRole_UNKNOWN, +} + +var HostRoleNames = []string { + "GRAPH", + "META", + "STORAGE", + "LISTENER", + "UNKNOWN", +} + +var HostRoleValues = []HostRole { + HostRole_GRAPH, + HostRole_META, + HostRole_STORAGE, + HostRole_LISTENER, + HostRole_UNKNOWN, +} + +func (p HostRole) String() string { + if v, ok := HostRoleToName[p]; ok { + return v + } + return "" +} + +func HostRoleFromString(s string) (HostRole, error) { + if v, ok := HostRoleToValue[s]; ok { + return v, nil + } + return HostRole(0), fmt.Errorf("not a valid HostRole string") +} + +func HostRolePtr(v HostRole) *HostRole { return &v } + +type TaskResult_ int64 +const ( + TaskResult__SUCCEEDED TaskResult_ = 0 + TaskResult__FAILED TaskResult_ = 1 + TaskResult__IN_PROGRESS TaskResult_ = 2 + TaskResult__INVALID TaskResult_ = 3 +) + +var TaskResult_ToName = map[TaskResult_]string { + TaskResult__SUCCEEDED: "SUCCEEDED", + TaskResult__FAILED: "FAILED", + TaskResult__IN_PROGRESS: "IN_PROGRESS", + TaskResult__INVALID: "INVALID", +} + +var TaskResult_ToValue = map[string]TaskResult_ { + "SUCCEEDED": TaskResult__SUCCEEDED, + "FAILED": TaskResult__FAILED, + "IN_PROGRESS": TaskResult__IN_PROGRESS, + "INVALID": TaskResult__INVALID, +} + +var TaskResult_Names = []string { + "SUCCEEDED", + "FAILED", + "IN_PROGRESS", + "INVALID", +} + +var TaskResult_Values = []TaskResult_ { + TaskResult__SUCCEEDED, + TaskResult__FAILED, + TaskResult__IN_PROGRESS, + TaskResult__INVALID, +} + +func (p TaskResult_) String() string { + if v, ok := TaskResult_ToName[p]; ok { + return v + } + return "" +} + +func TaskResult_FromString(s string) (TaskResult_, error) { + if v, ok := TaskResult_ToValue[s]; ok { + return v, nil + } + return TaskResult_(0), fmt.Errorf("not a valid TaskResult_ string") +} + +func TaskResult_Ptr(v TaskResult_) *TaskResult_ { return &v } + +type ConfigModule int64 +const ( + ConfigModule_UNKNOWN ConfigModule = 0 + ConfigModule_ALL ConfigModule = 1 + ConfigModule_GRAPH ConfigModule = 2 + ConfigModule_META ConfigModule = 3 + ConfigModule_STORAGE ConfigModule = 4 +) + +var ConfigModuleToName = map[ConfigModule]string { + ConfigModule_UNKNOWN: "UNKNOWN", + ConfigModule_ALL: "ALL", + ConfigModule_GRAPH: "GRAPH", + ConfigModule_META: "META", + ConfigModule_STORAGE: "STORAGE", +} + +var ConfigModuleToValue = map[string]ConfigModule { + "UNKNOWN": ConfigModule_UNKNOWN, + "ALL": ConfigModule_ALL, + "GRAPH": ConfigModule_GRAPH, + "META": ConfigModule_META, + "STORAGE": ConfigModule_STORAGE, +} + +var ConfigModuleNames = []string { + "UNKNOWN", + "ALL", + "GRAPH", + "META", + "STORAGE", +} + +var ConfigModuleValues = []ConfigModule { + ConfigModule_UNKNOWN, + ConfigModule_ALL, + ConfigModule_GRAPH, + ConfigModule_META, + ConfigModule_STORAGE, +} + +func (p ConfigModule) String() string { + if v, ok := ConfigModuleToName[p]; ok { + return v + } + return "" +} + +func ConfigModuleFromString(s string) (ConfigModule, error) { + if v, ok := ConfigModuleToValue[s]; ok { + return v, nil + } + return ConfigModule(0), fmt.Errorf("not a valid ConfigModule string") +} + +func ConfigModulePtr(v ConfigModule) *ConfigModule { return &v } + +type ConfigMode int64 +const ( + ConfigMode_IMMUTABLE ConfigMode = 0 + ConfigMode_REBOOT ConfigMode = 1 + ConfigMode_MUTABLE ConfigMode = 2 + ConfigMode_IGNORED ConfigMode = 3 +) + +var ConfigModeToName = map[ConfigMode]string { + ConfigMode_IMMUTABLE: "IMMUTABLE", + ConfigMode_REBOOT: "REBOOT", + ConfigMode_MUTABLE: "MUTABLE", + ConfigMode_IGNORED: "IGNORED", +} + +var ConfigModeToValue = map[string]ConfigMode { + "IMMUTABLE": ConfigMode_IMMUTABLE, + "REBOOT": ConfigMode_REBOOT, + "MUTABLE": ConfigMode_MUTABLE, + "IGNORED": ConfigMode_IGNORED, +} + +var ConfigModeNames = []string { + "IMMUTABLE", + "REBOOT", + "MUTABLE", + "IGNORED", +} + +var ConfigModeValues = []ConfigMode { + ConfigMode_IMMUTABLE, + ConfigMode_REBOOT, + ConfigMode_MUTABLE, + ConfigMode_IGNORED, +} + +func (p ConfigMode) String() string { + if v, ok := ConfigModeToName[p]; ok { + return v + } + return "" +} + +func ConfigModeFromString(s string) (ConfigMode, error) { + if v, ok := ConfigModeToValue[s]; ok { + return v, nil + } + return ConfigMode(0), fmt.Errorf("not a valid ConfigMode string") +} + +func ConfigModePtr(v ConfigMode) *ConfigMode { return &v } + +type ListenerType int64 +const ( + ListenerType_UNKNOWN ListenerType = 0 + ListenerType_ELASTICSEARCH ListenerType = 1 +) + +var ListenerTypeToName = map[ListenerType]string { + ListenerType_UNKNOWN: "UNKNOWN", + ListenerType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var ListenerTypeToValue = map[string]ListenerType { + "UNKNOWN": ListenerType_UNKNOWN, + "ELASTICSEARCH": ListenerType_ELASTICSEARCH, +} + +var ListenerTypeNames = []string { + "UNKNOWN", + "ELASTICSEARCH", +} + +var ListenerTypeValues = []ListenerType { + ListenerType_UNKNOWN, + ListenerType_ELASTICSEARCH, +} + +func (p ListenerType) String() string { + if v, ok := ListenerTypeToName[p]; ok { + return v + } + return "" +} + +func ListenerTypeFromString(s string) (ListenerType, error) { + if v, ok := ListenerTypeToValue[s]; ok { + return v, nil + } + return ListenerType(0), fmt.Errorf("not a valid ListenerType string") +} + +func ListenerTypePtr(v ListenerType) *ListenerType { return &v } + +type FTServiceType int64 +const ( + FTServiceType_ELASTICSEARCH FTServiceType = 1 +) + +var FTServiceTypeToName = map[FTServiceType]string { + FTServiceType_ELASTICSEARCH: "ELASTICSEARCH", +} + +var FTServiceTypeToValue = map[string]FTServiceType { + "ELASTICSEARCH": FTServiceType_ELASTICSEARCH, +} + +var FTServiceTypeNames = []string { + "ELASTICSEARCH", +} + +var FTServiceTypeValues = []FTServiceType { + FTServiceType_ELASTICSEARCH, +} + +func (p FTServiceType) String() string { + if v, ok := FTServiceTypeToName[p]; ok { + return v + } + return "" +} + +func FTServiceTypeFromString(s string) (FTServiceType, error) { + if v, ok := FTServiceTypeToValue[s]; ok { + return v, nil + } + return FTServiceType(0), fmt.Errorf("not a valid FTServiceType string") +} + +func FTServiceTypePtr(v FTServiceType) *FTServiceType { return &v } + +type QueryStatus int64 +const ( + QueryStatus_RUNNING QueryStatus = 1 + QueryStatus_KILLING QueryStatus = 2 +) + +var QueryStatusToName = map[QueryStatus]string { + QueryStatus_RUNNING: "RUNNING", + QueryStatus_KILLING: "KILLING", +} + +var QueryStatusToValue = map[string]QueryStatus { + "RUNNING": QueryStatus_RUNNING, + "KILLING": QueryStatus_KILLING, +} + +var QueryStatusNames = []string { + "RUNNING", + "KILLING", +} + +var QueryStatusValues = []QueryStatus { + QueryStatus_RUNNING, + QueryStatus_KILLING, +} + +func (p QueryStatus) String() string { + if v, ok := QueryStatusToName[p]; ok { + return v + } + return "" +} + +func QueryStatusFromString(s string) (QueryStatus, error) { + if v, ok := QueryStatusToValue[s]; ok { + return v, nil + } + return QueryStatus(0), fmt.Errorf("not a valid QueryStatus string") +} + +func QueryStatusPtr(v QueryStatus) *QueryStatus { return &v } + +type SchemaVer = int64 + +func SchemaVerPtr(v SchemaVer) *SchemaVer { return &v } + +type ClusterID = int64 + +func ClusterIDPtr(v ClusterID) *ClusterID { return &v } + +// Attributes: +// - SpaceID +// - TagID +// - EdgeType +// - IndexID +// - ClusterID +type ID struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + TagID *nebula0.TagID `thrift:"tag_id,2" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula0.EdgeType `thrift:"edge_type,3" db:"edge_type" json:"edge_type,omitempty"` + IndexID *nebula0.IndexID `thrift:"index_id,4" db:"index_id" json:"index_id,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,5" db:"cluster_id" json:"cluster_id,omitempty"` +} + +func NewID() *ID { + return &ID{} +} + +var ID_SpaceID_DEFAULT nebula0.GraphSpaceID +func (p *ID) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return ID_SpaceID_DEFAULT + } +return *p.SpaceID +} +var ID_TagID_DEFAULT nebula0.TagID +func (p *ID) GetTagID() nebula0.TagID { + if !p.IsSetTagID() { + return ID_TagID_DEFAULT + } +return *p.TagID +} +var ID_EdgeType_DEFAULT nebula0.EdgeType +func (p *ID) GetEdgeType() nebula0.EdgeType { + if !p.IsSetEdgeType() { + return ID_EdgeType_DEFAULT + } +return *p.EdgeType +} +var ID_IndexID_DEFAULT nebula0.IndexID +func (p *ID) GetIndexID() nebula0.IndexID { + if !p.IsSetIndexID() { + return ID_IndexID_DEFAULT + } +return *p.IndexID +} +var ID_ClusterID_DEFAULT ClusterID +func (p *ID) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return ID_ClusterID_DEFAULT + } +return *p.ClusterID +} +func (p *ID) CountSetFieldsID() int { + count := 0 + if (p.IsSetSpaceID()) { + count++ + } + if (p.IsSetTagID()) { + count++ + } + if (p.IsSetEdgeType()) { + count++ + } + if (p.IsSetIndexID()) { + count++ + } + if (p.IsSetClusterID()) { + count++ + } + return count + +} + +func (p *ID) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *ID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *ID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *ID) IsSetIndexID() bool { + return p != nil && p.IndexID != nil +} + +func (p *ID) IsSetClusterID() bool { + return p != nil && p.ClusterID != nil +} + +func (p *ID) 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 + } + 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 *ID) 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 *ID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *ID) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *ID) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = &temp +} + return nil +} + +func (p *ID) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = &temp +} + return nil +} + +func (p *ID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("ID"); 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 *ID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *ID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_id: ", p), err) } + } + return err +} + +func (p *ID) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_type: ", p), err) } + } + return err +} + +func (p *ID) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetIndexID() { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:index_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:index_id: ", p), err) } + } + return err +} + +func (p *ID) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cluster_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_id: ", p), err) } + } + return err +} + +func (p *ID) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + var indexIDVal string + if p.IndexID == nil { + indexIDVal = "" + } else { + indexIDVal = fmt.Sprintf("%v", *p.IndexID) + } + var clusterIDVal string + if p.ClusterID == nil { + clusterIDVal = "" + } else { + clusterIDVal = fmt.Sprintf("%v", *p.ClusterID) + } + return fmt.Sprintf("ID({SpaceID:%s TagID:%s EdgeType:%s IndexID:%s ClusterID:%s})", spaceIDVal, tagIDVal, edgeTypeVal, indexIDVal, clusterIDVal) +} + +// Attributes: +// - Type +// - TypeLength +// - GeoShape +type ColumnTypeDef struct { + Type PropertyType `thrift:"type,1,required" db:"type" json:"type"` + TypeLength int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` + GeoShape *GeoShape `thrift:"geo_shape,3" db:"geo_shape" json:"geo_shape,omitempty"` +} + +func NewColumnTypeDef() *ColumnTypeDef { + return &ColumnTypeDef{} +} + + +func (p *ColumnTypeDef) GetType() PropertyType { + return p.Type +} +var ColumnTypeDef_TypeLength_DEFAULT int16 = 0 + +func (p *ColumnTypeDef) GetTypeLength() int16 { + return p.TypeLength +} +var ColumnTypeDef_GeoShape_DEFAULT GeoShape +func (p *ColumnTypeDef) GetGeoShape() GeoShape { + if !p.IsSetGeoShape() { + return ColumnTypeDef_GeoShape_DEFAULT + } +return *p.GeoShape +} +func (p *ColumnTypeDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != ColumnTypeDef_TypeLength_DEFAULT +} + +func (p *ColumnTypeDef) IsSetGeoShape() bool { + return p != nil && p.GeoShape != nil +} + +func (p *ColumnTypeDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType 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 + } + issetType = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetType{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnTypeDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := PropertyType(v) + p.Type = temp +} + return nil +} + +func (p *ColumnTypeDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = v +} + return nil +} + +func (p *ColumnTypeDef) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := GeoShape(v) + p.GeoShape = &temp +} + return nil +} + +func (p *ColumnTypeDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnTypeDef"); 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 *ColumnTypeDef) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ColumnTypeDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) } + if err := oprot.WriteI16(int16(p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *ColumnTypeDef) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetGeoShape() { + if err := oprot.WriteFieldBegin("geo_shape", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:geo_shape: ", p), err) } + if err := oprot.WriteI32(int32(*p.GeoShape)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.geo_shape (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:geo_shape: ", p), err) } + } + return err +} + +func (p *ColumnTypeDef) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + typeLengthVal := fmt.Sprintf("%v", p.TypeLength) + var geoShapeVal string + if p.GeoShape == nil { + geoShapeVal = "" + } else { + geoShapeVal = fmt.Sprintf("%v", *p.GeoShape) + } + return fmt.Sprintf("ColumnTypeDef({Type:%s TypeLength:%s GeoShape:%s})", typeVal, typeLengthVal, geoShapeVal) +} + +// Attributes: +// - Name +// - Type +// - DefaultValue +// - Nullable +// - Comment +type ColumnDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Type *ColumnTypeDef `thrift:"type,2,required" db:"type" json:"type"` + DefaultValue []byte `thrift:"default_value,3" db:"default_value" json:"default_value,omitempty"` + Nullable bool `thrift:"nullable,4" db:"nullable" json:"nullable,omitempty"` + Comment []byte `thrift:"comment,5" db:"comment" json:"comment,omitempty"` +} + +func NewColumnDef() *ColumnDef { + return &ColumnDef{ + Type: NewColumnTypeDef(), + } +} + + +func (p *ColumnDef) GetName() []byte { + return p.Name +} +var ColumnDef_Type_DEFAULT *ColumnTypeDef +func (p *ColumnDef) GetType() *ColumnTypeDef { + if !p.IsSetType() { + return ColumnDef_Type_DEFAULT + } +return p.Type +} +var ColumnDef_DefaultValue_DEFAULT []byte + +func (p *ColumnDef) GetDefaultValue() []byte { + return p.DefaultValue +} +var ColumnDef_Nullable_DEFAULT bool = false + +func (p *ColumnDef) GetNullable() bool { + return p.Nullable +} +var ColumnDef_Comment_DEFAULT []byte + +func (p *ColumnDef) GetComment() []byte { + return p.Comment +} +func (p *ColumnDef) IsSetType() bool { + return p != nil && p.Type != nil +} + +func (p *ColumnDef) IsSetDefaultValue() bool { + return p != nil && p.DefaultValue != nil +} + +func (p *ColumnDef) IsSetNullable() bool { + return p != nil && p.Nullable != ColumnDef_Nullable_DEFAULT +} + +func (p *ColumnDef) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *ColumnDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetType 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetType = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(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) + } + if !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetType{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ColumnDef) ReadField2(iprot thrift.Protocol) error { + p.Type = NewColumnTypeDef() + if err := p.Type.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err) + } + return nil +} + +func (p *ColumnDef) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.DefaultValue = v +} + return nil +} + +func (p *ColumnDef) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Nullable = v +} + return nil +} + +func (p *ColumnDef) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ColumnDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ColumnDef"); 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 *ColumnDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *ColumnDef) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := p.Type.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *ColumnDef) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetDefaultValue() { + if err := oprot.WriteFieldBegin("default_value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:default_value: ", p), err) } + if err := oprot.WriteBinary(p.DefaultValue); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.default_value (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:default_value: ", p), err) } + } + return err +} + +func (p *ColumnDef) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNullable() { + if err := oprot.WriteFieldBegin("nullable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:nullable: ", p), err) } + if err := oprot.WriteBool(bool(p.Nullable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullable (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:nullable: ", p), err) } + } + return err +} + +func (p *ColumnDef) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:comment: ", p), err) } + } + return err +} + +func (p *ColumnDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeVal string + if p.Type == nil { + typeVal = "" + } else { + typeVal = fmt.Sprintf("%v", p.Type) + } + defaultValueVal := fmt.Sprintf("%v", p.DefaultValue) + nullableVal := fmt.Sprintf("%v", p.Nullable) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("ColumnDef({Name:%s Type:%s DefaultValue:%s Nullable:%s Comment:%s})", nameVal, typeVal, defaultValueVal, nullableVal, commentVal) +} + +// Attributes: +// - TtlDuration +// - TtlCol +// - Comment +type SchemaProp struct { + TtlDuration *int64 `thrift:"ttl_duration,1" db:"ttl_duration" json:"ttl_duration,omitempty"` + TtlCol []byte `thrift:"ttl_col,2" db:"ttl_col" json:"ttl_col,omitempty"` + Comment []byte `thrift:"comment,3" db:"comment" json:"comment,omitempty"` +} + +func NewSchemaProp() *SchemaProp { + return &SchemaProp{} +} + +var SchemaProp_TtlDuration_DEFAULT int64 +func (p *SchemaProp) GetTtlDuration() int64 { + if !p.IsSetTtlDuration() { + return SchemaProp_TtlDuration_DEFAULT + } +return *p.TtlDuration +} +var SchemaProp_TtlCol_DEFAULT []byte + +func (p *SchemaProp) GetTtlCol() []byte { + return p.TtlCol +} +var SchemaProp_Comment_DEFAULT []byte + +func (p *SchemaProp) GetComment() []byte { + return p.Comment +} +func (p *SchemaProp) IsSetTtlDuration() bool { + return p != nil && p.TtlDuration != nil +} + +func (p *SchemaProp) IsSetTtlCol() bool { + return p != nil && p.TtlCol != nil +} + +func (p *SchemaProp) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SchemaProp) 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 *SchemaProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TtlDuration = &v +} + return nil +} + +func (p *SchemaProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TtlCol = v +} + return nil +} + +func (p *SchemaProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *SchemaProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SchemaProp"); 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 *SchemaProp) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTtlDuration() { + if err := oprot.WriteFieldBegin("ttl_duration", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ttl_duration: ", p), err) } + if err := oprot.WriteI64(int64(*p.TtlDuration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_duration (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ttl_duration: ", p), err) } + } + return err +} + +func (p *SchemaProp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTtlCol() { + if err := oprot.WriteFieldBegin("ttl_col", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_col: ", p), err) } + if err := oprot.WriteBinary(p.TtlCol); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_col (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_col: ", p), err) } + } + return err +} + +func (p *SchemaProp) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:comment: ", p), err) } + } + return err +} + +func (p *SchemaProp) String() string { + if p == nil { + return "" + } + + var ttlDurationVal string + if p.TtlDuration == nil { + ttlDurationVal = "" + } else { + ttlDurationVal = fmt.Sprintf("%v", *p.TtlDuration) + } + ttlColVal := fmt.Sprintf("%v", p.TtlCol) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SchemaProp({TtlDuration:%s TtlCol:%s Comment:%s})", ttlDurationVal, ttlColVal, commentVal) +} + +// Attributes: +// - Columns +// - SchemaProp +type Schema struct { + Columns []*ColumnDef `thrift:"columns,1" db:"columns" json:"columns"` + SchemaProp *SchemaProp `thrift:"schema_prop,2" db:"schema_prop" json:"schema_prop"` +} + +func NewSchema() *Schema { + return &Schema{ + SchemaProp: NewSchemaProp(), + } +} + + +func (p *Schema) GetColumns() []*ColumnDef { + return p.Columns +} +var Schema_SchemaProp_DEFAULT *SchemaProp +func (p *Schema) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return Schema_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *Schema) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *Schema) 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 *Schema) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Columns = tSlice + for i := 0; i < size; i ++ { + _elem1 := NewColumnDef() + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Columns = append(p.Columns, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Schema) ReadField2(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *Schema) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Schema"); 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 *Schema) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } + return err +} + +func (p *Schema) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_prop: ", p), err) } + return err +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + + columnsVal := fmt.Sprintf("%v", p.Columns) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("Schema({Columns:%s SchemaProp:%s})", columnsVal, schemaPropVal) +} + +// Attributes: +// - Id +// - Name +type IdName struct { + Id *ID `thrift:"id,1" db:"id" json:"id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewIdName() *IdName { + return &IdName{} +} + +var IdName_Id_DEFAULT *ID +func (p *IdName) GetId() *ID { + if !p.IsSetId() { + return IdName_Id_DEFAULT + } +return p.Id +} + +func (p *IdName) GetName() []byte { + return p.Name +} +func (p *IdName) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *IdName) 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 *IdName) ReadField1(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *IdName) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IdName) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IdName"); 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 *IdName) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *IdName) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *IdName) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("IdName({Id:%s Name:%s})", idVal, nameVal) +} + +// Attributes: +// - SpaceName +// - PartitionNum +// - ReplicaFactor +// - CharsetName +// - CollateName +// - VidType +// - GroupName +// - IsolationLevel +// - Comment +type SpaceDesc struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + PartitionNum int32 `thrift:"partition_num,2" db:"partition_num" json:"partition_num"` + ReplicaFactor int32 `thrift:"replica_factor,3" db:"replica_factor" json:"replica_factor"` + CharsetName []byte `thrift:"charset_name,4" db:"charset_name" json:"charset_name"` + CollateName []byte `thrift:"collate_name,5" db:"collate_name" json:"collate_name"` + VidType *ColumnTypeDef `thrift:"vid_type,6" db:"vid_type" json:"vid_type"` + GroupName []byte `thrift:"group_name,7" db:"group_name" json:"group_name,omitempty"` + IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` + Comment []byte `thrift:"comment,9" db:"comment" json:"comment,omitempty"` +} + +func NewSpaceDesc() *SpaceDesc { + return &SpaceDesc{ + VidType: NewColumnTypeDef(), + } +} + + +func (p *SpaceDesc) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *SpaceDesc) GetPartitionNum() int32 { + return p.PartitionNum +} + +func (p *SpaceDesc) GetReplicaFactor() int32 { + return p.ReplicaFactor +} + +func (p *SpaceDesc) GetCharsetName() []byte { + return p.CharsetName +} + +func (p *SpaceDesc) GetCollateName() []byte { + return p.CollateName +} +var SpaceDesc_VidType_DEFAULT *ColumnTypeDef = &ColumnTypeDef{ + Type: 7, + TypeLength: const_lit_vid_type_type_length, +} +func (p *SpaceDesc) GetVidType() *ColumnTypeDef { + if !p.IsSetVidType() { + return SpaceDesc_VidType_DEFAULT + } +return p.VidType +} +var SpaceDesc_GroupName_DEFAULT []byte + +func (p *SpaceDesc) GetGroupName() []byte { + return p.GroupName +} +var SpaceDesc_IsolationLevel_DEFAULT IsolationLevel +func (p *SpaceDesc) GetIsolationLevel() IsolationLevel { + if !p.IsSetIsolationLevel() { + return SpaceDesc_IsolationLevel_DEFAULT + } +return *p.IsolationLevel +} +var SpaceDesc_Comment_DEFAULT []byte + +func (p *SpaceDesc) GetComment() []byte { + return p.Comment +} +func (p *SpaceDesc) IsSetVidType() bool { + return p != nil && p.VidType != nil +} + +func (p *SpaceDesc) IsSetGroupName() bool { + return p != nil && p.GroupName != nil +} + +func (p *SpaceDesc) IsSetIsolationLevel() bool { + return p != nil && p.IsolationLevel != nil +} + +func (p *SpaceDesc) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *SpaceDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *SpaceDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.PartitionNum = v +} + return nil +} + +func (p *SpaceDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReplicaFactor = v +} + return nil +} + +func (p *SpaceDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.CharsetName = v +} + return nil +} + +func (p *SpaceDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.CollateName = v +} + return nil +} + +func (p *SpaceDesc) ReadField6(iprot thrift.Protocol) error { + p.VidType = NewColumnTypeDef() + if err := p.VidType.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VidType), err) + } + return nil +} + +func (p *SpaceDesc) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *SpaceDesc) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + temp := IsolationLevel(v) + p.IsolationLevel = &temp +} + return nil +} + +func (p *SpaceDesc) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *SpaceDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SpaceDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_num", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:partition_num: ", p), err) } + if err := oprot.WriteI32(int32(p.PartitionNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_num (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_num: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("replica_factor", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:replica_factor: ", p), err) } + if err := oprot.WriteI32(int32(p.ReplicaFactor)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_factor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:replica_factor: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("charset_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:charset_name: ", p), err) } + if err := oprot.WriteBinary(p.CharsetName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.charset_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:charset_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("collate_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:collate_name: ", p), err) } + if err := oprot.WriteBinary(p.CollateName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.collate_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:collate_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid_type", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vid_type: ", p), err) } + if err := p.VidType.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VidType), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vid_type: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetGroupName() { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:group_name: ", p), err) } + } + return err +} + +func (p *SpaceDesc) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetIsolationLevel() { + if err := oprot.WriteFieldBegin("isolation_level", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:isolation_level: ", p), err) } + if err := oprot.WriteI32(int32(*p.IsolationLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isolation_level (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:isolation_level: ", p), err) } + } + return err +} + +func (p *SpaceDesc) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:comment: ", p), err) } + } + return err +} + +func (p *SpaceDesc) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + partitionNumVal := fmt.Sprintf("%v", p.PartitionNum) + replicaFactorVal := fmt.Sprintf("%v", p.ReplicaFactor) + charsetNameVal := fmt.Sprintf("%v", p.CharsetName) + collateNameVal := fmt.Sprintf("%v", p.CollateName) + var vidTypeVal string + if p.VidType == nil { + vidTypeVal = "" + } else { + vidTypeVal = fmt.Sprintf("%v", p.VidType) + } + groupNameVal := fmt.Sprintf("%v", p.GroupName) + var isolationLevelVal string + if p.IsolationLevel == nil { + isolationLevelVal = "" + } else { + isolationLevelVal = fmt.Sprintf("%v", *p.IsolationLevel) + } + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("SpaceDesc({SpaceName:%s PartitionNum:%s ReplicaFactor:%s CharsetName:%s CollateName:%s VidType:%s GroupName:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, groupNameVal, isolationLevelVal, commentVal) +} + +// Attributes: +// - SpaceID +// - Properties +type SpaceItem struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Properties *SpaceDesc `thrift:"properties,2" db:"properties" json:"properties"` +} + +func NewSpaceItem() *SpaceItem { + return &SpaceItem{ + Properties: NewSpaceDesc(), + } +} + + +func (p *SpaceItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var SpaceItem_Properties_DEFAULT *SpaceDesc +func (p *SpaceItem) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return SpaceItem_Properties_DEFAULT + } +return p.Properties +} +func (p *SpaceItem) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *SpaceItem) 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 *SpaceItem) 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 *SpaceItem) ReadField2(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *SpaceItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceItem"); 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 *SpaceItem) 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 *SpaceItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:properties: ", p), err) } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) } + return err +} + +func (p *SpaceItem) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + return fmt.Sprintf("SpaceItem({SpaceID:%s Properties:%s})", spaceIDVal, propertiesVal) +} + +// Attributes: +// - TagID +// - TagName +// - Version +// - Schema +type TagItem struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewTagItem() *TagItem { + return &TagItem{ + Schema: NewSchema(), + } +} + + +func (p *TagItem) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *TagItem) GetTagName() []byte { + return p.TagName +} + +func (p *TagItem) GetVersion() SchemaVer { + return p.Version +} +var TagItem_Schema_DEFAULT *Schema +func (p *TagItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return TagItem_Schema_DEFAULT + } +return p.Schema +} +func (p *TagItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *TagItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TagItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *TagItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *TagItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *TagItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TagItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TagItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TagItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *TagItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *TagItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *TagItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *TagItem) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("TagItem({TagID:%s TagName:%s Version:%s Schema:%s})", tagIDVal, tagNameVal, versionVal, schemaVal) +} + +// Attributes: +// - Op +// - Schema +type AlterSchemaItem struct { + Op AlterSchemaOp `thrift:"op,1" db:"op" json:"op"` + Schema *Schema `thrift:"schema,2" db:"schema" json:"schema"` +} + +func NewAlterSchemaItem() *AlterSchemaItem { + return &AlterSchemaItem{ + Schema: NewSchema(), + } +} + + +func (p *AlterSchemaItem) GetOp() AlterSchemaOp { + return p.Op +} +var AlterSchemaItem_Schema_DEFAULT *Schema +func (p *AlterSchemaItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return AlterSchemaItem_Schema_DEFAULT + } +return p.Schema +} +func (p *AlterSchemaItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *AlterSchemaItem) 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 *AlterSchemaItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := AlterSchemaOp(v) + p.Op = temp +} + return nil +} + +func (p *AlterSchemaItem) ReadField2(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *AlterSchemaItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterSchemaItem"); 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 *AlterSchemaItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) } + return err +} + +func (p *AlterSchemaItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } + return err +} + +func (p *AlterSchemaItem) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("AlterSchemaItem({Op:%s Schema:%s})", opVal, schemaVal) +} + +// Attributes: +// - EdgeType +// - EdgeName +// - Version +// - Schema +type EdgeItem struct { + EdgeType nebula0.EdgeType `thrift:"edge_type,1" db:"edge_type" json:"edge_type"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` + Schema *Schema `thrift:"schema,4" db:"schema" json:"schema"` +} + +func NewEdgeItem() *EdgeItem { + return &EdgeItem{ + Schema: NewSchema(), + } +} + + +func (p *EdgeItem) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeItem) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *EdgeItem) GetVersion() SchemaVer { + return p.Version +} +var EdgeItem_Schema_DEFAULT *Schema +func (p *EdgeItem) GetSchema() *Schema { + if !p.IsSetSchema() { + return EdgeItem_Schema_DEFAULT + } +return p.Schema +} +func (p *EdgeItem) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *EdgeItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *EdgeItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *EdgeItem) ReadField4(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *EdgeItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_type: ", p), err) } + return err +} + +func (p *EdgeItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *EdgeItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *EdgeItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *EdgeItem) String() string { + if p == nil { + return "" + } + + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("EdgeItem({EdgeType:%s EdgeName:%s Version:%s Schema:%s})", edgeTypeVal, edgeNameVal, versionVal, schemaVal) +} + +// Attributes: +// - IndexID +// - IndexName +// - SchemaID +// - SchemaName +// - Fields +// - Comment +type IndexItem struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + SchemaID *nebula0.SchemaID `thrift:"schema_id,3" db:"schema_id" json:"schema_id"` + SchemaName []byte `thrift:"schema_name,4" db:"schema_name" json:"schema_name"` + Fields []*ColumnDef `thrift:"fields,5" db:"fields" json:"fields"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewIndexItem() *IndexItem { + return &IndexItem{} +} + + +func (p *IndexItem) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexItem) GetIndexName() []byte { + return p.IndexName +} +var IndexItem_SchemaID_DEFAULT *nebula0.SchemaID +func (p *IndexItem) GetSchemaID() *nebula0.SchemaID { + if !p.IsSetSchemaID() { + return IndexItem_SchemaID_DEFAULT + } +return p.SchemaID +} + +func (p *IndexItem) GetSchemaName() []byte { + return p.SchemaName +} + +func (p *IndexItem) GetFields() []*ColumnDef { + return p.Fields +} +var IndexItem_Comment_DEFAULT []byte + +func (p *IndexItem) GetComment() []byte { + return p.Comment +} +func (p *IndexItem) IsSetSchemaID() bool { + return p != nil && p.SchemaID != nil +} + +func (p *IndexItem) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *IndexItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *IndexItem) ReadField3(iprot thrift.Protocol) error { + p.SchemaID = nebula0.NewSchemaID() + if err := p.SchemaID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SchemaName = v +} + return nil +} + +func (p *IndexItem) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ColumnDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewColumnDef() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.Fields = append(p.Fields, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *IndexItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema_id: ", p), err) } + if err := p.SchemaID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_name: ", p), err) } + if err := oprot.WriteBinary(p.SchemaName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schema_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err) } + return err +} + +func (p *IndexItem) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *IndexItem) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + var schemaIDVal string + if p.SchemaID == nil { + schemaIDVal = "" + } else { + schemaIDVal = fmt.Sprintf("%v", p.SchemaID) + } + schemaNameVal := fmt.Sprintf("%v", p.SchemaName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal) +} + +// Attributes: +// - HostAddr +// - Status +// - LeaderParts +// - AllParts +// - Role +// - GitInfoSha +// - ZoneName +// - Version +type HostItem struct { + HostAddr *nebula0.HostAddr `thrift:"hostAddr,1" db:"hostAddr" json:"hostAddr"` + Status HostStatus `thrift:"status,2" db:"status" json:"status"` + LeaderParts map[string][]nebula0.PartitionID `thrift:"leader_parts,3" db:"leader_parts" json:"leader_parts"` + AllParts map[string][]nebula0.PartitionID `thrift:"all_parts,4" db:"all_parts" json:"all_parts"` + Role HostRole `thrift:"role,5" db:"role" json:"role"` + GitInfoSha []byte `thrift:"git_info_sha,6" db:"git_info_sha" json:"git_info_sha"` + ZoneName []byte `thrift:"zone_name,7" db:"zone_name" json:"zone_name,omitempty"` + Version []byte `thrift:"version,8" db:"version" json:"version,omitempty"` +} + +func NewHostItem() *HostItem { + return &HostItem{ + HostAddr: nebula0.NewHostAddr(), + } +} + +var HostItem_HostAddr_DEFAULT *nebula0.HostAddr +func (p *HostItem) GetHostAddr() *nebula0.HostAddr { + if !p.IsSetHostAddr() { + return HostItem_HostAddr_DEFAULT + } +return p.HostAddr +} + +func (p *HostItem) GetStatus() HostStatus { + return p.Status +} + +func (p *HostItem) GetLeaderParts() map[string][]nebula0.PartitionID { + return p.LeaderParts +} + +func (p *HostItem) GetAllParts() map[string][]nebula0.PartitionID { + return p.AllParts +} + +func (p *HostItem) GetRole() HostRole { + return p.Role +} + +func (p *HostItem) GetGitInfoSha() []byte { + return p.GitInfoSha +} +var HostItem_ZoneName_DEFAULT []byte + +func (p *HostItem) GetZoneName() []byte { + return p.ZoneName +} +var HostItem_Version_DEFAULT []byte + +func (p *HostItem) GetVersion() []byte { + return p.Version +} +func (p *HostItem) IsSetHostAddr() bool { + return p != nil && p.HostAddr != nil +} + +func (p *HostItem) IsSetZoneName() bool { + return p != nil && p.ZoneName != nil +} + +func (p *HostItem) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HostItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostItem) ReadField1(iprot thrift.Protocol) error { + p.HostAddr = nebula0.NewHostAddr() + if err := p.HostAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostAddr), err) + } + return nil +} + +func (p *HostItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *HostItem) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key3 = v +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val4 := tSlice + for i := 0; i < size; i ++ { +var _elem5 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem5 = temp +} + _val4 = append(_val4, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula0.PartitionID, size) + p.AllParts = tMap + for i := 0; i < size; i ++ { +var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key6 = v +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val7 := tSlice + for i := 0; i < size; i ++ { +var _elem8 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem8 = temp +} + _val7 = append(_val7, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.AllParts[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HostItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HostItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *HostItem) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *HostItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hostAddr", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hostAddr: ", p), err) } + if err := p.HostAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostAddr: ", p), err) } + return err +} + +func (p *HostItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *HostItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:leader_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("all_parts", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:all_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.AllParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.AllParts { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 4:all_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:role: ", p), err) } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:role: ", p), err) } + return err +} + +func (p *HostItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:git_info_sha: ", p), err) } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:git_info_sha: ", p), err) } + return err +} + +func (p *HostItem) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetZoneName() { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_name: ", p), err) } + } + return err +} + +func (p *HostItem) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:version: ", p), err) } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:version: ", p), err) } + } + return err +} + +func (p *HostItem) String() string { + if p == nil { + return "" + } + + var hostAddrVal string + if p.HostAddr == nil { + hostAddrVal = "" + } else { + hostAddrVal = fmt.Sprintf("%v", p.HostAddr) + } + statusVal := fmt.Sprintf("%v", p.Status) + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + allPartsVal := fmt.Sprintf("%v", p.AllParts) + roleVal := fmt.Sprintf("%v", p.Role) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HostItem({HostAddr:%s Status:%s LeaderParts:%s AllParts:%s Role:%s GitInfoSha:%s ZoneName:%s Version:%s})", hostAddrVal, statusVal, leaderPartsVal, allPartsVal, roleVal, gitInfoShaVal, zoneNameVal, versionVal) +} + +// Attributes: +// - Account +// - IsLock +// - MaxQueriesPerHour +// - MaxUpdatesPerHour +// - MaxConnectionsPerHour +// - MaxUserConnections +type UserItem struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IsLock bool `thrift:"is_lock,2" db:"is_lock" json:"is_lock"` + MaxQueriesPerHour int32 `thrift:"max_queries_per_hour,3" db:"max_queries_per_hour" json:"max_queries_per_hour"` + MaxUpdatesPerHour int32 `thrift:"max_updates_per_hour,4" db:"max_updates_per_hour" json:"max_updates_per_hour"` + MaxConnectionsPerHour int32 `thrift:"max_connections_per_hour,5" db:"max_connections_per_hour" json:"max_connections_per_hour"` + MaxUserConnections int32 `thrift:"max_user_connections,6" db:"max_user_connections" json:"max_user_connections"` +} + +func NewUserItem() *UserItem { + return &UserItem{} +} + + +func (p *UserItem) GetAccount() []byte { + return p.Account +} + +func (p *UserItem) GetIsLock() bool { + return p.IsLock +} + +func (p *UserItem) GetMaxQueriesPerHour() int32 { + return p.MaxQueriesPerHour +} + +func (p *UserItem) GetMaxUpdatesPerHour() int32 { + return p.MaxUpdatesPerHour +} + +func (p *UserItem) GetMaxConnectionsPerHour() int32 { + return p.MaxConnectionsPerHour +} + +func (p *UserItem) GetMaxUserConnections() int32 { + return p.MaxUserConnections +} +func (p *UserItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UserItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *UserItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsLock = v +} + return nil +} + +func (p *UserItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.MaxQueriesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.MaxUpdatesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.MaxConnectionsPerHour = v +} + return nil +} + +func (p *UserItem) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.MaxUserConnections = v +} + return nil +} + +func (p *UserItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UserItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UserItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *UserItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("is_lock", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:is_lock: ", p), err) } + if err := oprot.WriteBool(bool(p.IsLock)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_lock (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_lock: ", p), err) } + return err +} + +func (p *UserItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_queries_per_hour", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_queries_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxQueriesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_queries_per_hour (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_queries_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_updates_per_hour", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_updates_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxUpdatesPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_updates_per_hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_updates_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_connections_per_hour", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:max_connections_per_hour: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxConnectionsPerHour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_connections_per_hour (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:max_connections_per_hour: ", p), err) } + return err +} + +func (p *UserItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("max_user_connections", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:max_user_connections: ", p), err) } + if err := oprot.WriteI32(int32(p.MaxUserConnections)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_user_connections (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_user_connections: ", p), err) } + return err +} + +func (p *UserItem) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + isLockVal := fmt.Sprintf("%v", p.IsLock) + maxQueriesPerHourVal := fmt.Sprintf("%v", p.MaxQueriesPerHour) + maxUpdatesPerHourVal := fmt.Sprintf("%v", p.MaxUpdatesPerHour) + maxConnectionsPerHourVal := fmt.Sprintf("%v", p.MaxConnectionsPerHour) + maxUserConnectionsVal := fmt.Sprintf("%v", p.MaxUserConnections) + return fmt.Sprintf("UserItem({Account:%s IsLock:%s MaxQueriesPerHour:%s MaxUpdatesPerHour:%s MaxConnectionsPerHour:%s MaxUserConnections:%s})", accountVal, isLockVal, maxQueriesPerHourVal, maxUpdatesPerHourVal, maxConnectionsPerHourVal, maxUserConnectionsVal) +} + +// Attributes: +// - UserID +// - SpaceID +// - RoleType +type RoleItem struct { + UserID []byte `thrift:"user_id,1" db:"user_id" json:"user_id"` + SpaceID nebula0.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` + RoleType RoleType `thrift:"role_type,3" db:"role_type" json:"role_type"` +} + +func NewRoleItem() *RoleItem { + return &RoleItem{} +} + + +func (p *RoleItem) GetUserID() []byte { + return p.UserID +} + +func (p *RoleItem) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RoleItem) GetRoleType() RoleType { + return p.RoleType +} +func (p *RoleItem) 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 *RoleItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.UserID = v +} + return nil +} + +func (p *RoleItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RoleItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := RoleType(v) + p.RoleType = temp +} + return nil +} + +func (p *RoleItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RoleItem"); 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 *RoleItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user_id: ", p), err) } + if err := oprot.WriteBinary(p.UserID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role_type: ", p), err) } + if err := oprot.WriteI32(int32(p.RoleType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role_type: ", p), err) } + return err +} + +func (p *RoleItem) String() string { + if p == nil { + return "" + } + + userIDVal := fmt.Sprintf("%v", p.UserID) + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + roleTypeVal := fmt.Sprintf("%v", p.RoleType) + return fmt.Sprintf("RoleItem({UserID:%s SpaceID:%s RoleType:%s})", userIDVal, spaceIDVal, roleTypeVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +type ExecResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id *ID `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` +} + +func NewExecResp() *ExecResp { + return &ExecResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ExecResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ExecResp_Id_DEFAULT *ID +func (p *ExecResp) GetId() *ID { + if !p.IsSetId() { + return ExecResp_Id_DEFAULT + } +return p.Id +} +var ExecResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ExecResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ExecResp_Leader_DEFAULT + } +return p.Leader +} +func (p *ExecResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *ExecResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ExecResp) 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 *ExecResp) 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 *ExecResp) ReadField2(iprot thrift.Protocol) error { + p.Id = NewID() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *ExecResp) ReadField3(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 *ExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResp"); 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 *ExecResp) 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 *ExecResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *ExecResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + return err +} + +func (p *ExecResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("ExecResp({Code:%s Id:%s Leader:%s})", codeVal, idVal, leaderVal) +} + +// Attributes: +// - Op +// - Cmd +// - Paras +type AdminJobReq struct { + Op AdminJobOp `thrift:"op,1" db:"op" json:"op"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` +} + +func NewAdminJobReq() *AdminJobReq { + return &AdminJobReq{} +} + + +func (p *AdminJobReq) GetOp() AdminJobOp { + return p.Op +} + +func (p *AdminJobReq) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *AdminJobReq) GetParas() [][]byte { + return p.Paras +} +func (p *AdminJobReq) 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 *AdminJobReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := AdminJobOp(v) + p.Op = temp +} + return nil +} + +func (p *AdminJobReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AdminJobReq) ReadField3(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.Paras = tSlice + for i := 0; i < size; i ++ { +var _elem9 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem9 = v +} + p.Paras = append(p.Paras, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobReq"); 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 *AdminJobReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) } + if err := oprot.WriteI32(int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) } + return err +} + +func (p *AdminJobReq) String() string { + if p == nil { + return "" + } + + opVal := fmt.Sprintf("%v", p.Op) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + return fmt.Sprintf("AdminJobReq({Op:%s Cmd:%s Paras:%s})", opVal, cmdVal, parasVal) +} + +// Attributes: +// - Id +// - Cmd +// - Paras +// - Status +// - StartTime +// - StopTime +type JobDesc struct { + Id int32 `thrift:"id,1" db:"id" json:"id"` + Cmd AdminCmd `thrift:"cmd,2" db:"cmd" json:"cmd"` + Paras []string `thrift:"paras,3" db:"paras" json:"paras"` + Status JobStatus `thrift:"status,4" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,5" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,6" db:"stop_time" json:"stop_time"` +} + +func NewJobDesc() *JobDesc { + return &JobDesc{} +} + + +func (p *JobDesc) GetId() int32 { + return p.Id +} + +func (p *JobDesc) GetCmd() AdminCmd { + return p.Cmd +} + +func (p *JobDesc) GetParas() []string { + return p.Paras +} + +func (p *JobDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *JobDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *JobDesc) GetStopTime() int64 { + return p.StopTime +} +func (p *JobDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JobDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *JobDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *JobDesc) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Paras = tSlice + for i := 0; i < size; i ++ { +var _elem10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem10 = v +} + p.Paras = append(p.Paras, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *JobDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *JobDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *JobDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *JobDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("JobDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *JobDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := oprot.WriteI32(int32(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *JobDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:cmd: ", p), err) } + return err +} + +func (p *JobDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) } + return err +} + +func (p *JobDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *JobDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:start_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) } + return err +} + +func (p *JobDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:stop_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:stop_time: ", p), err) } + return err +} + +func (p *JobDesc) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + cmdVal := fmt.Sprintf("%v", p.Cmd) + parasVal := fmt.Sprintf("%v", p.Paras) + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + return fmt.Sprintf("JobDesc({Id:%s Cmd:%s Paras:%s Status:%s StartTime:%s StopTime:%s})", idVal, cmdVal, parasVal, statusVal, startTimeVal, stopTimeVal) +} + +// Attributes: +// - TaskID +// - Host +// - Status +// - StartTime +// - StopTime +// - JobID +type TaskDesc struct { + TaskID int32 `thrift:"task_id,1" db:"task_id" json:"task_id"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + Status JobStatus `thrift:"status,3" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` + JobID int32 `thrift:"job_id,6" db:"job_id" json:"job_id"` +} + +func NewTaskDesc() *TaskDesc { + return &TaskDesc{ + Host: nebula0.NewHostAddr(), + } +} + + +func (p *TaskDesc) GetTaskID() int32 { + return p.TaskID +} +var TaskDesc_Host_DEFAULT *nebula0.HostAddr +func (p *TaskDesc) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return TaskDesc_Host_DEFAULT + } +return p.Host +} + +func (p *TaskDesc) GetStatus() JobStatus { + return p.Status +} + +func (p *TaskDesc) GetStartTime() int64 { + return p.StartTime +} + +func (p *TaskDesc) GetStopTime() int64 { + return p.StopTime +} + +func (p *TaskDesc) GetJobID() int32 { + return p.JobID +} +func (p *TaskDesc) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *TaskDesc) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *TaskDesc) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *TaskDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *TaskDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *TaskDesc) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *TaskDesc) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *TaskDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskDesc"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TaskDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:task_id: ", p), err) } + return err +} + +func (p *TaskDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *TaskDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:status: ", p), err) } + return err +} + +func (p *TaskDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:start_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:start_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:stop_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stop_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:job_id: ", p), err) } + return err +} + +func (p *TaskDesc) String() string { + if p == nil { + return "" + } + + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + statusVal := fmt.Sprintf("%v", p.Status) + startTimeVal := fmt.Sprintf("%v", p.StartTime) + stopTimeVal := fmt.Sprintf("%v", p.StopTime) + jobIDVal := fmt.Sprintf("%v", p.JobID) + return fmt.Sprintf("TaskDesc({TaskID:%s Host:%s Status:%s StartTime:%s StopTime:%s JobID:%s})", taskIDVal, hostVal, statusVal, startTimeVal, stopTimeVal, jobIDVal) +} + +// Attributes: +// - JobID +// - JobDesc +// - TaskDesc +// - RecoveredJobNum +type AdminJobResult_ struct { + JobID *int32 `thrift:"job_id,1" db:"job_id" json:"job_id,omitempty"` + JobDesc []*JobDesc `thrift:"job_desc,2" db:"job_desc" json:"job_desc,omitempty"` + TaskDesc []*TaskDesc `thrift:"task_desc,3" db:"task_desc" json:"task_desc,omitempty"` + RecoveredJobNum *int32 `thrift:"recovered_job_num,4" db:"recovered_job_num" json:"recovered_job_num,omitempty"` +} + +func NewAdminJobResult_() *AdminJobResult_ { + return &AdminJobResult_{} +} + +var AdminJobResult__JobID_DEFAULT int32 +func (p *AdminJobResult_) GetJobID() int32 { + if !p.IsSetJobID() { + return AdminJobResult__JobID_DEFAULT + } +return *p.JobID +} +var AdminJobResult__JobDesc_DEFAULT []*JobDesc + +func (p *AdminJobResult_) GetJobDesc() []*JobDesc { + return p.JobDesc +} +var AdminJobResult__TaskDesc_DEFAULT []*TaskDesc + +func (p *AdminJobResult_) GetTaskDesc() []*TaskDesc { + return p.TaskDesc +} +var AdminJobResult__RecoveredJobNum_DEFAULT int32 +func (p *AdminJobResult_) GetRecoveredJobNum() int32 { + if !p.IsSetRecoveredJobNum() { + return AdminJobResult__RecoveredJobNum_DEFAULT + } +return *p.RecoveredJobNum +} +func (p *AdminJobResult_) IsSetJobID() bool { + return p != nil && p.JobID != nil +} + +func (p *AdminJobResult_) IsSetJobDesc() bool { + return p != nil && p.JobDesc != nil +} + +func (p *AdminJobResult_) IsSetTaskDesc() bool { + return p != nil && p.TaskDesc != nil +} + +func (p *AdminJobResult_) IsSetRecoveredJobNum() bool { + return p != nil && p.RecoveredJobNum != nil +} + +func (p *AdminJobResult_) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResult_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = &v +} + return nil +} + +func (p *AdminJobResult_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*JobDesc, 0, size) + p.JobDesc = tSlice + for i := 0; i < size; i ++ { + _elem11 := NewJobDesc() + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.JobDesc = append(p.JobDesc, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TaskDesc, 0, size) + p.TaskDesc = tSlice + for i := 0; i < size; i ++ { + _elem12 := NewTaskDesc() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.TaskDesc = append(p.TaskDesc, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.RecoveredJobNum = &v +} + return nil +} + +func (p *AdminJobResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResult"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminJobResult_) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetJobID() { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetJobDesc() { + if err := oprot.WriteFieldBegin("job_desc", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_desc: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.JobDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.JobDesc { + 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:job_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskDesc() { + if err := oprot.WriteFieldBegin("task_desc", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_desc: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TaskDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskDesc { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetRecoveredJobNum() { + if err := oprot.WriteFieldBegin("recovered_job_num", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:recovered_job_num: ", p), err) } + if err := oprot.WriteI32(int32(*p.RecoveredJobNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.recovered_job_num (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:recovered_job_num: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) String() string { + if p == nil { + return "" + } + + var jobIDVal string + if p.JobID == nil { + jobIDVal = "" + } else { + jobIDVal = fmt.Sprintf("%v", *p.JobID) + } + jobDescVal := fmt.Sprintf("%v", p.JobDesc) + taskDescVal := fmt.Sprintf("%v", p.TaskDesc) + var recoveredJobNumVal string + if p.RecoveredJobNum == nil { + recoveredJobNumVal = "" + } else { + recoveredJobNumVal = fmt.Sprintf("%v", *p.RecoveredJobNum) + } + return fmt.Sprintf("AdminJobResult_({JobID:%s JobDesc:%s TaskDesc:%s RecoveredJobNum:%s})", jobIDVal, jobDescVal, taskDescVal, recoveredJobNumVal) +} + +// Attributes: +// - Code +// - Leader +// - Result_ +type AdminJobResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Result_ *AdminJobResult_ `thrift:"result,3" db:"result" json:"result"` +} + +func NewAdminJobResp() *AdminJobResp { + return &AdminJobResp{ + Leader: nebula0.NewHostAddr(), + Result_: NewAdminJobResult_(), + } +} + + +func (p *AdminJobResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var AdminJobResp_Leader_DEFAULT *nebula0.HostAddr +func (p *AdminJobResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return AdminJobResp_Leader_DEFAULT + } +return p.Leader +} +var AdminJobResp_Result__DEFAULT *AdminJobResult_ +func (p *AdminJobResp) GetResult_() *AdminJobResult_ { + if !p.IsSetResult_() { + return AdminJobResp_Result__DEFAULT + } +return p.Result_ +} +func (p *AdminJobResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *AdminJobResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) ReadField3(iprot thrift.Protocol) error { + p.Result_ = NewAdminJobResult_() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminJobResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminJobResp"); 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 *AdminJobResp) 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 *AdminJobResp) 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 *AdminJobResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:result: ", p), err) } + return err +} + +func (p *AdminJobResp) 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) + } + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("AdminJobResp({Code:%s Leader:%s Result_:%s})", codeVal, leaderVal, resultVal) +} + +// Attributes: +// - PartID +// - Proportion +type Correlativity struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Proportion float64 `thrift:"proportion,2" db:"proportion" json:"proportion"` +} + +func NewCorrelativity() *Correlativity { + return &Correlativity{} +} + + +func (p *Correlativity) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *Correlativity) GetProportion() float64 { + return p.Proportion +} +func (p *Correlativity) 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 *Correlativity) 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 *Correlativity) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Proportion = v +} + return nil +} + +func (p *Correlativity) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Correlativity"); 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 *Correlativity) 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 *Correlativity) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("proportion", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:proportion: ", p), err) } + if err := oprot.WriteDouble(float64(p.Proportion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.proportion (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:proportion: ", p), err) } + return err +} + +func (p *Correlativity) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + proportionVal := fmt.Sprintf("%v", p.Proportion) + return fmt.Sprintf("Correlativity({PartID:%s Proportion:%s})", partIDVal, proportionVal) +} + +// Attributes: +// - TagVertices +// - Edges +// - SpaceVertices +// - SpaceEdges +// - PositivePartCorrelativity +// - NegativePartCorrelativity +// - Status +type StatsItem struct { + TagVertices map[string]int64 `thrift:"tag_vertices,1" db:"tag_vertices" json:"tag_vertices"` + Edges map[string]int64 `thrift:"edges,2" db:"edges" json:"edges"` + SpaceVertices int64 `thrift:"space_vertices,3" db:"space_vertices" json:"space_vertices"` + SpaceEdges int64 `thrift:"space_edges,4" db:"space_edges" json:"space_edges"` + PositivePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"positive_part_correlativity,5" db:"positive_part_correlativity" json:"positive_part_correlativity"` + NegativePartCorrelativity map[nebula0.PartitionID][]*Correlativity `thrift:"negative_part_correlativity,6" db:"negative_part_correlativity" json:"negative_part_correlativity"` + Status JobStatus `thrift:"status,7" db:"status" json:"status"` +} + +func NewStatsItem() *StatsItem { + return &StatsItem{} +} + + +func (p *StatsItem) GetTagVertices() map[string]int64 { + return p.TagVertices +} + +func (p *StatsItem) GetEdges() map[string]int64 { + return p.Edges +} + +func (p *StatsItem) GetSpaceVertices() int64 { + return p.SpaceVertices +} + +func (p *StatsItem) GetSpaceEdges() int64 { + return p.SpaceEdges +} + +func (p *StatsItem) GetPositivePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.PositivePartCorrelativity +} + +func (p *StatsItem) GetNegativePartCorrelativity() map[nebula0.PartitionID][]*Correlativity { + return p.NegativePartCorrelativity +} + +func (p *StatsItem) GetStatus() JobStatus { + return p.Status +} +func (p *StatsItem) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatsItem) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.TagVertices = tMap + for i := 0; i < size; i ++ { +var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key13 = v +} +var _val14 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val14 = v +} + p.TagVertices[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int64, size) + p.Edges = tMap + for i := 0; i < size; i ++ { +var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key15 = v +} +var _val16 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val16 = v +} + p.Edges[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SpaceVertices = v +} + return nil +} + +func (p *StatsItem) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceEdges = v +} + return nil +} + +func (p *StatsItem) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.PositivePartCorrelativity = tMap + for i := 0; i < size; i ++ { +var _key17 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key17 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val18 := tSlice + for i := 0; i < size; i ++ { + _elem19 := NewCorrelativity() + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + } + _val18 = append(_val18, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PositivePartCorrelativity[_key17] = _val18 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]*Correlativity, size) + p.NegativePartCorrelativity = tMap + for i := 0; i < size; i ++ { +var _key20 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key20 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val21 := tSlice + for i := 0; i < size; i ++ { + _elem22 := NewCorrelativity() + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + _val21 = append(_val21, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.NegativePartCorrelativity[_key20] = _val21 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *StatsItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatsItem"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StatsItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_vertices", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_vertices: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.TagVertices)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.TagVertices { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_vertices: ", p), err) } + return err +} + +func (p *StatsItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edges: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.Edges)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Edges { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edges: ", p), err) } + return err +} + +func (p *StatsItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_vertices", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:space_vertices: ", p), err) } + if err := oprot.WriteI64(int64(p.SpaceVertices)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_vertices (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:space_vertices: ", p), err) } + return err +} + +func (p *StatsItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_edges", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_edges: ", p), err) } + if err := oprot.WriteI64(int64(p.SpaceEdges)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_edges (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_edges: ", p), err) } + return err +} + +func (p *StatsItem) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("positive_part_correlativity", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:positive_part_correlativity: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PositivePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PositivePartCorrelativity { + 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 5:positive_part_correlativity: ", p), err) } + return err +} + +func (p *StatsItem) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("negative_part_correlativity", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:negative_part_correlativity: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.NegativePartCorrelativity)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NegativePartCorrelativity { + 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 6:negative_part_correlativity: ", p), err) } + return err +} + +func (p *StatsItem) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:status: ", p), err) } + return err +} + +func (p *StatsItem) String() string { + if p == nil { + return "" + } + + tagVerticesVal := fmt.Sprintf("%v", p.TagVertices) + edgesVal := fmt.Sprintf("%v", p.Edges) + spaceVerticesVal := fmt.Sprintf("%v", p.SpaceVertices) + spaceEdgesVal := fmt.Sprintf("%v", p.SpaceEdges) + positivePartCorrelativityVal := fmt.Sprintf("%v", p.PositivePartCorrelativity) + negativePartCorrelativityVal := fmt.Sprintf("%v", p.NegativePartCorrelativity) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("StatsItem({TagVertices:%s Edges:%s SpaceVertices:%s SpaceEdges:%s PositivePartCorrelativity:%s NegativePartCorrelativity:%s Status:%s})", tagVerticesVal, edgesVal, spaceVerticesVal, spaceEdgesVal, positivePartCorrelativityVal, negativePartCorrelativityVal, statusVal) +} + +// Attributes: +// - Properties +// - IfNotExists +type CreateSpaceReq struct { + Properties *SpaceDesc `thrift:"properties,1" db:"properties" json:"properties"` + IfNotExists bool `thrift:"if_not_exists,2" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateSpaceReq() *CreateSpaceReq { + return &CreateSpaceReq{ + Properties: NewSpaceDesc(), + } +} + +var CreateSpaceReq_Properties_DEFAULT *SpaceDesc +func (p *CreateSpaceReq) GetProperties() *SpaceDesc { + if !p.IsSetProperties() { + return CreateSpaceReq_Properties_DEFAULT + } +return p.Properties +} + +func (p *CreateSpaceReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateSpaceReq) IsSetProperties() bool { + return p != nil && p.Properties != nil +} + +func (p *CreateSpaceReq) 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 *CreateSpaceReq) ReadField1(iprot thrift.Protocol) error { + p.Properties = NewSpaceDesc() + if err := p.Properties.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSpaceReq"); 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 *CreateSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("properties", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:properties: ", p), err) } + if err := p.Properties.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:properties: ", p), err) } + return err +} + +func (p *CreateSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_not_exists: ", p), err) } + return err +} + +func (p *CreateSpaceReq) String() string { + if p == nil { + return "" + } + + var propertiesVal string + if p.Properties == nil { + propertiesVal = "" + } else { + propertiesVal = fmt.Sprintf("%v", p.Properties) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateSpaceReq({Properties:%s IfNotExists:%s})", propertiesVal, ifNotExistsVal) +} + +// Attributes: +// - OldSpaceName +// - NewSpaceName_ +type CreateSpaceAsReq struct { + OldSpaceName []byte `thrift:"old_space_name,1" db:"old_space_name" json:"old_space_name"` + NewSpaceName_ []byte `thrift:"new_space_name,2" db:"new_space_name" json:"new_space_name"` +} + +func NewCreateSpaceAsReq() *CreateSpaceAsReq { + return &CreateSpaceAsReq{} +} + + +func (p *CreateSpaceAsReq) GetOldSpaceName() []byte { + return p.OldSpaceName +} + +func (p *CreateSpaceAsReq) GetNewSpaceName_() []byte { + return p.NewSpaceName_ +} +func (p *CreateSpaceAsReq) 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 *CreateSpaceAsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.OldSpaceName = v +} + return nil +} + +func (p *CreateSpaceAsReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.NewSpaceName_ = v +} + return nil +} + +func (p *CreateSpaceAsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSpaceAsReq"); 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 *CreateSpaceAsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("old_space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:old_space_name: ", p), err) } + if err := oprot.WriteBinary(p.OldSpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:old_space_name: ", p), err) } + return err +} + +func (p *CreateSpaceAsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_space_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_space_name: ", p), err) } + if err := oprot.WriteBinary(p.NewSpaceName_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_space_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_space_name: ", p), err) } + return err +} + +func (p *CreateSpaceAsReq) String() string { + if p == nil { + return "" + } + + oldSpaceNameVal := fmt.Sprintf("%v", p.OldSpaceName) + newSpaceNameVal := fmt.Sprintf("%v", p.NewSpaceName_) + return fmt.Sprintf("CreateSpaceAsReq({OldSpaceName:%s NewSpaceName_:%s})", oldSpaceNameVal, newSpaceNameVal) +} + +// Attributes: +// - SpaceName +// - IfExists +type DropSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropSpaceReq() *DropSpaceReq { + return &DropSpaceReq{} +} + + +func (p *DropSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *DropSpaceReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropSpaceReq) 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 *DropSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *DropSpaceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSpaceReq"); 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 *DropSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *DropSpaceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropSpaceReq({SpaceName:%s IfExists:%s})", spaceNameVal, ifExistsVal) +} + +type ListSpacesReq struct { +} + +func NewListSpacesReq() *ListSpacesReq { + return &ListSpacesReq{} +} + +func (p *ListSpacesReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSpacesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSpacesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Spaces +type ListSpacesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Spaces []*IdName `thrift:"spaces,3" db:"spaces" json:"spaces"` +} + +func NewListSpacesResp() *ListSpacesResp { + return &ListSpacesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListSpacesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListSpacesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSpacesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSpacesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSpacesResp) GetSpaces() []*IdName { + return p.Spaces +} +func (p *ListSpacesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IdName, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i ++ { + _elem23 := NewIdName() + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.Spaces = append(p.Spaces, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSpacesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSpacesResp"); 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 *ListSpacesResp) 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 *ListSpacesResp) 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 *ListSpacesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spaces: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spaces: ", p), err) } + return err +} + +func (p *ListSpacesResp) 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) + } + spacesVal := fmt.Sprintf("%v", p.Spaces) + return fmt.Sprintf("ListSpacesResp({Code:%s Leader:%s Spaces:%s})", codeVal, leaderVal, spacesVal) +} + +// Attributes: +// - SpaceName +type GetSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` +} + +func NewGetSpaceReq() *GetSpaceReq { + return &GetSpaceReq{} +} + + +func (p *GetSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} +func (p *GetSpaceReq) 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 *GetSpaceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *GetSpaceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceReq"); 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 *GetSpaceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *GetSpaceReq) String() string { + if p == nil { + return "" + } + + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + return fmt.Sprintf("GetSpaceReq({SpaceName:%s})", spaceNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetSpaceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *SpaceItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetSpaceResp() *GetSpaceResp { + return &GetSpaceResp{ + Leader: nebula0.NewHostAddr(), + Item: NewSpaceItem(), + } +} + + +func (p *GetSpaceResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetSpaceResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetSpaceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSpaceResp_Leader_DEFAULT + } +return p.Leader +} +var GetSpaceResp_Item_DEFAULT *SpaceItem +func (p *GetSpaceResp) GetItem() *SpaceItem { + if !p.IsSetItem() { + return GetSpaceResp_Item_DEFAULT + } +return p.Item +} +func (p *GetSpaceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSpaceResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewSpaceItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetSpaceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSpaceResp"); 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 *GetSpaceResp) 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 *GetSpaceResp) 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 *GetSpaceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetSpaceResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetSpaceResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Schema +// - IfNotExists +type CreateTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateTagReq() *CreateTagReq { + return &CreateTagReq{ + Schema: NewSchema(), + } +} + + +func (p *CreateTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagReq) GetTagName() []byte { + return p.TagName +} +var CreateTagReq_Schema_DEFAULT *Schema +func (p *CreateTagReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateTagReq_Schema_DEFAULT + } +return p.Schema +} + +func (p *CreateTagReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateTagReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateTagReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateTagReq) 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 *CreateTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateTagReq({SpaceID:%s TagName:%s Schema:%s IfNotExists:%s})", spaceIDVal, tagNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - TagItems +// - SchemaProp +type AlterTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + TagItems []*AlterSchemaItem `thrift:"tag_items,3" db:"tag_items" json:"tag_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterTagReq() *AlterTagReq { + return &AlterTagReq{ + SchemaProp: NewSchemaProp(), + } +} + + +func (p *AlterTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *AlterTagReq) GetTagItems() []*AlterSchemaItem { + return p.TagItems +} +var AlterTagReq_SchemaProp_DEFAULT *SchemaProp +func (p *AlterTagReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterTagReq_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *AlterTagReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterTagReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *AlterTagReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.TagItems = tSlice + for i := 0; i < size; i ++ { + _elem24 := NewAlterSchemaItem() + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + } + p.TagItems = append(p.TagItems, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterTagReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterTagReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterTagReq) 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 *AlterTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TagItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TagItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_items: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + tagItemsVal := fmt.Sprintf("%v", p.TagItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterTagReq({SpaceID:%s TagName:%s TagItems:%s SchemaProp:%s})", spaceIDVal, tagNameVal, tagItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - IfExists +type DropTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagReq() *DropTagReq { + return &DropTagReq{} +} + + +func (p *DropTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *DropTagReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagReq) 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 *DropTagReq) 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 *DropTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *DropTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagReq"); 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 *DropTagReq) 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 *DropTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *DropTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagReq({SpaceID:%s TagName:%s IfExists:%s})", spaceIDVal, tagNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListTagsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagsReq() *ListTagsReq { + return &ListTagsReq{} +} + + +func (p *ListTagsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagsReq) 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 *ListTagsReq) 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 *ListTagsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsReq"); 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 *ListTagsReq) 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 *ListTagsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagsReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Tags +type ListTagsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Tags []*TagItem `thrift:"tags,3" db:"tags" json:"tags"` +} + +func NewListTagsResp() *ListTagsResp { + return &ListTagsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListTagsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListTagsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListTagsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListTagsResp) GetTags() []*TagItem { + return p.Tags +} +func (p *ListTagsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TagItem, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem25 := NewTagItem() + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + } + p.Tags = append(p.Tags, _elem25) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagsResp"); 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 *ListTagsResp) 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 *ListTagsResp) 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 *ListTagsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tags: ", p), err) } + return err +} + +func (p *ListTagsResp) 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) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("ListTagsResp({Code:%s Leader:%s Tags:%s})", codeVal, leaderVal, tagsVal) +} + +// Attributes: +// - SpaceID +// - TagName +// - Version +type GetTagReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + TagName []byte `thrift:"tag_name,2" db:"tag_name" json:"tag_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetTagReq() *GetTagReq { + return &GetTagReq{} +} + + +func (p *GetTagReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *GetTagReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetTagReq) 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 *GetTagReq) 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 *GetTagReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *GetTagReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetTagReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagReq"); 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 *GetTagReq) 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 *GetTagReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *GetTagReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetTagReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + tagNameVal := fmt.Sprintf("%v", p.TagName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetTagReq({SpaceID:%s TagName:%s Version:%s})", spaceIDVal, tagNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetTagResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetTagResp() *GetTagResp { + return &GetTagResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + + +func (p *GetTagResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetTagResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetTagResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagResp_Leader_DEFAULT + } +return p.Leader +} +var GetTagResp_Schema_DEFAULT *Schema +func (p *GetTagResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetTagResp_Schema_DEFAULT + } +return p.Schema +} +func (p *GetTagResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetTagResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagResp"); 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 *GetTagResp) 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 *GetTagResp) 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 *GetTagResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetTagResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetTagResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Schema +// - IfNotExists +type CreateEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateEdgeReq() *CreateEdgeReq { + return &CreateEdgeReq{ + Schema: NewSchema(), + } +} + + +func (p *CreateEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} +var CreateEdgeReq_Schema_DEFAULT *Schema +func (p *CreateEdgeReq) GetSchema() *Schema { + if !p.IsSetSchema() { + return CreateEdgeReq_Schema_DEFAULT + } +return p.Schema +} + +func (p *CreateEdgeReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateEdgeReq) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *CreateEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeReq) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateEdgeReq) 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 *CreateEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateEdgeReq({SpaceID:%s EdgeName:%s Schema:%s IfNotExists:%s})", spaceIDVal, edgeNameVal, schemaVal, ifNotExistsVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - EdgeItems +// - SchemaProp +type AlterEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + EdgeItems []*AlterSchemaItem `thrift:"edge_items,3" db:"edge_items" json:"edge_items"` + SchemaProp *SchemaProp `thrift:"schema_prop,4" db:"schema_prop" json:"schema_prop"` +} + +func NewAlterEdgeReq() *AlterEdgeReq { + return &AlterEdgeReq{ + SchemaProp: NewSchemaProp(), + } +} + + +func (p *AlterEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AlterEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *AlterEdgeReq) GetEdgeItems() []*AlterSchemaItem { + return p.EdgeItems +} +var AlterEdgeReq_SchemaProp_DEFAULT *SchemaProp +func (p *AlterEdgeReq) GetSchemaProp() *SchemaProp { + if !p.IsSetSchemaProp() { + return AlterEdgeReq_SchemaProp_DEFAULT + } +return p.SchemaProp +} +func (p *AlterEdgeReq) IsSetSchemaProp() bool { + return p != nil && p.SchemaProp != nil +} + +func (p *AlterEdgeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *AlterEdgeReq) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*AlterSchemaItem, 0, size) + p.EdgeItems = tSlice + for i := 0; i < size; i ++ { + _elem26 := NewAlterSchemaItem() + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + } + p.EdgeItems = append(p.EdgeItems, _elem26) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField4(iprot thrift.Protocol) error { + p.SchemaProp = NewSchemaProp() + if err := p.SchemaProp.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterEdgeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterEdgeReq) 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 *AlterEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeItems { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_items: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_prop", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:schema_prop: ", p), err) } + if err := p.SchemaProp.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + edgeItemsVal := fmt.Sprintf("%v", p.EdgeItems) + var schemaPropVal string + if p.SchemaProp == nil { + schemaPropVal = "" + } else { + schemaPropVal = fmt.Sprintf("%v", p.SchemaProp) + } + return fmt.Sprintf("AlterEdgeReq({SpaceID:%s EdgeName:%s EdgeItems:%s SchemaProp:%s})", spaceIDVal, edgeNameVal, edgeItemsVal, schemaPropVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - Version +type GetEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + Version SchemaVer `thrift:"version,3" db:"version" json:"version"` +} + +func NewGetEdgeReq() *GetEdgeReq { + return &GetEdgeReq{} +} + + +func (p *GetEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *GetEdgeReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetEdgeReq) 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 *GetEdgeReq) 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 *GetEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *GetEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeReq"); 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 *GetEdgeReq) 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 *GetEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *GetEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("GetEdgeReq({SpaceID:%s EdgeName:%s Version:%s})", spaceIDVal, edgeNameVal, versionVal) +} + +// Attributes: +// - Code +// - Leader +// - Schema +type GetEdgeResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Schema *Schema `thrift:"schema,3" db:"schema" json:"schema"` +} + +func NewGetEdgeResp() *GetEdgeResp { + return &GetEdgeResp{ + Leader: nebula0.NewHostAddr(), + Schema: NewSchema(), + } +} + + +func (p *GetEdgeResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetEdgeResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetEdgeResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeResp_Leader_DEFAULT + } +return p.Leader +} +var GetEdgeResp_Schema_DEFAULT *Schema +func (p *GetEdgeResp) GetSchema() *Schema { + if !p.IsSetSchema() { + return GetEdgeResp_Schema_DEFAULT + } +return p.Schema +} +func (p *GetEdgeResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeResp) IsSetSchema() bool { + return p != nil && p.Schema != nil +} + +func (p *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) ReadField3(iprot thrift.Protocol) error { + p.Schema = NewSchema() + if err := p.Schema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetEdgeResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeResp"); 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 *GetEdgeResp) 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 *GetEdgeResp) 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 *GetEdgeResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schema: ", p), err) } + if err := p.Schema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetEdgeResp) 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) + } + var schemaVal string + if p.Schema == nil { + schemaVal = "" + } else { + schemaVal = fmt.Sprintf("%v", p.Schema) + } + return fmt.Sprintf("GetEdgeResp({Code:%s Leader:%s Schema:%s})", codeVal, leaderVal, schemaVal) +} + +// Attributes: +// - SpaceID +// - EdgeName +// - IfExists +type DropEdgeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + EdgeName []byte `thrift:"edge_name,2" db:"edge_name" json:"edge_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeReq() *DropEdgeReq { + return &DropEdgeReq{} +} + + +func (p *DropEdgeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *DropEdgeReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeReq) 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 *DropEdgeReq) 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 *DropEdgeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *DropEdgeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeReq"); 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 *DropEdgeReq) 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 *DropEdgeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *DropEdgeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeReq({SpaceID:%s EdgeName:%s IfExists:%s})", spaceIDVal, edgeNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +type ListEdgesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgesReq() *ListEdgesReq { + return &ListEdgesReq{} +} + + +func (p *ListEdgesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgesReq) 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 *ListEdgesReq) 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 *ListEdgesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesReq"); 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 *ListEdgesReq) 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 *ListEdgesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Edges +type ListEdgesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Edges []*EdgeItem `thrift:"edges,3" db:"edges" json:"edges"` +} + +func NewListEdgesResp() *ListEdgesResp { + return &ListEdgesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListEdgesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListEdgesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListEdgesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListEdgesResp) GetEdges() []*EdgeItem { + return p.Edges +} +func (p *ListEdgesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) 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 *ListEdgesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeItem, 0, size) + p.Edges = tSlice + for i := 0; i < size; i ++ { + _elem27 := NewEdgeItem() + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + p.Edges = append(p.Edges, _elem27) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgesResp"); 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 *ListEdgesResp) 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 *ListEdgesResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListEdgesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edges: ", p), err) } + return err +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + edgesVal := fmt.Sprintf("%v", p.Edges) + return fmt.Sprintf("ListEdgesResp({Code:%s Leader:%s Edges:%s})", codeVal, leaderVal, edgesVal) +} + +// Attributes: +// - Type +type ListHostsReq struct { + Type ListHostType `thrift:"type,1" db:"type" json:"type"` +} + +func NewListHostsReq() *ListHostsReq { + return &ListHostsReq{} +} + + +func (p *ListHostsReq) GetType() ListHostType { + return p.Type +} +func (p *ListHostsReq) 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 *ListHostsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListHostType(v) + p.Type = temp +} + return nil +} + +func (p *ListHostsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsReq"); 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 *ListHostsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListHostsReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("ListHostsReq({Type:%s})", typeVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type ListHostsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*HostItem `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewListHostsResp() *ListHostsResp { + return &ListHostsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListHostsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListHostsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListHostsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListHostsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListHostsResp) GetHosts() []*HostItem { + return p.Hosts +} +func (p *ListHostsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostItem, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem28 := NewHostItem() + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + } + p.Hosts = append(p.Hosts, _elem28) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListHostsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListHostsResp"); 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 *ListHostsResp) 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 *ListHostsResp) 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 *ListHostsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *ListHostsResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("ListHostsResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +// Attributes: +// - PartID +// - Leader +// - Peers +// - Losts +type PartItem struct { + PartID nebula0.PartitionID `thrift:"part_id,1,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader,omitempty"` + Peers []*nebula0.HostAddr `thrift:"peers,3,required" db:"peers" json:"peers"` + Losts []*nebula0.HostAddr `thrift:"losts,4,required" db:"losts" json:"losts"` +} + +func NewPartItem() *PartItem { + return &PartItem{} +} + + +func (p *PartItem) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartItem_Leader_DEFAULT *nebula0.HostAddr +func (p *PartItem) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartItem_Leader_DEFAULT + } +return p.Leader +} + +func (p *PartItem) GetPeers() []*nebula0.HostAddr { + return p.Peers +} + +func (p *PartItem) GetLosts() []*nebula0.HostAddr { + return p.Losts +} +func (p *PartItem) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartItem) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetPartID bool = false; + var issetPeers bool = false; + var issetLosts 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 + } + issetPartID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + issetPeers = true + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + issetLosts = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + if !issetPeers{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Peers is not set")); + } + if !issetLosts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Losts is not set")); + } + return nil +} + +func (p *PartItem) 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 *PartItem) 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 *PartItem) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem29 := nebula0.NewHostAddr() + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.Peers = append(p.Peers, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) ReadField4(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.Losts = tSlice + for i := 0; i < size; i ++ { + _elem30 := nebula0.NewHostAddr() + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.Losts = append(p.Losts, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartItem) 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 *PartItem) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + 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 *PartItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *PartItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("losts", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:losts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Losts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Losts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:losts: ", p), err) } + return err +} + +func (p *PartItem) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + peersVal := fmt.Sprintf("%v", p.Peers) + lostsVal := fmt.Sprintf("%v", p.Losts) + return fmt.Sprintf("PartItem({PartID:%s Leader:%s Peers:%s Losts:%s})", partIDVal, leaderVal, peersVal, lostsVal) +} + +// Attributes: +// - SpaceID +// - PartIds +type ListPartsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartIds []nebula0.PartitionID `thrift:"part_ids,2" db:"part_ids" json:"part_ids"` +} + +func NewListPartsReq() *ListPartsReq { + return &ListPartsReq{} +} + + +func (p *ListPartsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ListPartsReq) GetPartIds() []nebula0.PartitionID { + return p.PartIds +} +func (p *ListPartsReq) 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 *ListPartsReq) 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 *ListPartsReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.PartIds = tSlice + for i := 0; i < size; i ++ { +var _elem31 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem31 = temp +} + p.PartIds = append(p.PartIds, _elem31) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsReq"); 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 *ListPartsReq) 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 *ListPartsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_ids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_ids: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.PartIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartIds { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_ids: ", p), err) } + return err +} + +func (p *ListPartsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIdsVal := fmt.Sprintf("%v", p.PartIds) + return fmt.Sprintf("ListPartsReq({SpaceID:%s PartIds:%s})", spaceIDVal, partIdsVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +type ListPartsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts []*PartItem `thrift:"parts,3" db:"parts" json:"parts"` +} + +func NewListPartsResp() *ListPartsResp { + return &ListPartsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListPartsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListPartsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListPartsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListPartsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListPartsResp) GetParts() []*PartItem { + return p.Parts +} +func (p *ListPartsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartItem, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { + _elem32 := NewPartItem() + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + } + p.Parts = append(p.Parts, _elem32) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListPartsResp"); 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 *ListPartsResp) 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 *ListPartsResp) 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 *ListPartsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *ListPartsResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("ListPartsResp({Code:%s Leader:%s Parts:%s})", codeVal, leaderVal, partsVal) +} + +// Attributes: +// - SpaceID +type GetPartsAllocReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetPartsAllocReq() *GetPartsAllocReq { + return &GetPartsAllocReq{} +} + + +func (p *GetPartsAllocReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetPartsAllocReq) 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocReq"); 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 *GetPartsAllocReq) 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 *GetPartsAllocReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetPartsAllocReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Parts +// - Terms +type GetPartsAllocResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts map[nebula0.PartitionID][]*nebula0.HostAddr `thrift:"parts,3" db:"parts" json:"parts"` + Terms map[nebula0.PartitionID]int64 `thrift:"terms,4" db:"terms" json:"terms,omitempty"` +} + +func NewGetPartsAllocResp() *GetPartsAllocResp { + return &GetPartsAllocResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *GetPartsAllocResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetPartsAllocResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetPartsAllocResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetPartsAllocResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetPartsAllocResp) GetParts() map[nebula0.PartitionID][]*nebula0.HostAddr { + return p.Parts +} +var GetPartsAllocResp_Terms_DEFAULT map[nebula0.PartitionID]int64 + +func (p *GetPartsAllocResp) GetTerms() map[nebula0.PartitionID]int64 { + return p.Terms +} +func (p *GetPartsAllocResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetPartsAllocResp) IsSetTerms() bool { + return p != nil && p.Terms != nil +} + +func (p *GetPartsAllocResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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.HostAddr, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key33 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key33 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + _val34 := tSlice + for i := 0; i < size; i ++ { + _elem35 := nebula0.NewHostAddr() + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + _val34 = append(_val34, _elem35) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key33] = _val34 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID]int64, size) + p.Terms = tMap + for i := 0; i < size; i ++ { +var _key36 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key36 = temp +} +var _val37 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val37 = v +} + p.Terms[_key36] = _val37 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPartsAllocResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) 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 *GetPartsAllocResp) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetTerms() { + if err := oprot.WriteFieldBegin("terms", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:terms: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I64, len(p.Terms)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Terms { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:terms: ", p), err) } + } + return err +} + +func (p *GetPartsAllocResp) 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) + } + partsVal := fmt.Sprintf("%v", p.Parts) + termsVal := fmt.Sprintf("%v", p.Terms) + return fmt.Sprintf("GetPartsAllocResp({Code:%s Leader:%s Parts:%s Terms:%s})", codeVal, leaderVal, partsVal, termsVal) +} + +// Attributes: +// - Segment +// - Pairs +type MultiPutReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Pairs []*nebula0.KeyValue `thrift:"pairs,2" db:"pairs" json:"pairs"` +} + +func NewMultiPutReq() *MultiPutReq { + return &MultiPutReq{} +} + + +func (p *MultiPutReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiPutReq) GetPairs() []*nebula0.KeyValue { + return p.Pairs +} +func (p *MultiPutReq) 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 *MultiPutReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *MultiPutReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + p.Pairs = tSlice + for i := 0; i < size; i ++ { + _elem38 := nebula0.NewKeyValue() + if err := _elem38.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + } + p.Pairs = append(p.Pairs, _elem38) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiPutReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiPutReq"); 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 *MultiPutReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *MultiPutReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("pairs", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pairs: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Pairs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Pairs { + 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:pairs: ", p), err) } + return err +} + +func (p *MultiPutReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + pairsVal := fmt.Sprintf("%v", p.Pairs) + return fmt.Sprintf("MultiPutReq({Segment:%s Pairs:%s})", segmentVal, pairsVal) +} + +// Attributes: +// - Segment +// - Key +type GetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewGetReq() *GetReq { + return &GetReq{} +} + + +func (p *GetReq) GetSegment() []byte { + return p.Segment +} + +func (p *GetReq) GetKey() []byte { + return p.Key +} +func (p *GetReq) 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 *GetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *GetReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *GetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetReq"); 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 *GetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *GetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) } + return err +} + +func (p *GetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("GetReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Code +// - Leader +// - Value +type GetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Value []byte `thrift:"value,3" db:"value" json:"value"` +} + +func NewGetResp() *GetResp { + return &GetResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *GetResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetResp) GetValue() []byte { + return p.Value +} +func (p *GetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetResp) 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 *GetResp) 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 *GetResp) 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 *GetResp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *GetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetResp"); 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 *GetResp) 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 *GetResp) 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 *GetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err) } + return err +} + +func (p *GetResp) 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) + } + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("GetResp({Code:%s Leader:%s Value:%s})", codeVal, leaderVal, valueVal) +} + +// Attributes: +// - Segment +// - Keys +type MultiGetReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Keys [][]byte `thrift:"keys,2" db:"keys" json:"keys"` +} + +func NewMultiGetReq() *MultiGetReq { + return &MultiGetReq{} +} + + +func (p *MultiGetReq) GetSegment() []byte { + return p.Segment +} + +func (p *MultiGetReq) GetKeys() [][]byte { + return p.Keys +} +func (p *MultiGetReq) 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 *MultiGetReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *MultiGetReq) 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.Keys = tSlice + for i := 0; i < size; i ++ { +var _elem39 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem39 = v +} + p.Keys = append(p.Keys, _elem39) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetReq"); 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 *MultiGetReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *MultiGetReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("keys", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:keys: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Keys)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Keys { + if err := oprot.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:keys: ", p), err) } + return err +} + +func (p *MultiGetReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keysVal := fmt.Sprintf("%v", p.Keys) + return fmt.Sprintf("MultiGetReq({Segment:%s Keys:%s})", segmentVal, keysVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type MultiGetResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewMultiGetResp() *MultiGetResp { + return &MultiGetResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *MultiGetResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var MultiGetResp_Leader_DEFAULT *nebula0.HostAddr +func (p *MultiGetResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return MultiGetResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *MultiGetResp) GetValues() [][]byte { + return p.Values +} +func (p *MultiGetResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i ++ { +var _elem40 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem40 = v +} + p.Values = append(p.Values, _elem40) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MultiGetResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MultiGetResp"); 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 *MultiGetResp) 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 *MultiGetResp) 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 *MultiGetResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) } + return err +} + +func (p *MultiGetResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("MultiGetResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Segment +// - Key +type RemoveReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Key []byte `thrift:"key,2" db:"key" json:"key"` +} + +func NewRemoveReq() *RemoveReq { + return &RemoveReq{} +} + + +func (p *RemoveReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveReq) GetKey() []byte { + return p.Key +} +func (p *RemoveReq) 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 *RemoveReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *RemoveReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *RemoveReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveReq"); 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 *RemoveReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *RemoveReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key: ", p), err) } + return err +} + +func (p *RemoveReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + keyVal := fmt.Sprintf("%v", p.Key) + return fmt.Sprintf("RemoveReq({Segment:%s Key:%s})", segmentVal, keyVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type RemoveRangeReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewRemoveRangeReq() *RemoveRangeReq { + return &RemoveRangeReq{} +} + + +func (p *RemoveRangeReq) GetSegment() []byte { + return p.Segment +} + +func (p *RemoveRangeReq) GetStart() []byte { + return p.Start +} + +func (p *RemoveRangeReq) GetEnd() []byte { + return p.End +} +func (p *RemoveRangeReq) 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 *RemoveRangeReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *RemoveRangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Start = v +} + return nil +} + +func (p *RemoveRangeReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.End = v +} + return nil +} + +func (p *RemoveRangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveRangeReq"); 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 *RemoveRangeReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *RemoveRangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) } + return err +} + +func (p *RemoveRangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) } + return err +} + +func (p *RemoveRangeReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("RemoveRangeReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Segment +// - Start +// - End +type ScanReq struct { + Segment []byte `thrift:"segment,1" db:"segment" json:"segment"` + Start []byte `thrift:"start,2" db:"start" json:"start"` + End []byte `thrift:"end,3" db:"end" json:"end"` +} + +func NewScanReq() *ScanReq { + return &ScanReq{} +} + + +func (p *ScanReq) GetSegment() []byte { + return p.Segment +} + +func (p *ScanReq) GetStart() []byte { + return p.Start +} + +func (p *ScanReq) GetEnd() []byte { + return p.End +} +func (p *ScanReq) 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 *ScanReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Segment = v +} + return nil +} + +func (p *ScanReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Start = v +} + return nil +} + +func (p *ScanReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.End = v +} + return nil +} + +func (p *ScanReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanReq"); 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 *ScanReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("segment", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment: ", p), err) } + if err := oprot.WriteBinary(p.Segment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment: ", p), err) } + return err +} + +func (p *ScanReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:start: ", p), err) } + if err := oprot.WriteBinary(p.Start); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:start: ", p), err) } + return err +} + +func (p *ScanReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:end: ", p), err) } + if err := oprot.WriteBinary(p.End); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:end: ", p), err) } + return err +} + +func (p *ScanReq) String() string { + if p == nil { + return "" + } + + segmentVal := fmt.Sprintf("%v", p.Segment) + startVal := fmt.Sprintf("%v", p.Start) + endVal := fmt.Sprintf("%v", p.End) + return fmt.Sprintf("ScanReq({Segment:%s Start:%s End:%s})", segmentVal, startVal, endVal) +} + +// Attributes: +// - Code +// - Leader +// - Values +type ScanResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Values [][]byte `thrift:"values,3" db:"values" json:"values"` +} + +func NewScanResp() *ScanResp { + return &ScanResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ScanResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ScanResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ScanResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ScanResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ScanResp) GetValues() [][]byte { + return p.Values +} +func (p *ScanResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ScanResp) 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) ReadField3(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.Values = tSlice + for i := 0; i < size; i ++ { +var _elem41 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem41 = v +} + p.Values = append(p.Values, _elem41) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanResp"); 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 *ScanResp) 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 *ScanResp) 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 *ScanResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err) } + return err +} + +func (p *ScanResp) 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) + } + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("ScanResp({Code:%s Leader:%s Values:%s})", codeVal, leaderVal, valuesVal) +} + +// Attributes: +// - Code +// - Leader +// - ClusterID +// - LastUpdateTimeInMs +// - MetaVersion +type HBResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LastUpdateTimeInMs int64 `thrift:"last_update_time_in_ms,4" db:"last_update_time_in_ms" json:"last_update_time_in_ms"` + MetaVersion int32 `thrift:"meta_version,5" db:"meta_version" json:"meta_version"` +} + +func NewHBResp() *HBResp { + return &HBResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *HBResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var HBResp_Leader_DEFAULT *nebula0.HostAddr +func (p *HBResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return HBResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *HBResp) GetClusterID() ClusterID { + return p.ClusterID +} + +func (p *HBResp) GetLastUpdateTimeInMs() int64 { + return p.LastUpdateTimeInMs +} + +func (p *HBResp) GetMetaVersion() int32 { + return p.MetaVersion +} +func (p *HBResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *HBResp) 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 + } + 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 *HBResp) 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 *HBResp) 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 *HBResp) 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 *HBResp) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.LastUpdateTimeInMs = v +} + return nil +} + +func (p *HBResp) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.MetaVersion = v +} + return nil +} + +func (p *HBResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBResp"); 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 *HBResp) 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 *HBResp) 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 *HBResp) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("last_update_time_in_ms", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:last_update_time_in_ms: ", p), err) } + if err := oprot.WriteI64(int64(p.LastUpdateTimeInMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.last_update_time_in_ms (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:last_update_time_in_ms: ", p), err) } + return err +} + +func (p *HBResp) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_version", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:meta_version: ", p), err) } + if err := oprot.WriteI32(int32(p.MetaVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_version (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:meta_version: ", p), err) } + return err +} + +func (p *HBResp) 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) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + lastUpdateTimeInMsVal := fmt.Sprintf("%v", p.LastUpdateTimeInMs) + metaVersionVal := fmt.Sprintf("%v", p.MetaVersion) + return fmt.Sprintf("HBResp({Code:%s Leader:%s ClusterID:%s LastUpdateTimeInMs:%s MetaVersion:%s})", codeVal, leaderVal, clusterIDVal, lastUpdateTimeInMsVal, metaVersionVal) +} + +// Attributes: +// - PartID +// - Term +type LeaderInfo struct { + PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Term int64 `thrift:"term,2" db:"term" json:"term"` +} + +func NewLeaderInfo() *LeaderInfo { + return &LeaderInfo{} +} + + +func (p *LeaderInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *LeaderInfo) GetTerm() int64 { + return p.Term +} +func (p *LeaderInfo) 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 *LeaderInfo) 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 *LeaderInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *LeaderInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderInfo"); 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 *LeaderInfo) 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 *LeaderInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) } + if err := oprot.WriteI64(int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) } + return err +} + +func (p *LeaderInfo) String() string { + if p == nil { + return "" + } + + partIDVal := fmt.Sprintf("%v", p.PartID) + termVal := fmt.Sprintf("%v", p.Term) + return fmt.Sprintf("LeaderInfo({PartID:%s Term:%s})", partIDVal, termVal) +} + +// Attributes: +// - Role +// - Host +// - ClusterID +// - LeaderPartIds +// - GitInfoSha +// - Version +type HBReq struct { + Role HostRole `thrift:"role,1" db:"role" json:"role"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LeaderPartIds map[nebula0.GraphSpaceID][]*LeaderInfo `thrift:"leader_partIds,4" db:"leader_partIds" json:"leader_partIds,omitempty"` + GitInfoSha []byte `thrift:"git_info_sha,5" db:"git_info_sha" json:"git_info_sha"` + Version []byte `thrift:"version,6" db:"version" json:"version,omitempty"` +} + +func NewHBReq() *HBReq { + return &HBReq{ + Host: nebula0.NewHostAddr(), + } +} + + +func (p *HBReq) GetRole() HostRole { + return p.Role +} +var HBReq_Host_DEFAULT *nebula0.HostAddr +func (p *HBReq) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return HBReq_Host_DEFAULT + } +return p.Host +} + +func (p *HBReq) GetClusterID() ClusterID { + return p.ClusterID +} +var HBReq_LeaderPartIds_DEFAULT map[nebula0.GraphSpaceID][]*LeaderInfo + +func (p *HBReq) GetLeaderPartIds() map[nebula0.GraphSpaceID][]*LeaderInfo { + return p.LeaderPartIds +} + +func (p *HBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} +var HBReq_Version_DEFAULT []byte + +func (p *HBReq) GetVersion() []byte { + return p.Version +} +func (p *HBReq) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *HBReq) IsSetLeaderPartIds() bool { + return p != nil && p.LeaderPartIds != nil +} + +func (p *HBReq) IsSetVersion() bool { + return p != nil && p.Version != nil +} + +func (p *HBReq) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HBReq) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HBReq) 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 *HBReq) ReadField4(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]*LeaderInfo, size) + p.LeaderPartIds = tMap + for i := 0; i < size; i ++ { +var _key42 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key42 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*LeaderInfo, 0, size) + _val43 := tSlice + for i := 0; i < size; i ++ { + _elem44 := NewLeaderInfo() + if err := _elem44.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + } + _val43 = append(_val43, _elem44) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderPartIds[_key42] = _val43 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HBReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *HBReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HBReq"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HBReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) } + if err := oprot.WriteI32(int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) } + return err +} + +func (p *HBReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *HBReq) writeField3(oprot thrift.Protocol) (err error) { + 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 *HBReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetLeaderPartIds() { + if err := oprot.WriteFieldBegin("leader_partIds", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:leader_partIds: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderPartIds)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderPartIds { + 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 4:leader_partIds: ", p), err) } + } + return err +} + +func (p *HBReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:git_info_sha: ", p), err) } + if err := oprot.WriteBinary(p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:git_info_sha: ", p), err) } + return err +} + +func (p *HBReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:version: ", p), err) } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:version: ", p), err) } + } + return err +} + +func (p *HBReq) String() string { + if p == nil { + return "" + } + + roleVal := fmt.Sprintf("%v", p.Role) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + clusterIDVal := fmt.Sprintf("%v", p.ClusterID) + leaderPartIdsVal := fmt.Sprintf("%v", p.LeaderPartIds) + gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("HBReq({Role:%s Host:%s ClusterID:%s LeaderPartIds:%s GitInfoSha:%s Version:%s})", roleVal, hostVal, clusterIDVal, leaderPartIdsVal, gitInfoShaVal, versionVal) +} + +// Attributes: +// - Name +// - TypeLength +type IndexFieldDef struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + TypeLength *int16 `thrift:"type_length,2" db:"type_length" json:"type_length,omitempty"` +} + +func NewIndexFieldDef() *IndexFieldDef { + return &IndexFieldDef{} +} + + +func (p *IndexFieldDef) GetName() []byte { + return p.Name +} +var IndexFieldDef_TypeLength_DEFAULT int16 +func (p *IndexFieldDef) GetTypeLength() int16 { + if !p.IsSetTypeLength() { + return IndexFieldDef_TypeLength_DEFAULT + } +return *p.TypeLength +} +func (p *IndexFieldDef) IsSetTypeLength() bool { + return p != nil && p.TypeLength != nil +} + +func (p *IndexFieldDef) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName 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 + } + issetName = 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + return nil +} + +func (p *IndexFieldDef) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexFieldDef) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = &v +} + return nil +} + +func (p *IndexFieldDef) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexFieldDef"); 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 *IndexFieldDef) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexFieldDef) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin("type_length", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type_length: ", p), err) } + if err := oprot.WriteI16(int16(*p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *IndexFieldDef) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + var typeLengthVal string + if p.TypeLength == nil { + typeLengthVal = "" + } else { + typeLengthVal = fmt.Sprintf("%v", *p.TypeLength) + } + return fmt.Sprintf("IndexFieldDef({Name:%s TypeLength:%s})", nameVal, typeLengthVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - TagName +// - Fields +// - IfNotExists +// - Comment +type CreateTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + TagName []byte `thrift:"tag_name,3" db:"tag_name" json:"tag_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateTagIndexReq() *CreateTagIndexReq { + return &CreateTagIndexReq{} +} + + +func (p *CreateTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateTagIndexReq) GetTagName() []byte { + return p.TagName +} + +func (p *CreateTagIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateTagIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} +var CreateTagIndexReq_Comment_DEFAULT []byte + +func (p *CreateTagIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateTagIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateTagIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem45 := NewIndexFieldDef() + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + } + p.Fields = append(p.Fields, _elem45) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateTagIndexReq) 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 *CreateTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tag_name: ", p), err) } + if err := oprot.WriteBinary(p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *CreateTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + tagNameVal := fmt.Sprintf("%v", p.TagName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropTagIndexReq() *DropTagIndexReq { + return &DropTagIndexReq{} +} + + +func (p *DropTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropTagIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagIndexReq) 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 *DropTagIndexReq) 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 *DropTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropTagIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropTagIndexReq"); 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 *DropTagIndexReq) 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 *DropTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropTagIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropTagIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetTagIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetTagIndexReq() *GetTagIndexReq { + return &GetTagIndexReq{} +} + + +func (p *GetTagIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetTagIndexReq) 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 *GetTagIndexReq) 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 *GetTagIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetTagIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexReq"); 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 *GetTagIndexReq) 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 *GetTagIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetTagIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetTagIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetTagIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetTagIndexResp() *GetTagIndexResp { + return &GetTagIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + + +func (p *GetTagIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetTagIndexResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetTagIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetTagIndexResp_Leader_DEFAULT + } +return p.Leader +} +var GetTagIndexResp_Item_DEFAULT *IndexItem +func (p *GetTagIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetTagIndexResp_Item_DEFAULT + } +return p.Item +} +func (p *GetTagIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetTagIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetTagIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetTagIndexResp"); 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 *GetTagIndexResp) 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 *GetTagIndexResp) 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 *GetTagIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetTagIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetTagIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListTagIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagIndexesReq() *ListTagIndexesReq { + return &ListTagIndexesReq{} +} + + +func (p *ListTagIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagIndexesReq) 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesReq"); 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 *ListTagIndexesReq) 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 *ListTagIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListTagIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListTagIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListTagIndexesResp() *ListTagIndexesResp { + return &ListTagIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListTagIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListTagIndexesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListTagIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListTagIndexesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListTagIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListTagIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem46 := NewIndexItem() + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Items = append(p.Items, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListTagIndexesResp"); 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) 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 *ListTagIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListTagIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListTagIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - EdgeName +// - Fields +// - IfNotExists +// - Comment +type CreateEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + EdgeName []byte `thrift:"edge_name,3" db:"edge_name" json:"edge_name"` + Fields []*IndexFieldDef `thrift:"fields,4" db:"fields" json:"fields"` + IfNotExists bool `thrift:"if_not_exists,5" db:"if_not_exists" json:"if_not_exists"` + Comment []byte `thrift:"comment,6" db:"comment" json:"comment,omitempty"` +} + +func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { + return &CreateEdgeIndexReq{} +} + + +func (p *CreateEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *CreateEdgeIndexReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *CreateEdgeIndexReq) GetFields() []*IndexFieldDef { + return p.Fields +} + +func (p *CreateEdgeIndexReq) GetIfNotExists() bool { + return p.IfNotExists +} +var CreateEdgeIndexReq_Comment_DEFAULT []byte + +func (p *CreateEdgeIndexReq) GetComment() []byte { + return p.Comment +} +func (p *CreateEdgeIndexReq) IsSetComment() bool { + return p != nil && p.Comment != nil +} + +func (p *CreateEdgeIndexReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexFieldDef, 0, size) + p.Fields = tSlice + for i := 0; i < size; i ++ { + _elem47 := NewIndexFieldDef() + if err := _elem47.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + } + p.Fields = append(p.Fields, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateEdgeIndexReq) 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 *CreateEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_name: ", p), err) } + if err := oprot.WriteBinary(p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin("comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *CreateEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + edgeNameVal := fmt.Sprintf("%v", p.EdgeName) + fieldsVal := fmt.Sprintf("%v", p.Fields) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + commentVal := fmt.Sprintf("%v", p.Comment) + return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal) +} + +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + IfExists bool `thrift:"if_exists,3" db:"if_exists" json:"if_exists"` +} + +func NewDropEdgeIndexReq() *DropEdgeIndexReq { + return &DropEdgeIndexReq{} +} + + +func (p *DropEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropEdgeIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeIndexReq) 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropEdgeIndexReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropEdgeIndexReq"); 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 *DropEdgeIndexReq) 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 *DropEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropEdgeIndexReq({SpaceID:%s IndexName:%s IfExists:%s})", spaceIDVal, indexNameVal, ifExistsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type GetEdgeIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewGetEdgeIndexReq() *GetEdgeIndexReq { + return &GetEdgeIndexReq{} +} + + +func (p *GetEdgeIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetEdgeIndexReq) 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetEdgeIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexReq"); 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 *GetEdgeIndexReq) 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 *GetEdgeIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetEdgeIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("GetEdgeIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Item +type GetEdgeIndexResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Item *IndexItem `thrift:"item,3" db:"item" json:"item"` +} + +func NewGetEdgeIndexResp() *GetEdgeIndexResp { + return &GetEdgeIndexResp{ + Leader: nebula0.NewHostAddr(), + Item: NewIndexItem(), + } +} + + +func (p *GetEdgeIndexResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetEdgeIndexResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetEdgeIndexResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetEdgeIndexResp_Leader_DEFAULT + } +return p.Leader +} +var GetEdgeIndexResp_Item_DEFAULT *IndexItem +func (p *GetEdgeIndexResp) GetItem() *IndexItem { + if !p.IsSetItem() { + return GetEdgeIndexResp_Item_DEFAULT + } +return p.Item +} +func (p *GetEdgeIndexResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetEdgeIndexResp) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) ReadField3(iprot thrift.Protocol) error { + p.Item = NewIndexItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetEdgeIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetEdgeIndexResp"); 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) 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 *GetEdgeIndexResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetEdgeIndexResp) 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) + } + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetEdgeIndexResp({Code:%s Leader:%s Item:%s})", codeVal, leaderVal, itemVal) +} + +// Attributes: +// - SpaceID +type ListEdgeIndexesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgeIndexesReq() *ListEdgeIndexesReq { + return &ListEdgeIndexesReq{} +} + + +func (p *ListEdgeIndexesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesReq"); 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 *ListEdgeIndexesReq) 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 *ListEdgeIndexesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListEdgeIndexesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListEdgeIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*IndexItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListEdgeIndexesResp() *ListEdgeIndexesResp { + return &ListEdgeIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListEdgeIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListEdgeIndexesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListEdgeIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListEdgeIndexesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListEdgeIndexesResp) GetItems() []*IndexItem { + return p.Items +} +func (p *ListEdgeIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem48 := NewIndexItem() + if err := _elem48.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.Items = append(p.Items, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgeIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListEdgeIndexesResp"); 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) 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 *ListEdgeIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListEdgeIndexesResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListEdgeIndexesResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - SpaceID +// - IndexName +type RebuildIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` +} + +func NewRebuildIndexReq() *RebuildIndexReq { + return &RebuildIndexReq{} +} + + +func (p *RebuildIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *RebuildIndexReq) 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 *RebuildIndexReq) 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 *RebuildIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *RebuildIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexReq"); 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 *RebuildIndexReq) 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 *RebuildIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_name: ", p), err) } + if err := oprot.WriteBinary(p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *RebuildIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + indexNameVal := fmt.Sprintf("%v", p.IndexName) + return fmt.Sprintf("RebuildIndexReq({SpaceID:%s IndexName:%s})", spaceIDVal, indexNameVal) +} + +// Attributes: +// - Account +// - EncodedPwd +// - IfNotExists +type CreateUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` + IfNotExists bool `thrift:"if_not_exists,3" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateUserReq() *CreateUserReq { + return &CreateUserReq{} +} + + +func (p *CreateUserReq) GetAccount() []byte { + return p.Account +} + +func (p *CreateUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} + +func (p *CreateUserReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateUserReq) 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 *CreateUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *CreateUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *CreateUserReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateUserReq"); 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 *CreateUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) } + return err +} + +func (p *CreateUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + return fmt.Sprintf("CreateUserReq({Account:%s EncodedPwd:%s IfNotExists:%s})", accountVal, encodedPwdVal, ifNotExistsVal) +} + +// Attributes: +// - Account +// - IfExists +type DropUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + IfExists bool `thrift:"if_exists,2" db:"if_exists" json:"if_exists"` +} + +func NewDropUserReq() *DropUserReq { + return &DropUserReq{} +} + + +func (p *DropUserReq) GetAccount() []byte { + return p.Account +} + +func (p *DropUserReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropUserReq) 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 *DropUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *DropUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropUserReq"); 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 *DropUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *DropUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_exists", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:if_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + ifExistsVal := fmt.Sprintf("%v", p.IfExists) + return fmt.Sprintf("DropUserReq({Account:%s IfExists:%s})", accountVal, ifExistsVal) +} + +// Attributes: +// - Account +// - EncodedPwd +type AlterUserReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + EncodedPwd []byte `thrift:"encoded_pwd,2" db:"encoded_pwd" json:"encoded_pwd"` +} + +func NewAlterUserReq() *AlterUserReq { + return &AlterUserReq{} +} + + +func (p *AlterUserReq) GetAccount() []byte { + return p.Account +} + +func (p *AlterUserReq) GetEncodedPwd() []byte { + return p.EncodedPwd +} +func (p *AlterUserReq) 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 *AlterUserReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *AlterUserReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *AlterUserReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AlterUserReq"); 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 *AlterUserReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *AlterUserReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *AlterUserReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + encodedPwdVal := fmt.Sprintf("%v", p.EncodedPwd) + return fmt.Sprintf("AlterUserReq({Account:%s EncodedPwd:%s})", accountVal, encodedPwdVal) +} + +// Attributes: +// - RoleItem +type GrantRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewGrantRoleReq() *GrantRoleReq { + return &GrantRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var GrantRoleReq_RoleItem_DEFAULT *RoleItem +func (p *GrantRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return GrantRoleReq_RoleItem_DEFAULT + } +return p.RoleItem +} +func (p *GrantRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *GrantRoleReq) 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 *GrantRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *GrantRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GrantRoleReq"); 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 *GrantRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *GrantRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("GrantRoleReq({RoleItem:%s})", roleItemVal) +} + +// Attributes: +// - RoleItem +type RevokeRoleReq struct { + RoleItem *RoleItem `thrift:"role_item,1" db:"role_item" json:"role_item"` +} + +func NewRevokeRoleReq() *RevokeRoleReq { + return &RevokeRoleReq{ + RoleItem: NewRoleItem(), + } +} + +var RevokeRoleReq_RoleItem_DEFAULT *RoleItem +func (p *RevokeRoleReq) GetRoleItem() *RoleItem { + if !p.IsSetRoleItem() { + return RevokeRoleReq_RoleItem_DEFAULT + } +return p.RoleItem +} +func (p *RevokeRoleReq) IsSetRoleItem() bool { + return p != nil && p.RoleItem != nil +} + +func (p *RevokeRoleReq) 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 *RevokeRoleReq) ReadField1(iprot thrift.Protocol) error { + p.RoleItem = NewRoleItem() + if err := p.RoleItem.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *RevokeRoleReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RevokeRoleReq"); 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 *RevokeRoleReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("role_item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_item: ", p), err) } + if err := p.RoleItem.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *RevokeRoleReq) String() string { + if p == nil { + return "" + } + + var roleItemVal string + if p.RoleItem == nil { + roleItemVal = "" + } else { + roleItemVal = fmt.Sprintf("%v", p.RoleItem) + } + return fmt.Sprintf("RevokeRoleReq({RoleItem:%s})", roleItemVal) +} + +type ListUsersReq struct { +} + +func NewListUsersReq() *ListUsersReq { + return &ListUsersReq{} +} + +func (p *ListUsersReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListUsersReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListUsersReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Users +type ListUsersResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Users map[string][]byte `thrift:"users,3" db:"users" json:"users"` +} + +func NewListUsersResp() *ListUsersResp { + return &ListUsersResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListUsersResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListUsersResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListUsersResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListUsersResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListUsersResp) GetUsers() map[string][]byte { + return p.Users +} +func (p *ListUsersResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.Users = tMap + for i := 0; i < size; i ++ { +var _key49 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key49 = v +} +var _val50 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val50 = v +} + p.Users[_key49] = _val50 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListUsersResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListUsersResp"); 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 *ListUsersResp) 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 *ListUsersResp) 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 *ListUsersResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("users", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:users: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Users)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Users { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:users: ", p), err) } + return err +} + +func (p *ListUsersResp) 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) + } + usersVal := fmt.Sprintf("%v", p.Users) + return fmt.Sprintf("ListUsersResp({Code:%s Leader:%s Users:%s})", codeVal, leaderVal, usersVal) +} + +// Attributes: +// - SpaceID +type ListRolesReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListRolesReq() *ListRolesReq { + return &ListRolesReq{} +} + + +func (p *ListRolesReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListRolesReq) 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 *ListRolesReq) 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 *ListRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesReq"); 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 *ListRolesReq) 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 *ListRolesReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListRolesReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Roles +type ListRolesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Roles []*RoleItem `thrift:"roles,3" db:"roles" json:"roles"` +} + +func NewListRolesResp() *ListRolesResp { + return &ListRolesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListRolesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListRolesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListRolesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListRolesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListRolesResp) GetRoles() []*RoleItem { + return p.Roles +} +func (p *ListRolesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*RoleItem, 0, size) + p.Roles = tSlice + for i := 0; i < size; i ++ { + _elem51 := NewRoleItem() + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + } + p.Roles = append(p.Roles, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListRolesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListRolesResp"); 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 *ListRolesResp) 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 *ListRolesResp) 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 *ListRolesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("roles", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:roles: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Roles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Roles { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:roles: ", p), err) } + return err +} + +func (p *ListRolesResp) 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) + } + rolesVal := fmt.Sprintf("%v", p.Roles) + return fmt.Sprintf("ListRolesResp({Code:%s Leader:%s Roles:%s})", codeVal, leaderVal, rolesVal) +} + +// Attributes: +// - Account +type GetUserRolesReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` +} + +func NewGetUserRolesReq() *GetUserRolesReq { + return &GetUserRolesReq{} +} + + +func (p *GetUserRolesReq) GetAccount() []byte { + return p.Account +} +func (p *GetUserRolesReq) 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 *GetUserRolesReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *GetUserRolesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUserRolesReq"); 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 *GetUserRolesReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *GetUserRolesReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + return fmt.Sprintf("GetUserRolesReq({Account:%s})", accountVal) +} + +// Attributes: +// - Account +// - NewEncodedPwd_ +// - OldEncodedPwd +type ChangePasswordReq struct { + Account []byte `thrift:"account,1" db:"account" json:"account"` + NewEncodedPwd_ []byte `thrift:"new_encoded_pwd,2" db:"new_encoded_pwd" json:"new_encoded_pwd"` + OldEncodedPwd []byte `thrift:"old_encoded_pwd,3" db:"old_encoded_pwd" json:"old_encoded_pwd"` +} + +func NewChangePasswordReq() *ChangePasswordReq { + return &ChangePasswordReq{} +} + + +func (p *ChangePasswordReq) GetAccount() []byte { + return p.Account +} + +func (p *ChangePasswordReq) GetNewEncodedPwd_() []byte { + return p.NewEncodedPwd_ +} + +func (p *ChangePasswordReq) GetOldEncodedPwd() []byte { + return p.OldEncodedPwd +} +func (p *ChangePasswordReq) 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 *ChangePasswordReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.NewEncodedPwd_ = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OldEncodedPwd = v +} + return nil +} + +func (p *ChangePasswordReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChangePasswordReq"); 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 *ChangePasswordReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_encoded_pwd", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.NewEncodedPwd_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("old_encoded_pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:old_encoded_pwd: ", p), err) } + if err := oprot.WriteBinary(p.OldEncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_encoded_pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:old_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) String() string { + if p == nil { + return "" + } + + accountVal := fmt.Sprintf("%v", p.Account) + newEncodedPwdVal := fmt.Sprintf("%v", p.NewEncodedPwd_) + oldEncodedPwdVal := fmt.Sprintf("%v", p.OldEncodedPwd) + return fmt.Sprintf("ChangePasswordReq({Account:%s NewEncodedPwd_:%s OldEncodedPwd:%s})", accountVal, newEncodedPwdVal, oldEncodedPwdVal) +} + +// Attributes: +// - SpaceID +// - Id +// - HostDel +// - Stop +// - Reset +type BalanceReq struct { + SpaceID *nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + Id *int64 `thrift:"id,2" db:"id" json:"id,omitempty"` + HostDel []*nebula0.HostAddr `thrift:"host_del,3" db:"host_del" json:"host_del,omitempty"` + Stop *bool `thrift:"stop,4" db:"stop" json:"stop,omitempty"` + Reset *bool `thrift:"reset,5" db:"reset" json:"reset,omitempty"` +} + +func NewBalanceReq() *BalanceReq { + return &BalanceReq{} +} + +var BalanceReq_SpaceID_DEFAULT nebula0.GraphSpaceID +func (p *BalanceReq) GetSpaceID() nebula0.GraphSpaceID { + if !p.IsSetSpaceID() { + return BalanceReq_SpaceID_DEFAULT + } +return *p.SpaceID +} +var BalanceReq_Id_DEFAULT int64 +func (p *BalanceReq) GetId() int64 { + if !p.IsSetId() { + return BalanceReq_Id_DEFAULT + } +return *p.Id +} +var BalanceReq_HostDel_DEFAULT []*nebula0.HostAddr + +func (p *BalanceReq) GetHostDel() []*nebula0.HostAddr { + return p.HostDel +} +var BalanceReq_Stop_DEFAULT bool +func (p *BalanceReq) GetStop() bool { + if !p.IsSetStop() { + return BalanceReq_Stop_DEFAULT + } +return *p.Stop +} +var BalanceReq_Reset_DEFAULT bool +func (p *BalanceReq) GetReset() bool { + if !p.IsSetReset() { + return BalanceReq_Reset_DEFAULT + } +return *p.Reset +} +func (p *BalanceReq) IsSetSpaceID() bool { + return p != nil && p.SpaceID != nil +} + +func (p *BalanceReq) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *BalanceReq) IsSetHostDel() bool { + return p != nil && p.HostDel != nil +} + +func (p *BalanceReq) IsSetStop() bool { + return p != nil && p.Stop != nil +} + +func (p *BalanceReq) IsSetReset() bool { + return p != nil && p.Reset != nil +} + +func (p *BalanceReq) 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 + } + 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 *BalanceReq) 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 *BalanceReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = &v +} + return nil +} + +func (p *BalanceReq) ReadField3(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.HostDel = tSlice + for i := 0; i < size; i ++ { + _elem52 := nebula0.NewHostAddr() + if err := _elem52.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.HostDel = append(p.HostDel, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Stop = &v +} + return nil +} + +func (p *BalanceReq) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Reset = &v +} + return nil +} + +func (p *BalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceReq"); 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 *BalanceReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaceID() { + 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 *BalanceReq) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetId() { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(*p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetHostDel() { + if err := oprot.WriteFieldBegin("host_del", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_del: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HostDel)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HostDel { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host_del: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStop() { + if err := oprot.WriteFieldBegin("stop", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop: ", p), err) } + if err := oprot.WriteBool(bool(*p.Stop)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop: ", p), err) } + } + return err +} + +func (p *BalanceReq) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetReset() { + if err := oprot.WriteFieldBegin("reset", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:reset: ", p), err) } + if err := oprot.WriteBool(bool(*p.Reset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reset (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:reset: ", p), err) } + } + return err +} + +func (p *BalanceReq) String() string { + if p == nil { + return "" + } + + var spaceIDVal string + if p.SpaceID == nil { + spaceIDVal = "" + } else { + spaceIDVal = fmt.Sprintf("%v", *p.SpaceID) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", *p.Id) + } + hostDelVal := fmt.Sprintf("%v", p.HostDel) + var stopVal string + if p.Stop == nil { + stopVal = "" + } else { + stopVal = fmt.Sprintf("%v", *p.Stop) + } + var resetVal string + if p.Reset == nil { + resetVal = "" + } else { + resetVal = fmt.Sprintf("%v", *p.Reset) + } + return fmt.Sprintf("BalanceReq({SpaceID:%s Id:%s HostDel:%s Stop:%s Reset:%s})", spaceIDVal, idVal, hostDelVal, stopVal, resetVal) +} + +// Attributes: +// - Id +// - Result_ +type BalanceTask struct { + Id []byte `thrift:"id,1" db:"id" json:"id"` + Result_ TaskResult_ `thrift:"result,2" db:"result" json:"result"` +} + +func NewBalanceTask() *BalanceTask { + return &BalanceTask{} +} + + +func (p *BalanceTask) GetId() []byte { + return p.Id +} + +func (p *BalanceTask) GetResult_() TaskResult_ { + return p.Result_ +} +func (p *BalanceTask) 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 *BalanceTask) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *BalanceTask) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TaskResult_(v) + p.Result_ = temp +} + return nil +} + +func (p *BalanceTask) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceTask"); 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 *BalanceTask) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := oprot.WriteBinary(p.Id); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *BalanceTask) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:result: ", p), err) } + if err := oprot.WriteI32(int32(p.Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.result (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:result: ", p), err) } + return err +} + +func (p *BalanceTask) String() string { + if p == nil { + return "" + } + + idVal := fmt.Sprintf("%v", p.Id) + resultVal := fmt.Sprintf("%v", p.Result_) + return fmt.Sprintf("BalanceTask({Id:%s Result_:%s})", idVal, resultVal) +} + +// Attributes: +// - Code +// - Id +// - Leader +// - Tasks +type BalanceResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Id int64 `thrift:"id,2" db:"id" json:"id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` + Tasks []*BalanceTask `thrift:"tasks,4" db:"tasks" json:"tasks"` +} + +func NewBalanceResp() *BalanceResp { + return &BalanceResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *BalanceResp) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *BalanceResp) GetId() int64 { + return p.Id +} +var BalanceResp_Leader_DEFAULT *nebula0.HostAddr +func (p *BalanceResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return BalanceResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *BalanceResp) GetTasks() []*BalanceTask { + return p.Tasks +} +func (p *BalanceResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *BalanceResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Id = v +} + return nil +} + +func (p *BalanceResp) ReadField3(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 *BalanceResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BalanceTask, 0, size) + p.Tasks = tSlice + for i := 0; i < size; i ++ { + _elem53 := NewBalanceTask() + if err := _elem53.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) + } + p.Tasks = append(p.Tasks, _elem53) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BalanceResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BalanceResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BalanceResp) 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 *BalanceResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(int64(p.Id)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *BalanceResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + return err +} + +func (p *BalanceResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tasks", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tasks: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tasks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tasks { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tasks: ", p), err) } + return err +} + +func (p *BalanceResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + idVal := fmt.Sprintf("%v", p.Id) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + tasksVal := fmt.Sprintf("%v", p.Tasks) + return fmt.Sprintf("BalanceResp({Code:%s Id:%s Leader:%s Tasks:%s})", codeVal, idVal, leaderVal, tasksVal) +} + +type LeaderBalanceReq struct { +} + +func NewLeaderBalanceReq() *LeaderBalanceReq { + return &LeaderBalanceReq{} +} + +func (p *LeaderBalanceReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LeaderBalanceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LeaderBalanceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LeaderBalanceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("LeaderBalanceReq({})") +} + +// Attributes: +// - Module +// - Name +// - Mode +// - Value +type ConfigItem struct { + Module ConfigModule `thrift:"module,1" db:"module" json:"module"` + Name []byte `thrift:"name,2" db:"name" json:"name"` + Mode ConfigMode `thrift:"mode,3" db:"mode" json:"mode"` + Value *nebula0.Value `thrift:"value,4" db:"value" json:"value"` +} + +func NewConfigItem() *ConfigItem { + return &ConfigItem{} +} + + +func (p *ConfigItem) GetModule() ConfigModule { + return p.Module +} + +func (p *ConfigItem) GetName() []byte { + return p.Name +} + +func (p *ConfigItem) GetMode() ConfigMode { + return p.Mode +} +var ConfigItem_Value_DEFAULT *nebula0.Value +func (p *ConfigItem) GetValue() *nebula0.Value { + if !p.IsSetValue() { + return ConfigItem_Value_DEFAULT + } +return p.Value +} +func (p *ConfigItem) IsSetValue() bool { + return p != nil && p.Value != nil +} + +func (p *ConfigItem) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ConfigItem) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ConfigItem) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ConfigItem) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ConfigMode(v) + p.Mode = temp +} + return nil +} + +func (p *ConfigItem) ReadField4(iprot thrift.Protocol) error { + p.Value = nebula0.NewValue() + if err := p.Value.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ConfigItem) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ConfigItem"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ConfigItem) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:module: ", p), err) } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:module: ", p), err) } + return err +} + +func (p *ConfigItem) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *ConfigItem) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err) } + if err := oprot.WriteI32(int32(p.Mode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err) } + return err +} + +func (p *ConfigItem) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) } + if err := p.Value.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) } + return err +} + +func (p *ConfigItem) String() string { + if p == nil { + return "" + } + + moduleVal := fmt.Sprintf("%v", p.Module) + nameVal := fmt.Sprintf("%v", p.Name) + modeVal := fmt.Sprintf("%v", p.Mode) + var valueVal string + if p.Value == nil { + valueVal = "" + } else { + valueVal = fmt.Sprintf("%v", p.Value) + } + return fmt.Sprintf("ConfigItem({Module:%s Name:%s Mode:%s Value:%s})", moduleVal, nameVal, modeVal, valueVal) +} + +// Attributes: +// - Items +type RegConfigReq struct { + Items []*ConfigItem `thrift:"items,1" db:"items" json:"items"` +} + +func NewRegConfigReq() *RegConfigReq { + return &RegConfigReq{} +} + + +func (p *RegConfigReq) GetItems() []*ConfigItem { + return p.Items +} +func (p *RegConfigReq) 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 *RegConfigReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem54 := NewConfigItem() + if err := _elem54.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.Items = append(p.Items, _elem54) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RegConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RegConfigReq"); 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 *RegConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:items: ", p), err) } + return err +} + +func (p *RegConfigReq) String() string { + if p == nil { + return "" + } + + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("RegConfigReq({Items:%s})", itemsVal) +} + +// Attributes: +// - Item +type GetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewGetConfigReq() *GetConfigReq { + return &GetConfigReq{ + Item: NewConfigItem(), + } +} + +var GetConfigReq_Item_DEFAULT *ConfigItem +func (p *GetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return GetConfigReq_Item_DEFAULT + } +return p.Item +} +func (p *GetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *GetConfigReq) 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 *GetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigReq"); 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 *GetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *GetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("GetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type GetConfigResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewGetConfigResp() *GetConfigResp { + return &GetConfigResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *GetConfigResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetConfigResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetConfigResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetConfigResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetConfigResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *GetConfigResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem55 := NewConfigItem() + if err := _elem55.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) + } + p.Items = append(p.Items, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetConfigResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetConfigResp"); 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 *GetConfigResp) 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 *GetConfigResp) 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 *GetConfigResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *GetConfigResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("GetConfigResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +// Attributes: +// - Item +type SetConfigReq struct { + Item *ConfigItem `thrift:"item,1" db:"item" json:"item"` +} + +func NewSetConfigReq() *SetConfigReq { + return &SetConfigReq{ + Item: NewConfigItem(), + } +} + +var SetConfigReq_Item_DEFAULT *ConfigItem +func (p *SetConfigReq) GetItem() *ConfigItem { + if !p.IsSetItem() { + return SetConfigReq_Item_DEFAULT + } +return p.Item +} +func (p *SetConfigReq) IsSetItem() bool { + return p != nil && p.Item != nil +} + +func (p *SetConfigReq) 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 *SetConfigReq) ReadField1(iprot thrift.Protocol) error { + p.Item = NewConfigItem() + if err := p.Item.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *SetConfigReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SetConfigReq"); 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 *SetConfigReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("item", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:item: ", p), err) } + if err := p.Item.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *SetConfigReq) String() string { + if p == nil { + return "" + } + + var itemVal string + if p.Item == nil { + itemVal = "" + } else { + itemVal = fmt.Sprintf("%v", p.Item) + } + return fmt.Sprintf("SetConfigReq({Item:%s})", itemVal) +} + +// Attributes: +// - Space +// - Module +type ListConfigsReq struct { + Space []byte `thrift:"space,1" db:"space" json:"space"` + Module ConfigModule `thrift:"module,2" db:"module" json:"module"` +} + +func NewListConfigsReq() *ListConfigsReq { + return &ListConfigsReq{} +} + + +func (p *ListConfigsReq) GetSpace() []byte { + return p.Space +} + +func (p *ListConfigsReq) GetModule() ConfigModule { + return p.Module +} +func (p *ListConfigsReq) 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 *ListConfigsReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Space = v +} + return nil +} + +func (p *ListConfigsReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ListConfigsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsReq"); 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 *ListConfigsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) } + if err := oprot.WriteBinary(p.Space); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *ListConfigsReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("module", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:module: ", p), err) } + if err := oprot.WriteI32(int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:module: ", p), err) } + return err +} + +func (p *ListConfigsReq) String() string { + if p == nil { + return "" + } + + spaceVal := fmt.Sprintf("%v", p.Space) + moduleVal := fmt.Sprintf("%v", p.Module) + return fmt.Sprintf("ListConfigsReq({Space:%s Module:%s})", spaceVal, moduleVal) +} + +// Attributes: +// - Code +// - Leader +// - Items +type ListConfigsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Items []*ConfigItem `thrift:"items,3" db:"items" json:"items"` +} + +func NewListConfigsResp() *ListConfigsResp { + return &ListConfigsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListConfigsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListConfigsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListConfigsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListConfigsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListConfigsResp) GetItems() []*ConfigItem { + return p.Items +} +func (p *ListConfigsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ConfigItem, 0, size) + p.Items = tSlice + for i := 0; i < size; i ++ { + _elem56 := NewConfigItem() + if err := _elem56.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Items = append(p.Items, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListConfigsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListConfigsResp"); 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 *ListConfigsResp) 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 *ListConfigsResp) 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 *ListConfigsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListConfigsResp) 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) + } + itemsVal := fmt.Sprintf("%v", p.Items) + return fmt.Sprintf("ListConfigsResp({Code:%s Leader:%s Items:%s})", codeVal, leaderVal, itemsVal) +} + +type CreateSnapshotReq struct { +} + +func NewCreateSnapshotReq() *CreateSnapshotReq { + return &CreateSnapshotReq{} +} + +func (p *CreateSnapshotReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSnapshotReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("CreateSnapshotReq({})") +} + +// Attributes: +// - Name +type DropSnapshotReq struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` +} + +func NewDropSnapshotReq() *DropSnapshotReq { + return &DropSnapshotReq{} +} + + +func (p *DropSnapshotReq) GetName() []byte { + return p.Name +} +func (p *DropSnapshotReq) 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 *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 +} + return nil +} + +func (p *DropSnapshotReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropSnapshotReq"); 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 *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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *DropSnapshotReq) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropSnapshotReq({Name:%s})", nameVal) +} + +type ListSnapshotsReq struct { +} + +func NewListSnapshotsReq() *ListSnapshotsReq { + return &ListSnapshotsReq{} +} + +func (p *ListSnapshotsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSnapshotsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSnapshotsReq({})") +} + +// Attributes: +// - Name +// - Status +// - Hosts +type Snapshot struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status SnapshotStatus `thrift:"status,2" db:"status" json:"status"` + Hosts []byte `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewSnapshot() *Snapshot { + return &Snapshot{} +} + + +func (p *Snapshot) GetName() []byte { + return p.Name +} + +func (p *Snapshot) GetStatus() SnapshotStatus { + return p.Status +} + +func (p *Snapshot) GetHosts() []byte { + return p.Hosts +} +func (p *Snapshot) 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 *Snapshot) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Snapshot) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := SnapshotStatus(v) + p.Status = temp +} + return nil +} + +func (p *Snapshot) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Hosts = v +} + return nil +} + +func (p *Snapshot) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Snapshot"); 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 *Snapshot) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Snapshot) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *Snapshot) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteBinary(p.Hosts); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hosts (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *Snapshot) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("Snapshot({Name:%s Status:%s Hosts:%s})", nameVal, statusVal, hostsVal) +} + +// Attributes: +// - Code +// - Leader +// - Snapshots +type ListSnapshotsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Snapshots []*Snapshot `thrift:"snapshots,3" db:"snapshots" json:"snapshots"` +} + +func NewListSnapshotsResp() *ListSnapshotsResp { + return &ListSnapshotsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListSnapshotsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListSnapshotsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSnapshotsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSnapshotsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSnapshotsResp) GetSnapshots() []*Snapshot { + return p.Snapshots +} +func (p *ListSnapshotsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Snapshot, 0, size) + p.Snapshots = tSlice + for i := 0; i < size; i ++ { + _elem57 := NewSnapshot() + if err := _elem57.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) + } + p.Snapshots = append(p.Snapshots, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSnapshotsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSnapshotsResp"); 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) 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 *ListSnapshotsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("snapshots", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:snapshots: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Snapshots)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Snapshots { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:snapshots: ", p), err) } + return err +} + +func (p *ListSnapshotsResp) 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) + } + snapshotsVal := fmt.Sprintf("%v", p.Snapshots) + return fmt.Sprintf("ListSnapshotsResp({Code:%s Leader:%s Snapshots:%s})", codeVal, leaderVal, snapshotsVal) +} + +// Attributes: +// - SpaceID +type ListIndexStatusReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListIndexStatusReq() *ListIndexStatusReq { + return &ListIndexStatusReq{} +} + + +func (p *ListIndexStatusReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListIndexStatusReq) 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusReq"); 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 *ListIndexStatusReq) 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 *ListIndexStatusReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListIndexStatusReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Name +// - Status +type IndexStatus struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Status []byte `thrift:"status,2" db:"status" json:"status"` +} + +func NewIndexStatus() *IndexStatus { + return &IndexStatus{} +} + + +func (p *IndexStatus) GetName() []byte { + return p.Name +} + +func (p *IndexStatus) GetStatus() []byte { + return p.Status +} +func (p *IndexStatus) 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 *IndexStatus) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexStatus) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Status = v +} + return nil +} + +func (p *IndexStatus) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexStatus"); 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 *IndexStatus) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexStatus) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteBinary(p.Status); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *IndexStatus) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("IndexStatus({Name:%s Status:%s})", nameVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Statuses +type ListIndexStatusResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Statuses []*IndexStatus `thrift:"statuses,3" db:"statuses" json:"statuses"` +} + +func NewListIndexStatusResp() *ListIndexStatusResp { + return &ListIndexStatusResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListIndexStatusResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListIndexStatusResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListIndexStatusResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListIndexStatusResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListIndexStatusResp) GetStatuses() []*IndexStatus { + return p.Statuses +} +func (p *ListIndexStatusResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) 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 *ListIndexStatusResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*IndexStatus, 0, size) + p.Statuses = tSlice + for i := 0; i < size; i ++ { + _elem58 := NewIndexStatus() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Statuses = append(p.Statuses, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } + if err := p.Leader.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + statusesVal := fmt.Sprintf("%v", p.Statuses) + return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) +} + +// Attributes: +// - ZoneName +// - Nodes +type AddZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewAddZoneReq() *AddZoneReq { + return &AddZoneReq{} +} + + +func (p *AddZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneReq) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *AddZoneReq) 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 *AddZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddZoneReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i ++ { + _elem59 := nebula0.NewHostAddr() + if err := _elem59.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Nodes = append(p.Nodes, _elem59) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneReq"); err != nil { + 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 *AddZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *AddZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) } + return err +} + +func (p *AddZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("AddZoneReq({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - ZoneName +type DropZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewDropZoneReq() *DropZoneReq { + return &DropZoneReq{} +} + + +func (p *DropZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropZoneReq) 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 *DropZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DropZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type AddHostIntoZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewAddHostIntoZoneReq() *AddHostIntoZoneReq { + return &AddHostIntoZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var AddHostIntoZoneReq_Node_DEFAULT *nebula0.HostAddr +func (p *AddHostIntoZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return AddHostIntoZoneReq_Node_DEFAULT + } +return p.Node +} + +func (p *AddHostIntoZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *AddHostIntoZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *AddHostIntoZoneReq) 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 *AddHostIntoZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *AddHostIntoZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddHostIntoZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddHostIntoZoneReq"); 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 *AddHostIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) } + return err +} + +func (p *AddHostIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *AddHostIntoZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("AddHostIntoZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - Node +// - ZoneName +type DropHostFromZoneReq struct { + Node *nebula0.HostAddr `thrift:"node,1" db:"node" json:"node"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewDropHostFromZoneReq() *DropHostFromZoneReq { + return &DropHostFromZoneReq{ + Node: nebula0.NewHostAddr(), + } +} + +var DropHostFromZoneReq_Node_DEFAULT *nebula0.HostAddr +func (p *DropHostFromZoneReq) GetNode() *nebula0.HostAddr { + if !p.IsSetNode() { + return DropHostFromZoneReq_Node_DEFAULT + } +return p.Node +} + +func (p *DropHostFromZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *DropHostFromZoneReq) IsSetNode() bool { + return p != nil && p.Node != nil +} + +func (p *DropHostFromZoneReq) 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 *DropHostFromZoneReq) ReadField1(iprot thrift.Protocol) error { + p.Node = nebula0.NewHostAddr() + if err := p.Node.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Node), err) + } + return nil +} + +func (p *DropHostFromZoneReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropHostFromZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropHostFromZoneReq"); 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 *DropHostFromZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("node", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:node: ", p), err) } + if err := p.Node.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Node), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:node: ", p), err) } + return err +} + +func (p *DropHostFromZoneReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *DropHostFromZoneReq) String() string { + if p == nil { + return "" + } + + var nodeVal string + if p.Node == nil { + nodeVal = "" + } else { + nodeVal = fmt.Sprintf("%v", p.Node) + } + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("DropHostFromZoneReq({Node:%s ZoneName:%s})", nodeVal, zoneNameVal) +} + +// Attributes: +// - ZoneName +type GetZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` +} + +func NewGetZoneReq() *GetZoneReq { + return &GetZoneReq{} +} + + +func (p *GetZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *GetZoneReq) 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 *GetZoneReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *GetZoneReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneReq"); 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 *GetZoneReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *GetZoneReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + return fmt.Sprintf("GetZoneReq({ZoneName:%s})", zoneNameVal) +} + +// Attributes: +// - Code +// - Leader +// - Hosts +type GetZoneResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewGetZoneResp() *GetZoneResp { + return &GetZoneResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *GetZoneResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetZoneResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetZoneResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetZoneResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetZoneResp) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *GetZoneResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) ReadField3(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 ++ { + _elem60 := nebula0.NewHostAddr() + if err := _elem60.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) + } + p.Hosts = append(p.Hosts, _elem60) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetZoneResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetZoneResp"); 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 *GetZoneResp) 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 *GetZoneResp) 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 *GetZoneResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *GetZoneResp) 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) + } + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("GetZoneResp({Code:%s Leader:%s Hosts:%s})", codeVal, leaderVal, hostsVal) +} + +type ListZonesReq struct { +} + +func NewListZonesReq() *ListZonesReq { + return &ListZonesReq{} +} + +func (p *ListZonesReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListZonesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListZonesReq({})") +} + +// Attributes: +// - ZoneName +// - Nodes +type Zone struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula0.HostAddr `thrift:"nodes,2" db:"nodes" json:"nodes"` +} + +func NewZone() *Zone { + return &Zone{} +} + + +func (p *Zone) GetZoneName() []byte { + return p.ZoneName +} + +func (p *Zone) GetNodes() []*nebula0.HostAddr { + return p.Nodes +} +func (p *Zone) 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 *Zone) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *Zone) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i ++ { + _elem61 := nebula0.NewHostAddr() + if err := _elem61.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem61), err) + } + p.Nodes = append(p.Nodes, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Zone) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Zone"); 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 *Zone) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *Zone) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) } + return err +} + +func (p *Zone) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + nodesVal := fmt.Sprintf("%v", p.Nodes) + return fmt.Sprintf("Zone({ZoneName:%s Nodes:%s})", zoneNameVal, nodesVal) +} + +// Attributes: +// - Code +// - Leader +// - Zones +type ListZonesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Zones []*Zone `thrift:"zones,3" db:"zones" json:"zones"` +} + +func NewListZonesResp() *ListZonesResp { + return &ListZonesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListZonesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListZonesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListZonesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListZonesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListZonesResp) GetZones() []*Zone { + return p.Zones +} +func (p *ListZonesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Zone, 0, size) + p.Zones = tSlice + for i := 0; i < size; i ++ { + _elem62 := NewZone() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Zones = append(p.Zones, _elem62) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListZonesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListZonesResp"); 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 *ListZonesResp) 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 *ListZonesResp) 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 *ListZonesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zones", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zones: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zones: ", p), err) } + return err +} + +func (p *ListZonesResp) 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) + } + zonesVal := fmt.Sprintf("%v", p.Zones) + return fmt.Sprintf("ListZonesResp({Code:%s Leader:%s Zones:%s})", codeVal, leaderVal, zonesVal) +} + +// Attributes: +// - GroupName +// - ZoneNames +type AddGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewAddGroupReq() *AddGroupReq { + return &AddGroupReq{} +} + + +func (p *AddGroupReq) GetGroupName() []byte { + return p.GroupName +} + +func (p *AddGroupReq) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *AddGroupReq) 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 *AddGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *AddGroupReq) 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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem63 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem63 = v +} + p.ZoneNames = append(p.ZoneNames, _elem63) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddGroupReq"); 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 *AddGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *AddGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) } + return err +} + +func (p *AddGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("AddGroupReq({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - GroupName +type DropGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewDropGroupReq() *DropGroupReq { + return &DropGroupReq{} +} + + +func (p *DropGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropGroupReq) 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 *DropGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *DropGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropGroupReq"); 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 *DropGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *DropGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type AddZoneIntoGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewAddZoneIntoGroupReq() *AddZoneIntoGroupReq { + return &AddZoneIntoGroupReq{} +} + + +func (p *AddZoneIntoGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddZoneIntoGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *AddZoneIntoGroupReq) 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 *AddZoneIntoGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddZoneIntoGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *AddZoneIntoGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddZoneIntoGroupReq"); 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 *AddZoneIntoGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *AddZoneIntoGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) } + return err +} + +func (p *AddZoneIntoGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("AddZoneIntoGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - ZoneName +// - GroupName +type DropZoneFromGroupReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + GroupName []byte `thrift:"group_name,2" db:"group_name" json:"group_name"` +} + +func NewDropZoneFromGroupReq() *DropZoneFromGroupReq { + return &DropZoneFromGroupReq{} +} + + +func (p *DropZoneFromGroupReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *DropZoneFromGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *DropZoneFromGroupReq) 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 *DropZoneFromGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropZoneFromGroupReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *DropZoneFromGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropZoneFromGroupReq"); 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 *DropZoneFromGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zone_name: ", p), err) } + if err := oprot.WriteBinary(p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DropZoneFromGroupReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:group_name: ", p), err) } + return err +} + +func (p *DropZoneFromGroupReq) String() string { + if p == nil { + return "" + } + + zoneNameVal := fmt.Sprintf("%v", p.ZoneName) + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("DropZoneFromGroupReq({ZoneName:%s GroupName:%s})", zoneNameVal, groupNameVal) +} + +// Attributes: +// - GroupName +type GetGroupReq struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` +} + +func NewGetGroupReq() *GetGroupReq { + return &GetGroupReq{} +} + + +func (p *GetGroupReq) GetGroupName() []byte { + return p.GroupName +} +func (p *GetGroupReq) 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 *GetGroupReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *GetGroupReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupReq"); 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 *GetGroupReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *GetGroupReq) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + return fmt.Sprintf("GetGroupReq({GroupName:%s})", groupNameVal) +} + +// Attributes: +// - Code +// - Leader +// - ZoneNames +type GetGroupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ZoneNames [][]byte `thrift:"zone_names,3" db:"zone_names" json:"zone_names"` +} + +func NewGetGroupResp() *GetGroupResp { + return &GetGroupResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *GetGroupResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetGroupResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetGroupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetGroupResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetGroupResp) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *GetGroupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) ReadField3(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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem64 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem64 = v +} + p.ZoneNames = append(p.ZoneNames, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetGroupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetGroupResp"); 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 *GetGroupResp) 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 *GetGroupResp) 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 *GetGroupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zone_names: ", p), err) } + return err +} + +func (p *GetGroupResp) 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) + } + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("GetGroupResp({Code:%s Leader:%s ZoneNames:%s})", codeVal, leaderVal, zoneNamesVal) +} + +type ListGroupsReq struct { +} + +func NewListGroupsReq() *ListGroupsReq { + return &ListGroupsReq{} +} + +func (p *ListGroupsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListGroupsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListGroupsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListGroupsReq({})") +} + +// Attributes: +// - GroupName +// - ZoneNames +type Group struct { + GroupName []byte `thrift:"group_name,1" db:"group_name" json:"group_name"` + ZoneNames [][]byte `thrift:"zone_names,2" db:"zone_names" json:"zone_names"` +} + +func NewGroup() *Group { + return &Group{} +} + + +func (p *Group) GetGroupName() []byte { + return p.GroupName +} + +func (p *Group) GetZoneNames() [][]byte { + return p.ZoneNames +} +func (p *Group) 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 *Group) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GroupName = v +} + return nil +} + +func (p *Group) 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.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem65 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem65 = v +} + p.ZoneNames = append(p.ZoneNames, _elem65) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Group) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Group"); 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 *Group) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("group_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:group_name: ", p), err) } + if err := oprot.WriteBinary(p.GroupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.group_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:group_name: ", p), err) } + return err +} + +func (p *Group) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_names: ", p), err) } + return err +} + +func (p *Group) String() string { + if p == nil { + return "" + } + + groupNameVal := fmt.Sprintf("%v", p.GroupName) + zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) + return fmt.Sprintf("Group({GroupName:%s ZoneNames:%s})", groupNameVal, zoneNamesVal) +} + +// Attributes: +// - Code +// - Leader +// - Groups +type ListGroupsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Groups []*Group `thrift:"groups,3" db:"groups" json:"groups"` +} + +func NewListGroupsResp() *ListGroupsResp { + return &ListGroupsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListGroupsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListGroupsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListGroupsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListGroupsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListGroupsResp) GetGroups() []*Group { + return p.Groups +} +func (p *ListGroupsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Group, 0, size) + p.Groups = tSlice + for i := 0; i < size; i ++ { + _elem66 := NewGroup() + if err := _elem66.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + p.Groups = append(p.Groups, _elem66) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListGroupsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListGroupsResp"); 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 *ListGroupsResp) 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 *ListGroupsResp) 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 *ListGroupsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("groups", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:groups: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Groups)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Groups { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:groups: ", p), err) } + return err +} + +func (p *ListGroupsResp) 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) + } + groupsVal := fmt.Sprintf("%v", p.Groups) + return fmt.Sprintf("ListGroupsResp({Code:%s Leader:%s Groups:%s})", codeVal, leaderVal, groupsVal) +} + +// Attributes: +// - SpaceID +// - Type +// - Hosts +type AddListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` + Hosts []*nebula0.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewAddListenerReq() *AddListenerReq { + return &AddListenerReq{} +} + + +func (p *AddListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddListenerReq) GetType() ListenerType { + return p.Type +} + +func (p *AddListenerReq) GetHosts() []*nebula0.HostAddr { + return p.Hosts +} +func (p *AddListenerReq) 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 *AddListenerReq) 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 *AddListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *AddListenerReq) ReadField3(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 ++ { + _elem67 := nebula0.NewHostAddr() + if err := _elem67.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) + } + p.Hosts = append(p.Hosts, _elem67) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddListenerReq"); 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 *AddListenerReq) 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 *AddListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *AddListenerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:hosts: ", p), err) } + return err +} + +func (p *AddListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("AddListenerReq({SpaceID:%s Type:%s Hosts:%s})", spaceIDVal, typeVal, hostsVal) +} + +// Attributes: +// - SpaceID +// - Type +type RemoveListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` +} + +func NewRemoveListenerReq() *RemoveListenerReq { + return &RemoveListenerReq{} +} + + +func (p *RemoveListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemoveListenerReq) GetType() ListenerType { + return p.Type +} +func (p *RemoveListenerReq) 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 *RemoveListenerReq) 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 *RemoveListenerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *RemoveListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveListenerReq"); 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 *RemoveListenerReq) 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 *RemoveListenerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *RemoveListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + typeVal := fmt.Sprintf("%v", p.Type) + return fmt.Sprintf("RemoveListenerReq({SpaceID:%s Type:%s})", spaceIDVal, typeVal) +} + +// Attributes: +// - SpaceID +type ListListenerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListListenerReq() *ListListenerReq { + return &ListListenerReq{} +} + + +func (p *ListListenerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *ListListenerReq) 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 *ListListenerReq) 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 *ListListenerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerReq"); 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 *ListListenerReq) 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 *ListListenerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("ListListenerReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Type +// - Host +// - PartID +// - Status +type ListenerInfo struct { + Type ListenerType `thrift:"type,1" db:"type" json:"type"` + Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` + PartID nebula0.PartitionID `thrift:"part_id,3" db:"part_id" json:"part_id"` + Status HostStatus `thrift:"status,4" db:"status" json:"status"` +} + +func NewListenerInfo() *ListenerInfo { + return &ListenerInfo{ + Host: nebula0.NewHostAddr(), + } +} + + +func (p *ListenerInfo) GetType() ListenerType { + return p.Type +} +var ListenerInfo_Host_DEFAULT *nebula0.HostAddr +func (p *ListenerInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return ListenerInfo_Host_DEFAULT + } +return p.Host +} + +func (p *ListenerInfo) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *ListenerInfo) GetStatus() HostStatus { + return p.Status +} +func (p *ListenerInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *ListenerInfo) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListenerInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *ListenerInfo) ReadField2(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ListenerInfo) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ListenerInfo) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *ListenerInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListenerInfo"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListenerInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *ListenerInfo) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + partIDVal := fmt.Sprintf("%v", p.PartID) + statusVal := fmt.Sprintf("%v", p.Status) + return fmt.Sprintf("ListenerInfo({Type:%s Host:%s PartID:%s Status:%s})", typeVal, hostVal, partIDVal, statusVal) +} + +// Attributes: +// - Code +// - Leader +// - Listeners +type ListListenerResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Listeners []*ListenerInfo `thrift:"listeners,3" db:"listeners" json:"listeners"` +} + +func NewListListenerResp() *ListListenerResp { + return &ListListenerResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListListenerResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListListenerResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListListenerResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListListenerResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListListenerResp) GetListeners() []*ListenerInfo { + return p.Listeners +} +func (p *ListListenerResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ListenerInfo, 0, size) + p.Listeners = tSlice + for i := 0; i < size; i ++ { + _elem68 := NewListenerInfo() + if err := _elem68.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + } + p.Listeners = append(p.Listeners, _elem68) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListListenerResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListListenerResp"); 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 *ListListenerResp) 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 *ListListenerResp) 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 *ListListenerResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("listeners", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:listeners: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Listeners { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:listeners: ", p), err) } + return err +} + +func (p *ListListenerResp) 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) + } + listenersVal := fmt.Sprintf("%v", p.Listeners) + return fmt.Sprintf("ListListenerResp({Code:%s Leader:%s Listeners:%s})", codeVal, leaderVal, listenersVal) +} + +// Attributes: +// - SpaceID +type GetStatsReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetStatsReq() *GetStatsReq { + return &GetStatsReq{} +} + + +func (p *GetStatsReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +func (p *GetStatsReq) 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 *GetStatsReq) 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 *GetStatsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatsReq"); 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 *GetStatsReq) 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 *GetStatsReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + return fmt.Sprintf("GetStatsReq({SpaceID:%s})", spaceIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Stats +type GetStatsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Stats *StatsItem `thrift:"stats,3" db:"stats" json:"stats"` +} + +func NewGetStatsResp() *GetStatsResp { + return &GetStatsResp{ + Leader: nebula0.NewHostAddr(), + Stats: NewStatsItem(), + } +} + + +func (p *GetStatsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetStatsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetStatsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetStatsResp_Leader_DEFAULT + } +return p.Leader +} +var GetStatsResp_Stats_DEFAULT *StatsItem +func (p *GetStatsResp) GetStats() *StatsItem { + if !p.IsSetStats() { + return GetStatsResp_Stats_DEFAULT + } +return p.Stats +} +func (p *GetStatsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetStatsResp) IsSetStats() bool { + return p != nil && p.Stats != nil +} + +func (p *GetStatsResp) 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 *GetStatsResp) 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 *GetStatsResp) 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 *GetStatsResp) ReadField3(iprot thrift.Protocol) error { + p.Stats = NewStatsItem() + if err := p.Stats.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *GetStatsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetStatsResp"); 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 *GetStatsResp) 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 *GetStatsResp) 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 *GetStatsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stats: ", p), err) } + if err := p.Stats.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stats: ", p), err) } + return err +} + +func (p *GetStatsResp) 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) + } + var statsVal string + if p.Stats == nil { + statsVal = "" + } else { + statsVal = fmt.Sprintf("%v", p.Stats) + } + return fmt.Sprintf("GetStatsResp({Code:%s Leader:%s Stats:%s})", codeVal, leaderVal, statsVal) +} + +// Attributes: +// - Host +// - Info +type BackupInfo struct { + Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewBackupInfo() *BackupInfo { + return &BackupInfo{ + Host: nebula0.NewHostAddr(), + } +} + +var BackupInfo_Host_DEFAULT *nebula0.HostAddr +func (p *BackupInfo) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return BackupInfo_Host_DEFAULT + } +return p.Host +} + +func (p *BackupInfo) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *BackupInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *BackupInfo) 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 *BackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *BackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem69 := nebula0.NewCheckpointInfo() + if err := _elem69.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) + } + p.Info = append(p.Info, _elem69) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BackupInfo"); 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 *BackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *BackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) } + return err +} + +func (p *BackupInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("BackupInfo({Host:%s Info:%s})", hostVal, infoVal) +} + +// Attributes: +// - Space +// - Info +type SpaceBackupInfo struct { + Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` + Info []*BackupInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewSpaceBackupInfo() *SpaceBackupInfo { + return &SpaceBackupInfo{ + Space: NewSpaceDesc(), + } +} + +var SpaceBackupInfo_Space_DEFAULT *SpaceDesc +func (p *SpaceBackupInfo) GetSpace() *SpaceDesc { + if !p.IsSetSpace() { + return SpaceBackupInfo_Space_DEFAULT + } +return p.Space +} + +func (p *SpaceBackupInfo) GetInfo() []*BackupInfo { + return p.Info +} +func (p *SpaceBackupInfo) IsSetSpace() bool { + return p != nil && p.Space != nil +} + +func (p *SpaceBackupInfo) 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 *SpaceBackupInfo) ReadField1(iprot thrift.Protocol) error { + p.Space = NewSpaceDesc() + if err := p.Space.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Space), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BackupInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem70 := NewBackupInfo() + if err := _elem70.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) + } + p.Info = append(p.Info, _elem70) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SpaceBackupInfo"); 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 *SpaceBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) } + if err := p.Space.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Space), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) String() string { + if p == nil { + return "" + } + + var spaceVal string + if p.Space == nil { + spaceVal = "" + } else { + spaceVal = fmt.Sprintf("%v", p.Space) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("SpaceBackupInfo({Space:%s Info:%s})", spaceVal, infoVal) +} + +// Attributes: +// - BackupInfo +// - MetaFiles +// - BackupName +// - Full +// - IncludeSystemSpace +// - CreateTime +type BackupMeta struct { + BackupInfo map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"backup_info,1" db:"backup_info" json:"backup_info"` + MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` + BackupName []byte `thrift:"backup_name,3" db:"backup_name" json:"backup_name"` + Full bool `thrift:"full,4" db:"full" json:"full"` + IncludeSystemSpace bool `thrift:"include_system_space,5" db:"include_system_space" json:"include_system_space"` + CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` +} + +func NewBackupMeta() *BackupMeta { + return &BackupMeta{} +} + + +func (p *BackupMeta) GetBackupInfo() map[nebula0.GraphSpaceID]*SpaceBackupInfo { + return p.BackupInfo +} + +func (p *BackupMeta) GetMetaFiles() [][]byte { + return p.MetaFiles +} + +func (p *BackupMeta) GetBackupName() []byte { + return p.BackupName +} + +func (p *BackupMeta) GetFull() bool { + return p.Full +} + +func (p *BackupMeta) GetIncludeSystemSpace() bool { + return p.IncludeSystemSpace +} + +func (p *BackupMeta) GetCreateTime() int64 { + return p.CreateTime +} +func (p *BackupMeta) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BackupMeta) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID]*SpaceBackupInfo, size) + p.BackupInfo = tMap + for i := 0; i < size; i ++ { +var _key71 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key71 = temp +} + _val72 := NewSpaceBackupInfo() + if err := _val72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val72), err) + } + p.BackupInfo[_key71] = _val72 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BackupMeta) 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.MetaFiles = tSlice + for i := 0; i < size; i ++ { +var _elem73 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem73 = v +} + p.MetaFiles = append(p.MetaFiles, _elem73) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BackupName = v +} + return nil +} + +func (p *BackupMeta) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Full = v +} + return nil +} + +func (p *BackupMeta) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IncludeSystemSpace = v +} + return nil +} + +func (p *BackupMeta) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.CreateTime = v +} + 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) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BackupMeta) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.BackupInfo)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.BackupInfo { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_info: ", p), err) } + return err +} + +func (p *BackupMeta) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_files", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:meta_files: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.MetaFiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaFiles { + 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:meta_files: ", p), err) } + return err +} + +func (p *BackupMeta) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("backup_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_name: ", p), err) } + if err := oprot.WriteBinary(p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_name: ", p), err) } + return err +} + +func (p *BackupMeta) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("full", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:full: ", p), err) } + if err := oprot.WriteBool(bool(p.Full)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:full: ", p), err) } + return err +} + +func (p *BackupMeta) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("include_system_space", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:include_system_space: ", p), err) } + if err := oprot.WriteBool(bool(p.IncludeSystemSpace)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.include_system_space (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:include_system_space: ", p), err) } + return err +} + +func (p *BackupMeta) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:create_time: ", p), err) } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:create_time: ", p), err) } + return err +} + +func (p *BackupMeta) String() string { + if p == nil { + return "" + } + + backupInfoVal := fmt.Sprintf("%v", p.BackupInfo) + metaFilesVal := fmt.Sprintf("%v", p.MetaFiles) + backupNameVal := fmt.Sprintf("%v", p.BackupName) + fullVal := fmt.Sprintf("%v", p.Full) + includeSystemSpaceVal := fmt.Sprintf("%v", p.IncludeSystemSpace) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + return fmt.Sprintf("BackupMeta({BackupInfo:%s MetaFiles:%s BackupName:%s Full:%s IncludeSystemSpace:%s CreateTime:%s})", backupInfoVal, metaFilesVal, backupNameVal, fullVal, includeSystemSpaceVal, createTimeVal) +} + +// Attributes: +// - Spaces +type CreateBackupReq struct { + Spaces [][]byte `thrift:"spaces,1" db:"spaces" json:"spaces,omitempty"` +} + +func NewCreateBackupReq() *CreateBackupReq { + return &CreateBackupReq{} +} + +var CreateBackupReq_Spaces_DEFAULT [][]byte + +func (p *CreateBackupReq) GetSpaces() [][]byte { + return p.Spaces +} +func (p *CreateBackupReq) IsSetSpaces() bool { + return p != nil && p.Spaces != nil +} + +func (p *CreateBackupReq) 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 *CreateBackupReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Spaces = tSlice + for i := 0; i < size; i ++ { +var _elem74 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem74 = v +} + p.Spaces = append(p.Spaces, _elem74) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateBackupReq) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSpaces() { + if err := oprot.WriteFieldBegin("spaces", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spaces: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + 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:spaces: ", 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) +} + +// Attributes: +// - Code +// - Leader +// - Meta +type CreateBackupResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Meta *BackupMeta `thrift:"meta,3" db:"meta" json:"meta"` +} + +func NewCreateBackupResp() *CreateBackupResp { + return &CreateBackupResp{ + Leader: nebula0.NewHostAddr(), + Meta: NewBackupMeta(), + } +} + + +func (p *CreateBackupResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var CreateBackupResp_Leader_DEFAULT *nebula0.HostAddr +func (p *CreateBackupResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateBackupResp_Leader_DEFAULT + } +return p.Leader +} +var CreateBackupResp_Meta_DEFAULT *BackupMeta +func (p *CreateBackupResp) GetMeta() *BackupMeta { + if !p.IsSetMeta() { + return CreateBackupResp_Meta_DEFAULT + } +return p.Meta +} +func (p *CreateBackupResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateBackupResp) IsSetMeta() bool { + return p != nil && p.Meta != nil +} + +func (p *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) ReadField3(iprot thrift.Protocol) error { + p.Meta = NewBackupMeta() + if err := p.Meta.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Meta), err) + } + return nil +} + +func (p *CreateBackupResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateBackupResp"); 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 *CreateBackupResp) 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 *CreateBackupResp) 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 *CreateBackupResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta: ", p), err) } + if err := p.Meta.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Meta), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta: ", p), err) } + return err +} + +func (p *CreateBackupResp) 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) + } + var metaVal string + if p.Meta == nil { + metaVal = "" + } else { + metaVal = fmt.Sprintf("%v", p.Meta) + } + return fmt.Sprintf("CreateBackupResp({Code:%s Leader:%s Meta:%s})", codeVal, leaderVal, metaVal) +} + +// Attributes: +// - FromHost +// - ToHost +type HostPair struct { + FromHost *nebula0.HostAddr `thrift:"from_host,1" db:"from_host" json:"from_host"` + ToHost *nebula0.HostAddr `thrift:"to_host,2" db:"to_host" json:"to_host"` +} + +func NewHostPair() *HostPair { + return &HostPair{ + FromHost: nebula0.NewHostAddr(), + ToHost: nebula0.NewHostAddr(), + } +} + +var HostPair_FromHost_DEFAULT *nebula0.HostAddr +func (p *HostPair) GetFromHost() *nebula0.HostAddr { + if !p.IsSetFromHost() { + return HostPair_FromHost_DEFAULT + } +return p.FromHost +} +var HostPair_ToHost_DEFAULT *nebula0.HostAddr +func (p *HostPair) GetToHost() *nebula0.HostAddr { + if !p.IsSetToHost() { + return HostPair_ToHost_DEFAULT + } +return p.ToHost +} +func (p *HostPair) IsSetFromHost() bool { + return p != nil && p.FromHost != nil +} + +func (p *HostPair) IsSetToHost() bool { + return p != nil && p.ToHost != nil +} + +func (p *HostPair) 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 *HostPair) ReadField1(iprot thrift.Protocol) error { + p.FromHost = nebula0.NewHostAddr() + if err := p.FromHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.FromHost), err) + } + return nil +} + +func (p *HostPair) ReadField2(iprot thrift.Protocol) error { + p.ToHost = nebula0.NewHostAddr() + if err := p.ToHost.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ToHost), err) + } + return nil +} + +func (p *HostPair) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostPair"); 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 *HostPair) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("from_host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:from_host: ", p), err) } + if err := p.FromHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.FromHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:from_host: ", p), err) } + return err +} + +func (p *HostPair) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("to_host", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:to_host: ", p), err) } + if err := p.ToHost.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ToHost), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:to_host: ", p), err) } + return err +} + +func (p *HostPair) String() string { + if p == nil { + return "" + } + + var fromHostVal string + if p.FromHost == nil { + fromHostVal = "" + } else { + fromHostVal = fmt.Sprintf("%v", p.FromHost) + } + var toHostVal string + if p.ToHost == nil { + toHostVal = "" + } else { + toHostVal = fmt.Sprintf("%v", p.ToHost) + } + return fmt.Sprintf("HostPair({FromHost:%s ToHost:%s})", fromHostVal, toHostVal) +} + +// Attributes: +// - Files +// - Hosts +type RestoreMetaReq struct { + Files [][]byte `thrift:"files,1" db:"files" json:"files"` + Hosts []*HostPair `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewRestoreMetaReq() *RestoreMetaReq { + return &RestoreMetaReq{} +} + + +func (p *RestoreMetaReq) GetFiles() [][]byte { + return p.Files +} + +func (p *RestoreMetaReq) GetHosts() []*HostPair { + return p.Hosts +} +func (p *RestoreMetaReq) 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 *RestoreMetaReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Files = tSlice + for i := 0; i < size; i ++ { +var _elem75 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem75 = v +} + p.Files = append(p.Files, _elem75) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostPair, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem76 := NewHostPair() + if err := _elem76.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem76), err) + } + p.Hosts = append(p.Hosts, _elem76) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RestoreMetaReq"); 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 *RestoreMetaReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + 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:files: ", p), err) } + return err +} + +func (p *RestoreMetaReq) 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 *RestoreMetaReq) String() string { + if p == nil { + return "" + } + + filesVal := fmt.Sprintf("%v", p.Files) + hostsVal := fmt.Sprintf("%v", p.Hosts) + return fmt.Sprintf("RestoreMetaReq({Files:%s Hosts:%s})", filesVal, hostsVal) +} + +// Attributes: +// - Host +// - User +// - Pwd +type FTClient struct { + Host *nebula0.HostAddr `thrift:"host,1,required" db:"host" json:"host"` + User []byte `thrift:"user,2" db:"user" json:"user,omitempty"` + Pwd []byte `thrift:"pwd,3" db:"pwd" json:"pwd,omitempty"` +} + +func NewFTClient() *FTClient { + return &FTClient{ + Host: nebula0.NewHostAddr(), + } +} + +var FTClient_Host_DEFAULT *nebula0.HostAddr +func (p *FTClient) GetHost() *nebula0.HostAddr { + if !p.IsSetHost() { + return FTClient_Host_DEFAULT + } +return p.Host +} +var FTClient_User_DEFAULT []byte + +func (p *FTClient) GetUser() []byte { + return p.User +} +var FTClient_Pwd_DEFAULT []byte + +func (p *FTClient) GetPwd() []byte { + return p.Pwd +} +func (p *FTClient) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *FTClient) IsSetUser() bool { + return p != nil && p.User != nil +} + +func (p *FTClient) IsSetPwd() bool { + return p != nil && p.Pwd != nil +} + +func (p *FTClient) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHost 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 + } + issetHost = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHost{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")); + } + return nil +} + +func (p *FTClient) ReadField1(iprot thrift.Protocol) error { + p.Host = nebula0.NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *FTClient) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.User = v +} + return nil +} + +func (p *FTClient) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Pwd = v +} + return nil +} + +func (p *FTClient) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTClient"); 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 *FTClient) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *FTClient) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetUser() { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err) } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err) } + } + return err +} + +func (p *FTClient) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetPwd() { + if err := oprot.WriteFieldBegin("pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pwd: ", p), err) } + if err := oprot.WriteBinary(p.Pwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pwd: ", p), err) } + } + return err +} + +func (p *FTClient) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + userVal := fmt.Sprintf("%v", p.User) + pwdVal := fmt.Sprintf("%v", p.Pwd) + return fmt.Sprintf("FTClient({Host:%s User:%s Pwd:%s})", hostVal, userVal, pwdVal) +} + +// Attributes: +// - Type +// - Clients +type SignInFTServiceReq struct { + Type FTServiceType `thrift:"type,1" db:"type" json:"type"` + Clients []*FTClient `thrift:"clients,2" db:"clients" json:"clients"` +} + +func NewSignInFTServiceReq() *SignInFTServiceReq { + return &SignInFTServiceReq{} +} + + +func (p *SignInFTServiceReq) GetType() FTServiceType { + return p.Type +} + +func (p *SignInFTServiceReq) GetClients() []*FTClient { + return p.Clients +} +func (p *SignInFTServiceReq) 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 *SignInFTServiceReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := FTServiceType(v) + p.Type = temp +} + return nil +} + +func (p *SignInFTServiceReq) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i ++ { + _elem77 := NewFTClient() + if err := _elem77.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem77), err) + } + p.Clients = append(p.Clients, _elem77) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SignInFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignInFTServiceReq"); 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 *SignInFTServiceReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *SignInFTServiceReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:clients: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + 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:clients: ", p), err) } + return err +} + +func (p *SignInFTServiceReq) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("SignInFTServiceReq({Type:%s Clients:%s})", typeVal, clientsVal) +} + +type SignOutFTServiceReq struct { +} + +func NewSignOutFTServiceReq() *SignOutFTServiceReq { + return &SignOutFTServiceReq{} +} + +func (p *SignOutFTServiceReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignOutFTServiceReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("SignOutFTServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SignOutFTServiceReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("SignOutFTServiceReq({})") +} + +type ListFTClientsReq struct { +} + +func NewListFTClientsReq() *ListFTClientsReq { + return &ListFTClientsReq{} +} + +func (p *ListFTClientsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTClientsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListFTClientsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTClientsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Clients +type ListFTClientsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Clients []*FTClient `thrift:"clients,3" db:"clients" json:"clients"` +} + +func NewListFTClientsResp() *ListFTClientsResp { + return &ListFTClientsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListFTClientsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListFTClientsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListFTClientsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTClientsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListFTClientsResp) GetClients() []*FTClient { + return p.Clients +} +func (p *ListFTClientsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*FTClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i ++ { + _elem78 := NewFTClient() + if err := _elem78.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + } + p.Clients = append(p.Clients, _elem78) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListFTClientsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTClientsResp"); 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 *ListFTClientsResp) 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 *ListFTClientsResp) 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 *ListFTClientsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("clients", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:clients: ", p), err) } + return err +} + +func (p *ListFTClientsResp) 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) + } + clientsVal := fmt.Sprintf("%v", p.Clients) + return fmt.Sprintf("ListFTClientsResp({Code:%s Leader:%s Clients:%s})", codeVal, leaderVal, clientsVal) +} + +// Attributes: +// - SpaceID +// - DependSchema +// - Fields +type FTIndex struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + DependSchema *nebula0.SchemaID `thrift:"depend_schema,2" db:"depend_schema" json:"depend_schema"` + Fields [][]byte `thrift:"fields,3" db:"fields" json:"fields"` +} + +func NewFTIndex() *FTIndex { + return &FTIndex{} +} + + +func (p *FTIndex) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var FTIndex_DependSchema_DEFAULT *nebula0.SchemaID +func (p *FTIndex) GetDependSchema() *nebula0.SchemaID { + if !p.IsSetDependSchema() { + return FTIndex_DependSchema_DEFAULT + } +return p.DependSchema +} + +func (p *FTIndex) GetFields() [][]byte { + return p.Fields +} +func (p *FTIndex) IsSetDependSchema() bool { + return p != nil && p.DependSchema != nil +} + +func (p *FTIndex) 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 *FTIndex) 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 *FTIndex) ReadField2(iprot thrift.Protocol) error { + p.DependSchema = nebula0.NewSchemaID() + if err := p.DependSchema.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DependSchema), err) + } + return nil +} + +func (p *FTIndex) ReadField3(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.Fields = tSlice + for i := 0; i < size; i ++ { +var _elem79 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem79 = v +} + p.Fields = append(p.Fields, _elem79) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *FTIndex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("FTIndex"); 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 *FTIndex) 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 *FTIndex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("depend_schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:depend_schema: ", p), err) } + if err := p.DependSchema.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DependSchema), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:depend_schema: ", p), err) } + return err +} + +func (p *FTIndex) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fields", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fields: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fields: ", p), err) } + return err +} + +func (p *FTIndex) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + var dependSchemaVal string + if p.DependSchema == nil { + dependSchemaVal = "" + } else { + dependSchemaVal = fmt.Sprintf("%v", p.DependSchema) + } + fieldsVal := fmt.Sprintf("%v", p.Fields) + return fmt.Sprintf("FTIndex({SpaceID:%s DependSchema:%s Fields:%s})", spaceIDVal, dependSchemaVal, fieldsVal) +} + +// Attributes: +// - FulltextIndexName +// - Index +type CreateFTIndexReq struct { + FulltextIndexName []byte `thrift:"fulltext_index_name,1" db:"fulltext_index_name" json:"fulltext_index_name"` + Index *FTIndex `thrift:"index,2" db:"index" json:"index"` +} + +func NewCreateFTIndexReq() *CreateFTIndexReq { + return &CreateFTIndexReq{ + Index: NewFTIndex(), + } +} + + +func (p *CreateFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} +var CreateFTIndexReq_Index_DEFAULT *FTIndex +func (p *CreateFTIndexReq) GetIndex() *FTIndex { + if !p.IsSetIndex() { + return CreateFTIndexReq_Index_DEFAULT + } +return p.Index +} +func (p *CreateFTIndexReq) IsSetIndex() bool { + return p != nil && p.Index != nil +} + +func (p *CreateFTIndexReq) 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 *CreateFTIndexReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.FulltextIndexName = v +} + return nil +} + +func (p *CreateFTIndexReq) ReadField2(iprot thrift.Protocol) error { + p.Index = NewFTIndex() + if err := p.Index.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Index), err) + } + return nil +} + +func (p *CreateFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateFTIndexReq"); 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 *CreateFTIndexReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fulltext_index_name: ", p), err) } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fulltext_index_name: ", p), err) } + return err +} + +func (p *CreateFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index: ", p), err) } + if err := p.Index.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Index), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index: ", p), err) } + return err +} + +func (p *CreateFTIndexReq) String() string { + if p == nil { + return "" + } + + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + var indexVal string + if p.Index == nil { + indexVal = "" + } else { + indexVal = fmt.Sprintf("%v", p.Index) + } + return fmt.Sprintf("CreateFTIndexReq({FulltextIndexName:%s Index:%s})", fulltextIndexNameVal, indexVal) +} + +// Attributes: +// - SpaceID +// - FulltextIndexName +type DropFTIndexReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + FulltextIndexName []byte `thrift:"fulltext_index_name,2" db:"fulltext_index_name" json:"fulltext_index_name"` +} + +func NewDropFTIndexReq() *DropFTIndexReq { + return &DropFTIndexReq{} +} + + +func (p *DropFTIndexReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} +func (p *DropFTIndexReq) 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 *DropFTIndexReq) 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 *DropFTIndexReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.FulltextIndexName = v +} + return nil +} + +func (p *DropFTIndexReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropFTIndexReq"); 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 *DropFTIndexReq) 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 *DropFTIndexReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("fulltext_index_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fulltext_index_name: ", p), err) } + if err := oprot.WriteBinary(p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fulltext_index_name: ", p), err) } + return err +} + +func (p *DropFTIndexReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + fulltextIndexNameVal := fmt.Sprintf("%v", p.FulltextIndexName) + return fmt.Sprintf("DropFTIndexReq({SpaceID:%s FulltextIndexName:%s})", spaceIDVal, fulltextIndexNameVal) +} + +type ListFTIndexesReq struct { +} + +func NewListFTIndexesReq() *ListFTIndexesReq { + return &ListFTIndexesReq{} +} + +func (p *ListFTIndexesReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTIndexesReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListFTIndexesReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListFTIndexesReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Indexes +type ListFTIndexesResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Indexes map[string]*FTIndex `thrift:"indexes,3" db:"indexes" json:"indexes"` +} + +func NewListFTIndexesResp() *ListFTIndexesResp { + return &ListFTIndexesResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListFTIndexesResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListFTIndexesResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListFTIndexesResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListFTIndexesResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListFTIndexesResp) GetIndexes() map[string]*FTIndex { + return p.Indexes +} +func (p *ListFTIndexesResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*FTIndex, size) + p.Indexes = tMap + for i := 0; i < size; i ++ { +var _key80 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key80 = v +} + _val81 := NewFTIndex() + if err := _val81.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val81), err) + } + p.Indexes[_key80] = _val81 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListFTIndexesResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListFTIndexesResp"); 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) 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 *ListFTIndexesResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indexes", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indexes: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Indexes)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Indexes { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indexes: ", p), err) } + return err +} + +func (p *ListFTIndexesResp) 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) + } + indexesVal := fmt.Sprintf("%v", p.Indexes) + return fmt.Sprintf("ListFTIndexesResp({Code:%s Leader:%s Indexes:%s})", codeVal, leaderVal, indexesVal) +} + +// Attributes: +// - StartTime +// - Status +// - Duration +// - Query +// - GraphAddr +type QueryDesc struct { + StartTime nebula0.Timestamp `thrift:"start_time,1" db:"start_time" json:"start_time"` + Status QueryStatus `thrift:"status,2" db:"status" json:"status"` + Duration int64 `thrift:"duration,3" db:"duration" json:"duration"` + Query []byte `thrift:"query,4" db:"query" json:"query"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,5" db:"graph_addr" json:"graph_addr"` +} + +func NewQueryDesc() *QueryDesc { + return &QueryDesc{ + GraphAddr: nebula0.NewHostAddr(), + } +} + + +func (p *QueryDesc) GetStartTime() nebula0.Timestamp { + return p.StartTime +} + +func (p *QueryDesc) GetStatus() QueryStatus { + return p.Status +} + +func (p *QueryDesc) GetDuration() int64 { + return p.Duration +} + +func (p *QueryDesc) GetQuery() []byte { + return p.Query +} +var QueryDesc_GraphAddr_DEFAULT *nebula0.HostAddr +func (p *QueryDesc) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return QueryDesc_GraphAddr_DEFAULT + } +return p.GraphAddr +} +func (p *QueryDesc) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *QueryDesc) 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 + } + 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 *QueryDesc) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.Timestamp(v) + p.StartTime = temp +} + return nil +} + +func (p *QueryDesc) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := QueryStatus(v) + p.Status = temp +} + return nil +} + +func (p *QueryDesc) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Duration = v +} + return nil +} + +func (p *QueryDesc) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Query = v +} + return nil +} + +func (p *QueryDesc) ReadField5(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *QueryDesc) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("QueryDesc"); 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 *QueryDesc) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:start_time: ", p), err) } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_time: ", p), err) } + return err +} + +func (p *QueryDesc) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *QueryDesc) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("duration", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err) } + if err := oprot.WriteI64(int64(p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err) } + return err +} + +func (p *QueryDesc) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:query: ", p), err) } + if err := oprot.WriteBinary(p.Query); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.query (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:query: ", p), err) } + return err +} + +func (p *QueryDesc) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:graph_addr: ", p), err) } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:graph_addr: ", p), err) } + return err +} + +func (p *QueryDesc) String() string { + if p == nil { + return "" + } + + startTimeVal := fmt.Sprintf("%v", p.StartTime) + statusVal := fmt.Sprintf("%v", p.Status) + durationVal := fmt.Sprintf("%v", p.Duration) + queryVal := fmt.Sprintf("%v", p.Query) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + return fmt.Sprintf("QueryDesc({StartTime:%s Status:%s Duration:%s Query:%s GraphAddr:%s})", startTimeVal, statusVal, durationVal, queryVal, graphAddrVal) +} + +// Attributes: +// - SessionID +// - CreateTime +// - UpdateTime +// - UserName +// - SpaceName +// - GraphAddr +// - Timezone +// - ClientIP +// - Configs +// - Queries +type Session struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` + CreateTime nebula0.Timestamp `thrift:"create_time,2" db:"create_time" json:"create_time"` + UpdateTime nebula0.Timestamp `thrift:"update_time,3" db:"update_time" json:"update_time"` + UserName []byte `thrift:"user_name,4" db:"user_name" json:"user_name"` + SpaceName []byte `thrift:"space_name,5" db:"space_name" json:"space_name"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,6" db:"graph_addr" json:"graph_addr"` + Timezone int32 `thrift:"timezone,7" db:"timezone" json:"timezone"` + ClientIP []byte `thrift:"client_ip,8" db:"client_ip" json:"client_ip"` + Configs map[string]*nebula0.Value `thrift:"configs,9" db:"configs" json:"configs"` + Queries map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"queries,10" db:"queries" json:"queries"` +} + +func NewSession() *Session { + return &Session{ + GraphAddr: nebula0.NewHostAddr(), + } +} + + +func (p *Session) GetSessionID() nebula0.SessionID { + return p.SessionID +} + +func (p *Session) GetCreateTime() nebula0.Timestamp { + return p.CreateTime +} + +func (p *Session) GetUpdateTime() nebula0.Timestamp { + return p.UpdateTime +} + +func (p *Session) GetUserName() []byte { + return p.UserName +} + +func (p *Session) GetSpaceName() []byte { + return p.SpaceName +} +var Session_GraphAddr_DEFAULT *nebula0.HostAddr +func (p *Session) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return Session_GraphAddr_DEFAULT + } +return p.GraphAddr +} + +func (p *Session) GetTimezone() int32 { + return p.Timezone +} + +func (p *Session) GetClientIP() []byte { + return p.ClientIP +} + +func (p *Session) GetConfigs() map[string]*nebula0.Value { + return p.Configs +} + +func (p *Session) GetQueries() map[nebula0.ExecutionPlanID]*QueryDesc { + return p.Queries +} +func (p *Session) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *Session) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *Session) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *Session) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.Timestamp(v) + p.CreateTime = temp +} + return nil +} + +func (p *Session) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.Timestamp(v) + p.UpdateTime = temp +} + return nil +} + +func (p *Session) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.UserName = v +} + return nil +} + +func (p *Session) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *Session) ReadField6(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *Session) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Timezone = v +} + return nil +} + +func (p *Session) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *Session) ReadField9(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula0.Value, size) + p.Configs = tMap + for i := 0; i < size; i ++ { +var _key82 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key82 = v +} + _val83 := nebula0.NewValue() + if err := _val83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val83), err) + } + p.Configs[_key82] = _val83 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) ReadField10(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.Queries = tMap + for i := 0; i < size; i ++ { +var _key84 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.ExecutionPlanID(v) + _key84 = temp +} + _val85 := NewQueryDesc() + if err := _val85.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val85), err) + } + p.Queries[_key84] = _val85 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Session"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Session) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *Session) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("create_time", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:create_time: ", p), err) } + if err := oprot.WriteI64(int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:create_time: ", p), err) } + return err +} + +func (p *Session) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("update_time", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:update_time: ", p), err) } + if err := oprot.WriteI64(int64(p.UpdateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_time (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update_time: ", p), err) } + return err +} + +func (p *Session) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) } + if err := oprot.WriteBinary(p.UserName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) } + return err +} + +func (p *Session) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_name", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:space_name: ", p), err) } + if err := oprot.WriteBinary(p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:space_name: ", p), err) } + return err +} + +func (p *Session) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:graph_addr: ", p), err) } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:graph_addr: ", p), err) } + return err +} + +func (p *Session) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("timezone", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timezone: ", p), err) } + if err := oprot.WriteI32(int32(p.Timezone)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timezone (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timezone: ", p), err) } + return err +} + +func (p *Session) writeField8(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:client_ip: ", p), err) } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:client_ip: ", p), err) } + return err +} + +func (p *Session) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("configs", thrift.MAP, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:configs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Configs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:configs: ", p), err) } + return err +} + +func (p *Session) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("queries", thrift.MAP, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:queries: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.Queries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Queries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:queries: ", p), err) } + return err +} + +func (p *Session) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + createTimeVal := fmt.Sprintf("%v", p.CreateTime) + updateTimeVal := fmt.Sprintf("%v", p.UpdateTime) + userNameVal := fmt.Sprintf("%v", p.UserName) + spaceNameVal := fmt.Sprintf("%v", p.SpaceName) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + timezoneVal := fmt.Sprintf("%v", p.Timezone) + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + configsVal := fmt.Sprintf("%v", p.Configs) + queriesVal := fmt.Sprintf("%v", p.Queries) + return fmt.Sprintf("Session({SessionID:%s CreateTime:%s UpdateTime:%s UserName:%s SpaceName:%s GraphAddr:%s Timezone:%s ClientIP:%s Configs:%s Queries:%s})", sessionIDVal, createTimeVal, updateTimeVal, userNameVal, spaceNameVal, graphAddrVal, timezoneVal, clientIPVal, configsVal, queriesVal) +} + +// Attributes: +// - User +// - GraphAddr +// - ClientIP +type CreateSessionReq struct { + User []byte `thrift:"user,1" db:"user" json:"user"` + GraphAddr *nebula0.HostAddr `thrift:"graph_addr,2" db:"graph_addr" json:"graph_addr"` + ClientIP []byte `thrift:"client_ip,3" db:"client_ip" json:"client_ip"` +} + +func NewCreateSessionReq() *CreateSessionReq { + return &CreateSessionReq{ + GraphAddr: nebula0.NewHostAddr(), + } +} + + +func (p *CreateSessionReq) GetUser() []byte { + return p.User +} +var CreateSessionReq_GraphAddr_DEFAULT *nebula0.HostAddr +func (p *CreateSessionReq) GetGraphAddr() *nebula0.HostAddr { + if !p.IsSetGraphAddr() { + return CreateSessionReq_GraphAddr_DEFAULT + } +return p.GraphAddr +} + +func (p *CreateSessionReq) GetClientIP() []byte { + return p.ClientIP +} +func (p *CreateSessionReq) IsSetGraphAddr() bool { + return p != nil && p.GraphAddr != nil +} + +func (p *CreateSessionReq) 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 *CreateSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.User = v +} + return nil +} + +func (p *CreateSessionReq) ReadField2(iprot thrift.Protocol) error { + p.GraphAddr = nebula0.NewHostAddr() + if err := p.GraphAddr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *CreateSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionReq"); 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 *CreateSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user: ", p), err) } + if err := oprot.WriteBinary(p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("graph_addr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:graph_addr: ", p), err) } + if err := p.GraphAddr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:graph_addr: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("client_ip", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_ip: ", p), err) } + if err := oprot.WriteBinary(p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_ip: ", p), err) } + return err +} + +func (p *CreateSessionReq) String() string { + if p == nil { + return "" + } + + userVal := fmt.Sprintf("%v", p.User) + var graphAddrVal string + if p.GraphAddr == nil { + graphAddrVal = "" + } else { + graphAddrVal = fmt.Sprintf("%v", p.GraphAddr) + } + clientIPVal := fmt.Sprintf("%v", p.ClientIP) + return fmt.Sprintf("CreateSessionReq({User:%s GraphAddr:%s ClientIP:%s})", userVal, graphAddrVal, clientIPVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type CreateSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewCreateSessionResp() *CreateSessionResp { + return &CreateSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + + +func (p *CreateSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var CreateSessionResp_Leader_DEFAULT *nebula0.HostAddr +func (p *CreateSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return CreateSessionResp_Leader_DEFAULT + } +return p.Leader +} +var CreateSessionResp_Session_DEFAULT *Session +func (p *CreateSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return CreateSessionResp_Session_DEFAULT + } +return p.Session +} +func (p *CreateSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *CreateSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *CreateSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateSessionResp"); 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 *CreateSessionResp) 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 *CreateSessionResp) 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 *CreateSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *CreateSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("CreateSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - Sessions +type UpdateSessionsReq struct { + Sessions []*Session `thrift:"sessions,1" db:"sessions" json:"sessions"` +} + +func NewUpdateSessionsReq() *UpdateSessionsReq { + return &UpdateSessionsReq{} +} + + +func (p *UpdateSessionsReq) GetSessions() []*Session { + return p.Sessions +} +func (p *UpdateSessionsReq) 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 *UpdateSessionsReq) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i ++ { + _elem86 := NewSession() + if err := _elem86.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem86), err) + } + p.Sessions = append(p.Sessions, _elem86) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsReq"); 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 *UpdateSessionsReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessions: ", p), err) } + return err +} + +func (p *UpdateSessionsReq) String() string { + if p == nil { + return "" + } + + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("UpdateSessionsReq({Sessions:%s})", sessionsVal) +} + +// Attributes: +// - Code +// - Leader +// - KilledQueries +type UpdateSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + KilledQueries map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc `thrift:"killed_queries,3" db:"killed_queries" json:"killed_queries"` +} + +func NewUpdateSessionsResp() *UpdateSessionsResp { + return &UpdateSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *UpdateSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var UpdateSessionsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *UpdateSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return UpdateSessionsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *UpdateSessionsResp) GetKilledQueries() map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc { + return p.KilledQueries +} +func (p *UpdateSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc, size) + p.KilledQueries = tMap + for i := 0; i < size; i ++ { +var _key87 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.SessionID(v) + _key87 = temp +} + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) + _val88 := tMap + for i := 0; i < size; i ++ { +var _key89 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.ExecutionPlanID(v) + _key89 = temp +} + _val90 := NewQueryDesc() + if err := _val90.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val90), err) + } + _val88[_key89] = _val90 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.KilledQueries[_key87] = _val88 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *UpdateSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateSessionsResp"); 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) 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 *UpdateSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("killed_queries", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:killed_queries: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.MAP, len(p.KilledQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KilledQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:killed_queries: ", p), err) } + return err +} + +func (p *UpdateSessionsResp) 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) + } + killedQueriesVal := fmt.Sprintf("%v", p.KilledQueries) + return fmt.Sprintf("UpdateSessionsResp({Code:%s Leader:%s KilledQueries:%s})", codeVal, leaderVal, killedQueriesVal) +} + +type ListSessionsReq struct { +} + +func NewListSessionsReq() *ListSessionsReq { + return &ListSessionsReq{} +} + +func (p *ListSessionsReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSessionsReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListSessionsReq({})") +} + +// Attributes: +// - Code +// - Leader +// - Sessions +type ListSessionsResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Sessions []*Session `thrift:"sessions,3" db:"sessions" json:"sessions"` +} + +func NewListSessionsResp() *ListSessionsResp { + return &ListSessionsResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListSessionsResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListSessionsResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListSessionsResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListSessionsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListSessionsResp) GetSessions() []*Session { + return p.Sessions +} +func (p *ListSessionsResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Session, 0, size) + p.Sessions = tSlice + for i := 0; i < size; i ++ { + _elem91 := NewSession() + if err := _elem91.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) + } + p.Sessions = append(p.Sessions, _elem91) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSessionsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListSessionsResp"); 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 *ListSessionsResp) 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 *ListSessionsResp) 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 *ListSessionsResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sessions", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessions: ", p), err) } + return err +} + +func (p *ListSessionsResp) 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) + } + sessionsVal := fmt.Sprintf("%v", p.Sessions) + return fmt.Sprintf("ListSessionsResp({Code:%s Leader:%s Sessions:%s})", codeVal, leaderVal, sessionsVal) +} + +// Attributes: +// - SessionID +type GetSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewGetSessionReq() *GetSessionReq { + return &GetSessionReq{} +} + + +func (p *GetSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *GetSessionReq) 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 *GetSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *GetSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionReq"); 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 *GetSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *GetSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("GetSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - Code +// - Leader +// - Session +type GetSessionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Session *Session `thrift:"session,3" db:"session" json:"session"` +} + +func NewGetSessionResp() *GetSessionResp { + return &GetSessionResp{ + Leader: nebula0.NewHostAddr(), + Session: NewSession(), + } +} + + +func (p *GetSessionResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetSessionResp_Leader_DEFAULT *nebula0.HostAddr +func (p *GetSessionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return GetSessionResp_Leader_DEFAULT + } +return p.Leader +} +var GetSessionResp_Session_DEFAULT *Session +func (p *GetSessionResp) GetSession() *Session { + if !p.IsSetSession() { + return GetSessionResp_Session_DEFAULT + } +return p.Session +} +func (p *GetSessionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *GetSessionResp) IsSetSession() bool { + return p != nil && p.Session != nil +} + +func (p *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) ReadField3(iprot thrift.Protocol) error { + p.Session = NewSession() + if err := p.Session.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *GetSessionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetSessionResp"); 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 *GetSessionResp) 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 *GetSessionResp) 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 *GetSessionResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:session: ", p), err) } + if err := p.Session.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *GetSessionResp) 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) + } + var sessionVal string + if p.Session == nil { + sessionVal = "" + } else { + sessionVal = fmt.Sprintf("%v", p.Session) + } + return fmt.Sprintf("GetSessionResp({Code:%s Leader:%s Session:%s})", codeVal, leaderVal, sessionVal) +} + +// Attributes: +// - SessionID +type RemoveSessionReq struct { + SessionID nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewRemoveSessionReq() *RemoveSessionReq { + return &RemoveSessionReq{} +} + + +func (p *RemoveSessionReq) GetSessionID() nebula0.SessionID { + return p.SessionID +} +func (p *RemoveSessionReq) 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 *RemoveSessionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *RemoveSessionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemoveSessionReq"); 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 *RemoveSessionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *RemoveSessionReq) String() string { + if p == nil { + return "" + } + + sessionIDVal := fmt.Sprintf("%v", p.SessionID) + return fmt.Sprintf("RemoveSessionReq({SessionID:%s})", sessionIDVal) +} + +// Attributes: +// - KillQueries +type KillQueryReq struct { + KillQueries map[nebula0.SessionID][]nebula0.ExecutionPlanID `thrift:"kill_queries,1" db:"kill_queries" json:"kill_queries"` +} + +func NewKillQueryReq() *KillQueryReq { + return &KillQueryReq{} +} + + +func (p *KillQueryReq) GetKillQueries() map[nebula0.SessionID][]nebula0.ExecutionPlanID { + return p.KillQueries +} +func (p *KillQueryReq) 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 *KillQueryReq) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.SessionID][]nebula0.ExecutionPlanID, size) + p.KillQueries = tMap + for i := 0; i < size; i ++ { +var _key92 nebula0.SessionID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.SessionID(v) + _key92 = temp +} + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]nebula0.ExecutionPlanID, 0, size) + _val93 := tSet + for i := 0; i < size; i ++ { +var _elem94 nebula0.ExecutionPlanID + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.ExecutionPlanID(v) + _elem94 = temp +} + _val93 = append(_val93, _elem94) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.KillQueries[_key92] = _val93 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KillQueryReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KillQueryReq"); 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 *KillQueryReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kill_queries", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kill_queries: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I64, thrift.SET, len(p.KillQueries)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KillQueries { + if err := oprot.WriteI64(int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteSetBegin(thrift.I64, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[nebula0.ExecutionPlanID]bool, len(v)) + for _, v := range v { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range v { + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kill_queries: ", p), err) } + return err +} + +func (p *KillQueryReq) String() string { + if p == nil { + return "" + } + + killQueriesVal := fmt.Sprintf("%v", p.KillQueries) + return fmt.Sprintf("KillQueryReq({KillQueries:%s})", killQueriesVal) +} + +// Attributes: +// - Code +// - JobID +// - TaskID +// - Stats +type ReportTaskReq struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Stats *StatsItem `thrift:"stats,4" db:"stats" json:"stats,omitempty"` +} + +func NewReportTaskReq() *ReportTaskReq { + return &ReportTaskReq{} +} + + +func (p *ReportTaskReq) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *ReportTaskReq) GetJobID() int32 { + return p.JobID +} + +func (p *ReportTaskReq) GetTaskID() int32 { + return p.TaskID +} +var ReportTaskReq_Stats_DEFAULT *StatsItem +func (p *ReportTaskReq) GetStats() *StatsItem { + if !p.IsSetStats() { + return ReportTaskReq_Stats_DEFAULT + } +return p.Stats +} +func (p *ReportTaskReq) IsSetStats() bool { + return p != nil && p.Stats != nil +} + +func (p *ReportTaskReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField4(iprot thrift.Protocol) error { + p.Stats = NewStatsItem() + if err := p.Stats.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *ReportTaskReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ReportTaskReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ReportTaskReq) 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 *ReportTaskReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStats() { + if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stats: ", p), err) } + if err := p.Stats.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stats: ", p), err) } + } + return err +} + +func (p *ReportTaskReq) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var statsVal string + if p.Stats == nil { + statsVal = "" + } else { + statsVal = fmt.Sprintf("%v", p.Stats) + } + return fmt.Sprintf("ReportTaskReq({Code:%s JobID:%s TaskID:%s Stats:%s})", codeVal, jobIDVal, taskIDVal, statsVal) +} + +// Attributes: +// - Code +// - Leader +// - MetaServers +// - StorageServers +type ListClusterInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + MetaServers []*nebula0.HostAddr `thrift:"meta_servers,3" db:"meta_servers" json:"meta_servers"` + StorageServers []*nebula0.NodeInfo `thrift:"storage_servers,4" db:"storage_servers" json:"storage_servers"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *ListClusterInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var ListClusterInfoResp_Leader_DEFAULT *nebula0.HostAddr +func (p *ListClusterInfoResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return ListClusterInfoResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListClusterInfoResp) GetMetaServers() []*nebula0.HostAddr { + return p.MetaServers +} + +func (p *ListClusterInfoResp) GetStorageServers() []*nebula0.NodeInfo { + return p.StorageServers +} +func (p *ListClusterInfoResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *ListClusterInfoResp) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField3(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.MetaServers = tSlice + for i := 0; i < size; i ++ { + _elem95 := nebula0.NewHostAddr() + if err := _elem95.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) + } + p.MetaServers = append(p.MetaServers, _elem95) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.NodeInfo, 0, size) + p.StorageServers = tSlice + for i := 0; i < size; i ++ { + _elem96 := nebula0.NewNodeInfo() + if err := _elem96.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem96), err) + } + p.StorageServers = append(p.StorageServers, _elem96) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("meta_servers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:meta_servers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MetaServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta_servers: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("storage_servers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:storage_servers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorageServers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorageServers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:storage_servers: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) 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) + } + metaServersVal := fmt.Sprintf("%v", p.MetaServers) + storageServersVal := fmt.Sprintf("%v", p.StorageServers) + return fmt.Sprintf("ListClusterInfoResp({Code:%s Leader:%s MetaServers:%s StorageServers:%s})", codeVal, leaderVal, metaServersVal, storageServersVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - Code +// - Dir +type GetMetaDirInfoResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewGetMetaDirInfoResp() *GetMetaDirInfoResp { + return &GetMetaDirInfoResp{ + Dir: nebula0.NewDirInfo(), + } +} + + +func (p *GetMetaDirInfoResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var GetMetaDirInfoResp_Dir_DEFAULT *nebula0.DirInfo +func (p *GetMetaDirInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return GetMetaDirInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *GetMetaDirInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *GetMetaDirInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoResp"); 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 *GetMetaDirInfoResp) 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 *GetMetaDirInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *GetMetaDirInfoResp) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("GetMetaDirInfoResp({Code:%s Dir:%s})", codeVal, dirVal) +} + +type GetMetaDirInfoReq struct { +} + +func NewGetMetaDirInfoReq() *GetMetaDirInfoReq { + return &GetMetaDirInfoReq{} +} + +func (p *GetMetaDirInfoReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetMetaDirInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetMetaDirInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetMetaDirInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetMetaDirInfoReq({})") +} + +// Attributes: +// - Code +// - Leader +// - ErrorMsg +type VerifyClientVersionResp struct { + Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ErrorMsg []byte `thrift:"error_msg,3" db:"error_msg" json:"error_msg,omitempty"` +} + +func NewVerifyClientVersionResp() *VerifyClientVersionResp { + return &VerifyClientVersionResp{ + Leader: nebula0.NewHostAddr(), + } +} + + +func (p *VerifyClientVersionResp) GetCode() nebula0.ErrorCode { + return p.Code +} +var VerifyClientVersionResp_Leader_DEFAULT *nebula0.HostAddr +func (p *VerifyClientVersionResp) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return VerifyClientVersionResp_Leader_DEFAULT + } +return p.Leader +} +var VerifyClientVersionResp_ErrorMsg_DEFAULT []byte + +func (p *VerifyClientVersionResp) GetErrorMsg() []byte { + return p.ErrorMsg +} +func (p *VerifyClientVersionResp) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *VerifyClientVersionResp) IsSetErrorMsg() bool { + return p != nil && p.ErrorMsg != nil +} + +func (p *VerifyClientVersionResp) 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 *VerifyClientVersionResp) 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 *VerifyClientVersionResp) 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 *VerifyClientVersionResp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *VerifyClientVersionResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VerifyClientVersionResp"); 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 *VerifyClientVersionResp) 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 *VerifyClientVersionResp) 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 *VerifyClientVersionResp) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin("error_msg", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:error_msg: ", p), err) } + if err := oprot.WriteBinary(p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:error_msg: ", p), err) } + } + return err +} + +func (p *VerifyClientVersionResp) 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) + } + errorMsgVal := fmt.Sprintf("%v", p.ErrorMsg) + return fmt.Sprintf("VerifyClientVersionResp({Code:%s Leader:%s ErrorMsg:%s})", codeVal, leaderVal, errorMsgVal) +} + +// Attributes: +// - Version +type VerifyClientVersionReq struct { + Version []byte `thrift:"version,1,required" db:"version" json:"version"` +} + +func NewVerifyClientVersionReq() *VerifyClientVersionReq { + return &VerifyClientVersionReq{ + Version: []byte("2.6.0"), + } +} + + +func (p *VerifyClientVersionReq) GetVersion() []byte { + return p.Version +} +func (p *VerifyClientVersionReq) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetVersion 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 + } + issetVersion = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetVersion{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Version is not set")); + } + return nil +} + +func (p *VerifyClientVersionReq) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *VerifyClientVersionReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VerifyClientVersionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionReq) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) } + if err := oprot.WriteBinary(p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) String() string { + if p == nil { + return "" + } + + versionVal := fmt.Sprintf("%v", p.Version) + return fmt.Sprintf("VerifyClientVersionReq({Version:%s})", versionVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/constants.go b/ccore/nebula/internal/thrift/v2_6_0/storage/constants.go new file mode 100644 index 0000000..a458ae2 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/constants.go @@ -0,0 +1,30 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "fmt" + "sync" + + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ + +func init() { +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/general_storage_service-remote/general_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_6_0/storage/general_storage_service-remote/general_storage_service-remote.go new file mode 100755 index 0000000..1e89c35 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/general_storage_service-remote/general_storage_service-remote.go @@ -0,0 +1,202 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " KVGetResponse get(KVGetRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse put(KVPutRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse remove(KVRemoveRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGeneralStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg284 := flag.Arg(1) + mbTrans285 := thrift.NewMemoryBufferLen(len(arg284)) + defer mbTrans285.Close() + _, err286 := mbTrans285.WriteString(arg284) + if err286 != nil { + Usage() + return + } + factory287 := thrift.NewSimpleJSONProtocolFactory() + jsProt288 := factory287.GetProtocol(mbTrans285) + argvalue0 := storage.NewKVGetRequest() + err289 := argvalue0.Read(jsProt288) + if err289 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(value0)) + fmt.Print("\n") + break + case "put": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg290 := flag.Arg(1) + mbTrans291 := thrift.NewMemoryBufferLen(len(arg290)) + defer mbTrans291.Close() + _, err292 := mbTrans291.WriteString(arg290) + if err292 != nil { + Usage() + return + } + factory293 := thrift.NewSimpleJSONProtocolFactory() + jsProt294 := factory293.GetProtocol(mbTrans291) + argvalue0 := storage.NewKVPutRequest() + err295 := argvalue0.Read(jsProt294) + if err295 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg296 := flag.Arg(1) + mbTrans297 := thrift.NewMemoryBufferLen(len(arg296)) + defer mbTrans297.Close() + _, err298 := mbTrans297.WriteString(arg296) + if err298 != nil { + Usage() + return + } + factory299 := thrift.NewSimpleJSONProtocolFactory() + jsProt300 := factory299.GetProtocol(mbTrans297) + argvalue0 := storage.NewKVRemoveRequest() + err301 := argvalue0.Read(jsProt300) + if err301 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/generalstorageservice.go b/ccore/nebula/internal/thrift/v2_6_0/storage/generalstorageservice.go new file mode 100644 index 0000000..0558e7a --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/generalstorageservice.go @@ -0,0 +1,1086 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GeneralStorageService interface { + // Parameters: + // - Req + Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + Get(req *KVGetRequest) (_r *KVGetResponse, err error) + // Parameters: + // - Req + Put(req *KVPutRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) +} + +type GeneralStorageServiceClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GeneralStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GeneralStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GeneralStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceClient { + return &GeneralStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceClientProtocol(prot thrift.Protocol) *GeneralStorageServiceClient { + return NewGeneralStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceThreadsafeClient struct { + GeneralStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GeneralStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GeneralStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GeneralStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGeneralStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGeneralStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return &GeneralStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGeneralStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GeneralStorageServiceThreadsafeClient { + return NewGeneralStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceGetArgs{ + Req : req, + } + err = p.CC.SendMsg("get", &args, thrift.CALL) + if err != nil { return } + return p.recvGet() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { + var result GeneralStorageServiceGetResult + err = p.CC.RecvMsg("get", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServicePutArgs{ + Req : req, + } + err = p.CC.SendMsg("put", &args, thrift.CALL) + if err != nil { return } + return p.recvPut() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { + var result GeneralStorageServicePutResult + err = p.CC.RecvMsg("put", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + err = p.CC.SendMsg("remove", &args, thrift.CALL) + if err != nil { return } + return p.recvRemove() +} + + +func (p *GeneralStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { + var result GeneralStorageServiceRemoveResult + err = p.CC.RecvMsg("remove", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GeneralStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GeneralStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GeneralStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGeneralStorageServiceChannelClient(channel thrift.RequestChannel) *GeneralStorageServiceChannelClient { + return &GeneralStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) { + args := GeneralStorageServiceGetArgs{ + Req : req, + } + var result GeneralStorageServiceGetResult + err = p.RequestChannel.Call(ctx, "get", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServicePutArgs{ + Req : req, + } + var result GeneralStorageServicePutResult + err = p.RequestChannel.Call(ctx, "put", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GeneralStorageServiceChannelClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) { + args := GeneralStorageServiceRemoveArgs{ + Req : req, + } + var result GeneralStorageServiceRemoveResult + err = p.RequestChannel.Call(ctx, "remove", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GeneralStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GeneralStorageService +} + +func (p *GeneralStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GeneralStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GeneralStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGeneralStorageServiceProcessor(handler GeneralStorageService) *GeneralStorageServiceProcessor { + self282 := &GeneralStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self282.processorMap["get"] = &generalStorageServiceProcessorGet{handler:handler} + self282.processorMap["put"] = &generalStorageServiceProcessorPut{handler:handler} + self282.processorMap["remove"] = &generalStorageServiceProcessorRemove{handler:handler} + return self282 +} + +type generalStorageServiceProcessorGet struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceGetArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("get", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceGetArgs) + var result GeneralStorageServiceGetResult + if retval, err := p.handler.Get(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorPut struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServicePutArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("put", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServicePutArgs) + var result GeneralStorageServicePutResult + if retval, err := p.handler.Put(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type generalStorageServiceProcessorRemove struct { + handler GeneralStorageService +} + +func (p *generalStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GeneralStorageServiceRemoveArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *generalStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { + var err2 error + messageType := thrift.REPLY + switch result.(type) { + case thrift.ApplicationException: + messageType = thrift.EXCEPTION + } + if err2 = oprot.WriteMessageBegin("remove", messageType, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + return err +} + +func (p *generalStorageServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GeneralStorageServiceRemoveArgs) + var result GeneralStorageServiceRemoveResult + if retval, err := p.handler.Remove(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GeneralStorageServiceGetArgs struct { + thrift.IRequest + Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceGetArgs() *GeneralStorageServiceGetArgs { + return &GeneralStorageServiceGetArgs{ + Req: NewKVGetRequest(), + } +} + +var GeneralStorageServiceGetArgs_Req_DEFAULT *KVGetRequest +func (p *GeneralStorageServiceGetArgs) GetReq() *KVGetRequest { + if !p.IsSetReq() { + return GeneralStorageServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceGetArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceGetArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVGetRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceGetArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceGetArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceGetArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceGetResult struct { + thrift.IResponse + Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceGetResult() *GeneralStorageServiceGetResult { + return &GeneralStorageServiceGetResult{} +} + +var GeneralStorageServiceGetResult_Success_DEFAULT *KVGetResponse +func (p *GeneralStorageServiceGetResult) GetSuccess() *KVGetResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceGetResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceGetResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewKVGetResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceGetResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceGetResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceGetResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceGetResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServicePutArgs struct { + thrift.IRequest + Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServicePutArgs() *GeneralStorageServicePutArgs { + return &GeneralStorageServicePutArgs{ + Req: NewKVPutRequest(), + } +} + +var GeneralStorageServicePutArgs_Req_DEFAULT *KVPutRequest +func (p *GeneralStorageServicePutArgs) GetReq() *KVPutRequest { + if !p.IsSetReq() { + return GeneralStorageServicePutArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServicePutArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServicePutArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVPutRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServicePutArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServicePutArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServicePutArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServicePutResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServicePutResult() *GeneralStorageServicePutResult { + return &GeneralStorageServicePutResult{} +} + +var GeneralStorageServicePutResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServicePutResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServicePutResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServicePutResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServicePutResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServicePutResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("put_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServicePutResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServicePutResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServicePutResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GeneralStorageServiceRemoveArgs struct { + thrift.IRequest + Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGeneralStorageServiceRemoveArgs() *GeneralStorageServiceRemoveArgs { + return &GeneralStorageServiceRemoveArgs{ + Req: NewKVRemoveRequest(), + } +} + +var GeneralStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest +func (p *GeneralStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { + if !p.IsSetReq() { + return GeneralStorageServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *GeneralStorageServiceRemoveArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GeneralStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewKVRemoveRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GeneralStorageServiceRemoveArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GeneralStorageServiceRemoveArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GeneralStorageServiceRemoveResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGeneralStorageServiceRemoveResult() *GeneralStorageServiceRemoveResult { + return &GeneralStorageServiceRemoveResult{} +} + +var GeneralStorageServiceRemoveResult_Success_DEFAULT *ExecResponse +func (p *GeneralStorageServiceRemoveResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GeneralStorageServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *GeneralStorageServiceRemoveResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GeneralStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if err := p.ReadField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField0(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GeneralStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GeneralStorageServiceRemoveResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GeneralStorageServiceRemoveResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/graph_storage_service-remote/graph_storage_service-remote.go b/ccore/nebula/internal/thrift/v2_6_0/storage/graph_storage_service-remote/graph_storage_service-remote.go new file mode 100755 index 0000000..da789b2 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -0,0 +1,540 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse getNeighbors(GetNeighborsRequest req)") + fmt.Fprintln(os.Stderr, " GetPropResponse getProps(GetPropRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addVertices(AddVerticesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse addEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteEdges(DeleteEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteVertices(DeleteVerticesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse deleteTags(DeleteTagsRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateVertex(UpdateVertexRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse updateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ScanVertexResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanEdgeResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") + fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse chainUpdateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse chainAddEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewGraphStorageServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "getNeighbors": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") + flag.Usage() + } + arg88 := flag.Arg(1) + mbTrans89 := thrift.NewMemoryBufferLen(len(arg88)) + defer mbTrans89.Close() + _, err90 := mbTrans89.WriteString(arg88) + if err90 != nil { + Usage() + return + } + factory91 := thrift.NewSimpleJSONProtocolFactory() + jsProt92 := factory91.GetProtocol(mbTrans89) + argvalue0 := storage.NewGetNeighborsRequest() + err93 := argvalue0.Read(jsProt92) + if err93 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetNeighbors(value0)) + fmt.Print("\n") + break + case "getProps": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetProps requires 1 args") + flag.Usage() + } + arg94 := flag.Arg(1) + mbTrans95 := thrift.NewMemoryBufferLen(len(arg94)) + defer mbTrans95.Close() + _, err96 := mbTrans95.WriteString(arg94) + if err96 != nil { + Usage() + return + } + factory97 := thrift.NewSimpleJSONProtocolFactory() + jsProt98 := factory97.GetProtocol(mbTrans95) + argvalue0 := storage.NewGetPropRequest() + err99 := argvalue0.Read(jsProt98) + if err99 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetProps(value0)) + fmt.Print("\n") + break + case "addVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") + flag.Usage() + } + arg100 := flag.Arg(1) + mbTrans101 := thrift.NewMemoryBufferLen(len(arg100)) + defer mbTrans101.Close() + _, err102 := mbTrans101.WriteString(arg100) + if err102 != nil { + Usage() + return + } + factory103 := thrift.NewSimpleJSONProtocolFactory() + jsProt104 := factory103.GetProtocol(mbTrans101) + argvalue0 := storage.NewAddVerticesRequest() + err105 := argvalue0.Read(jsProt104) + if err105 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddVertices(value0)) + fmt.Print("\n") + break + case "addEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") + flag.Usage() + } + arg106 := flag.Arg(1) + mbTrans107 := thrift.NewMemoryBufferLen(len(arg106)) + defer mbTrans107.Close() + _, err108 := mbTrans107.WriteString(arg106) + if err108 != nil { + Usage() + return + } + factory109 := thrift.NewSimpleJSONProtocolFactory() + jsProt110 := factory109.GetProtocol(mbTrans107) + argvalue0 := storage.NewAddEdgesRequest() + err111 := argvalue0.Read(jsProt110) + if err111 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdges(value0)) + fmt.Print("\n") + break + case "deleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") + flag.Usage() + } + arg112 := flag.Arg(1) + mbTrans113 := thrift.NewMemoryBufferLen(len(arg112)) + defer mbTrans113.Close() + _, err114 := mbTrans113.WriteString(arg112) + if err114 != nil { + Usage() + return + } + factory115 := thrift.NewSimpleJSONProtocolFactory() + jsProt116 := factory115.GetProtocol(mbTrans113) + argvalue0 := storage.NewDeleteEdgesRequest() + err117 := argvalue0.Read(jsProt116) + if err117 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteEdges(value0)) + fmt.Print("\n") + break + case "deleteVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") + flag.Usage() + } + arg118 := flag.Arg(1) + mbTrans119 := thrift.NewMemoryBufferLen(len(arg118)) + defer mbTrans119.Close() + _, err120 := mbTrans119.WriteString(arg118) + if err120 != nil { + Usage() + return + } + factory121 := thrift.NewSimpleJSONProtocolFactory() + jsProt122 := factory121.GetProtocol(mbTrans119) + argvalue0 := storage.NewDeleteVerticesRequest() + err123 := argvalue0.Read(jsProt122) + if err123 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteVertices(value0)) + fmt.Print("\n") + break + case "deleteTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteTags requires 1 args") + flag.Usage() + } + arg124 := flag.Arg(1) + mbTrans125 := thrift.NewMemoryBufferLen(len(arg124)) + defer mbTrans125.Close() + _, err126 := mbTrans125.WriteString(arg124) + if err126 != nil { + Usage() + return + } + factory127 := thrift.NewSimpleJSONProtocolFactory() + jsProt128 := factory127.GetProtocol(mbTrans125) + argvalue0 := storage.NewDeleteTagsRequest() + err129 := argvalue0.Read(jsProt128) + if err129 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteTags(value0)) + fmt.Print("\n") + break + case "updateVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") + flag.Usage() + } + arg130 := flag.Arg(1) + mbTrans131 := thrift.NewMemoryBufferLen(len(arg130)) + defer mbTrans131.Close() + _, err132 := mbTrans131.WriteString(arg130) + if err132 != nil { + Usage() + return + } + factory133 := thrift.NewSimpleJSONProtocolFactory() + jsProt134 := factory133.GetProtocol(mbTrans131) + argvalue0 := storage.NewUpdateVertexRequest() + err135 := argvalue0.Read(jsProt134) + if err135 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateVertex(value0)) + fmt.Print("\n") + break + case "updateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") + flag.Usage() + } + arg136 := flag.Arg(1) + mbTrans137 := thrift.NewMemoryBufferLen(len(arg136)) + defer mbTrans137.Close() + _, err138 := mbTrans137.WriteString(arg136) + if err138 != nil { + Usage() + return + } + factory139 := thrift.NewSimpleJSONProtocolFactory() + jsProt140 := factory139.GetProtocol(mbTrans137) + argvalue0 := storage.NewUpdateEdgeRequest() + err141 := argvalue0.Read(jsProt140) + if err141 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateEdge(value0)) + fmt.Print("\n") + break + case "scanVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") + flag.Usage() + } + arg142 := flag.Arg(1) + mbTrans143 := thrift.NewMemoryBufferLen(len(arg142)) + defer mbTrans143.Close() + _, err144 := mbTrans143.WriteString(arg142) + if err144 != nil { + Usage() + return + } + factory145 := thrift.NewSimpleJSONProtocolFactory() + jsProt146 := factory145.GetProtocol(mbTrans143) + argvalue0 := storage.NewScanVertexRequest() + err147 := argvalue0.Read(jsProt146) + if err147 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanVertex(value0)) + fmt.Print("\n") + break + case "scanEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") + flag.Usage() + } + arg148 := flag.Arg(1) + mbTrans149 := thrift.NewMemoryBufferLen(len(arg148)) + defer mbTrans149.Close() + _, err150 := mbTrans149.WriteString(arg148) + if err150 != nil { + Usage() + return + } + factory151 := thrift.NewSimpleJSONProtocolFactory() + jsProt152 := factory151.GetProtocol(mbTrans149) + argvalue0 := storage.NewScanEdgeRequest() + err153 := argvalue0.Read(jsProt152) + if err153 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanEdge(value0)) + fmt.Print("\n") + break + case "getUUID": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") + flag.Usage() + } + arg154 := flag.Arg(1) + mbTrans155 := thrift.NewMemoryBufferLen(len(arg154)) + defer mbTrans155.Close() + _, err156 := mbTrans155.WriteString(arg154) + if err156 != nil { + Usage() + return + } + factory157 := thrift.NewSimpleJSONProtocolFactory() + jsProt158 := factory157.GetProtocol(mbTrans155) + argvalue0 := storage.NewGetUUIDReq() + err159 := argvalue0.Read(jsProt158) + if err159 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUUID(value0)) + fmt.Print("\n") + break + case "lookupIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") + flag.Usage() + } + arg160 := flag.Arg(1) + mbTrans161 := thrift.NewMemoryBufferLen(len(arg160)) + defer mbTrans161.Close() + _, err162 := mbTrans161.WriteString(arg160) + if err162 != nil { + Usage() + return + } + factory163 := thrift.NewSimpleJSONProtocolFactory() + jsProt164 := factory163.GetProtocol(mbTrans161) + argvalue0 := storage.NewLookupIndexRequest() + err165 := argvalue0.Read(jsProt164) + if err165 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupIndex(value0)) + fmt.Print("\n") + break + case "lookupAndTraverse": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") + flag.Usage() + } + arg166 := flag.Arg(1) + mbTrans167 := thrift.NewMemoryBufferLen(len(arg166)) + defer mbTrans167.Close() + _, err168 := mbTrans167.WriteString(arg166) + if err168 != nil { + Usage() + return + } + factory169 := thrift.NewSimpleJSONProtocolFactory() + jsProt170 := factory169.GetProtocol(mbTrans167) + argvalue0 := storage.NewLookupAndTraverseRequest() + err171 := argvalue0.Read(jsProt170) + if err171 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupAndTraverse(value0)) + fmt.Print("\n") + break + case "chainUpdateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainUpdateEdge requires 1 args") + flag.Usage() + } + arg172 := flag.Arg(1) + mbTrans173 := thrift.NewMemoryBufferLen(len(arg172)) + defer mbTrans173.Close() + _, err174 := mbTrans173.WriteString(arg172) + if err174 != nil { + Usage() + return + } + factory175 := thrift.NewSimpleJSONProtocolFactory() + jsProt176 := factory175.GetProtocol(mbTrans173) + argvalue0 := storage.NewUpdateEdgeRequest() + err177 := argvalue0.Read(jsProt176) + if err177 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainUpdateEdge(value0)) + fmt.Print("\n") + break + case "chainAddEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainAddEdges requires 1 args") + flag.Usage() + } + arg178 := flag.Arg(1) + mbTrans179 := thrift.NewMemoryBufferLen(len(arg178)) + defer mbTrans179.Close() + _, err180 := mbTrans179.WriteString(arg178) + if err180 != nil { + Usage() + return + } + factory181 := thrift.NewSimpleJSONProtocolFactory() + jsProt182 := factory181.GetProtocol(mbTrans179) + argvalue0 := storage.NewAddEdgesRequest() + err183 := argvalue0.Read(jsProt182) + if err183 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainAddEdges(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/graphstorageservice.go b/ccore/nebula/internal/thrift/v2_6_0/storage/graphstorageservice.go new file mode 100644 index 0000000..9e2e5b5 --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/graphstorageservice.go @@ -0,0 +1,5142 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type GraphStorageService interface { + // Parameters: + // - Req + GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteTags(ctx context.Context, req *DeleteTagsRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + ChainUpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ChainAddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) + // Parameters: + // - Req + AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + DeleteTags(req *DeleteTagsRequest) (_r *ExecResponse, err error) + // Parameters: + // - Req + UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) + // Parameters: + // - Req + ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) + // Parameters: + // - Req + GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) + // Parameters: + // - Req + LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) + // Parameters: + // - Req + LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) + // Parameters: + // - Req + ChainUpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) + // Parameters: + // - Req + ChainAddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) +} + +type GraphStorageServiceClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn +} + +func(client *GraphStorageServiceClient) Open() error { + return client.CC.Open() +} + +func(client *GraphStorageServiceClient) Close() error { + return client.CC.Close() +} + +func(client *GraphStorageServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewGraphStorageServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceClientProtocol(prot thrift.Protocol) *GraphStorageServiceClient { + return NewGraphStorageServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteTags(req *DeleteTagsRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteTags", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteTags() +} + + +func (p *GraphStorageServiceClient) recvDeleteTags() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteTagsResult + err = p.CC.RecvMsg("deleteTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ChainUpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceChainUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("chainUpdateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvChainUpdateEdge() +} + + +func (p *GraphStorageServiceClient) recvChainUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceChainUpdateEdgeResult + err = p.CC.RecvMsg("chainUpdateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ChainAddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceChainAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("chainAddEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvChainAddEdges() +} + + +func (p *GraphStorageServiceClient) recvChainAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceChainAddEdgesResult + err = p.CC.RecvMsg("chainAddEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceThreadsafeClient struct { + GraphStorageServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *GraphStorageServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *GraphStorageServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *GraphStorageServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewGraphStorageServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewGraphStorageServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return &GraphStorageServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewGraphStorageServiceThreadsafeClientProtocol(prot thrift.Protocol) *GraphStorageServiceThreadsafeClient { + return NewGraphStorageServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + err = p.CC.SendMsg("getNeighbors", &args, thrift.CALL) + if err != nil { return } + return p.recvGetNeighbors() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetNeighbors() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceGetNeighborsResult + err = p.CC.RecvMsg("getNeighbors", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + err = p.CC.SendMsg("getProps", &args, thrift.CALL) + if err != nil { return } + return p.recvGetProps() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetProps() (value *GetPropResponse, err error) { + var result GraphStorageServiceGetPropsResult + err = p.CC.RecvMsg("getProps", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddVertices(req *AddVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("addVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvAddVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceAddVerticesResult + err = p.CC.RecvMsg("addVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) AddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("addEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvAddEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceAddEdgesResult + err = p.CC.RecvMsg("addEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteEdgesResult + err = p.CC.RecvMsg("deleteEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteVertices(req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteVertices", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteVertices() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteVertices() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteVerticesResult + err = p.CC.RecvMsg("deleteVertices", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) DeleteTags(req *DeleteTagsRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceDeleteTagsArgs{ + Req : req, + } + err = p.CC.SendMsg("deleteTags", &args, thrift.CALL) + if err != nil { return } + return p.recvDeleteTags() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvDeleteTags() (value *ExecResponse, err error) { + var result GraphStorageServiceDeleteTagsResult + err = p.CC.RecvMsg("deleteTags", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateVertex(req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("updateVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateVertex() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateVertexResult + err = p.CC.RecvMsg("updateVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) UpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("updateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvUpdateEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceUpdateEdgeResult + err = p.CC.RecvMsg("updateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanVertex(req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + err = p.CC.SendMsg("scanVertex", &args, thrift.CALL) + if err != nil { return } + return p.recvScanVertex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanVertex() (value *ScanVertexResponse, err error) { + var result GraphStorageServiceScanVertexResult + err = p.CC.RecvMsg("scanVertex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ScanEdge(req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("scanEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvScanEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvScanEdge() (value *ScanEdgeResponse, err error) { + var result GraphStorageServiceScanEdgeResult + err = p.CC.RecvMsg("scanEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) GetUUID(req *GetUUIDReq) (_r *GetUUIDResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + err = p.CC.SendMsg("getUUID", &args, thrift.CALL) + if err != nil { return } + return p.recvGetUUID() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvGetUUID() (value *GetUUIDResp, err error) { + var result GraphStorageServiceGetUUIDResult + err = p.CC.RecvMsg("getUUID", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupIndex(req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupIndex() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupIndex() (value *LookupIndexResp, err error) { + var result GraphStorageServiceLookupIndexResult + err = p.CC.RecvMsg("lookupIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) LookupAndTraverse(req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + err = p.CC.SendMsg("lookupAndTraverse", &args, thrift.CALL) + if err != nil { return } + return p.recvLookupAndTraverse() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvLookupAndTraverse() (value *GetNeighborsResponse, err error) { + var result GraphStorageServiceLookupAndTraverseResult + err = p.CC.RecvMsg("lookupAndTraverse", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ChainUpdateEdge(req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceChainUpdateEdgeArgs{ + Req : req, + } + err = p.CC.SendMsg("chainUpdateEdge", &args, thrift.CALL) + if err != nil { return } + return p.recvChainUpdateEdge() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvChainUpdateEdge() (value *UpdateResponse, err error) { + var result GraphStorageServiceChainUpdateEdgeResult + err = p.CC.RecvMsg("chainUpdateEdge", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceThreadsafeClient) ChainAddEdges(req *AddEdgesRequest) (_r *ExecResponse, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := GraphStorageServiceChainAddEdgesArgs{ + Req : req, + } + err = p.CC.SendMsg("chainAddEdges", &args, thrift.CALL) + if err != nil { return } + return p.recvChainAddEdges() +} + + +func (p *GraphStorageServiceThreadsafeClient) recvChainAddEdges() (value *ExecResponse, err error) { + var result GraphStorageServiceChainAddEdgesResult + err = p.CC.RecvMsg("chainAddEdges", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *GraphStorageServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *GraphStorageServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *GraphStorageServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewGraphStorageServiceChannelClient(channel thrift.RequestChannel) *GraphStorageServiceChannelClient { + return &GraphStorageServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceGetNeighborsArgs{ + Req : req, + } + var result GraphStorageServiceGetNeighborsResult + err = p.RequestChannel.Call(ctx, "getNeighbors", &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) { + args := GraphStorageServiceGetPropsArgs{ + Req : req, + } + var result GraphStorageServiceGetPropsResult + err = p.RequestChannel.Call(ctx, "getProps", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddVerticesArgs{ + Req : req, + } + var result GraphStorageServiceAddVerticesResult + err = p.RequestChannel.Call(ctx, "addVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceAddEdgesArgs{ + Req : req, + } + var result GraphStorageServiceAddEdgesResult + err = p.RequestChannel.Call(ctx, "addEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteEdgesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteEdgesResult + err = p.RequestChannel.Call(ctx, "deleteEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteVerticesArgs{ + Req : req, + } + var result GraphStorageServiceDeleteVerticesResult + err = p.RequestChannel.Call(ctx, "deleteVertices", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) DeleteTags(ctx context.Context, req *DeleteTagsRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceDeleteTagsArgs{ + Req : req, + } + var result GraphStorageServiceDeleteTagsResult + err = p.RequestChannel.Call(ctx, "deleteTags", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateVertexArgs{ + Req : req, + } + var result GraphStorageServiceUpdateVertexResult + err = p.RequestChannel.Call(ctx, "updateVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceUpdateEdgeArgs{ + Req : req, + } + var result GraphStorageServiceUpdateEdgeResult + err = p.RequestChannel.Call(ctx, "updateEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanVertexResponse, err error) { + args := GraphStorageServiceScanVertexArgs{ + Req : req, + } + var result GraphStorageServiceScanVertexResult + err = p.RequestChannel.Call(ctx, "scanVertex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanEdgeResponse, err error) { + args := GraphStorageServiceScanEdgeArgs{ + Req : req, + } + var result GraphStorageServiceScanEdgeResult + err = p.RequestChannel.Call(ctx, "scanEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, err error) { + args := GraphStorageServiceGetUUIDArgs{ + Req : req, + } + var result GraphStorageServiceGetUUIDResult + err = p.RequestChannel.Call(ctx, "getUUID", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, err error) { + args := GraphStorageServiceLookupIndexArgs{ + Req : req, + } + var result GraphStorageServiceLookupIndexResult + err = p.RequestChannel.Call(ctx, "lookupIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, err error) { + args := GraphStorageServiceLookupAndTraverseArgs{ + Req : req, + } + var result GraphStorageServiceLookupAndTraverseResult + err = p.RequestChannel.Call(ctx, "lookupAndTraverse", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ChainUpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, err error) { + args := GraphStorageServiceChainUpdateEdgeArgs{ + Req : req, + } + var result GraphStorageServiceChainUpdateEdgeResult + err = p.RequestChannel.Call(ctx, "chainUpdateEdge", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphStorageServiceChannelClient) ChainAddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, err error) { + args := GraphStorageServiceChainAddEdgesArgs{ + Req : req, + } + var result GraphStorageServiceChainAddEdgesResult + err = p.RequestChannel.Call(ctx, "chainAddEdges", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type GraphStorageServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler GraphStorageService +} + +func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *GraphStorageServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { + self86 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self86.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self86.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self86.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self86.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self86.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self86.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self86.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} + self86.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self86.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self86.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self86.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self86.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self86.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self86.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self86.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} + self86.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} + return self86 +} + +type graphStorageServiceProcessorGetNeighbors struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetNeighbors) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetNeighborsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetNeighbors) 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("getNeighbors", 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 *graphStorageServiceProcessorGetNeighbors) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetNeighborsArgs) + var result GraphStorageServiceGetNeighborsResult + if retval, err := p.handler.GetNeighbors(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getNeighbors: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetProps struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetProps) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetPropsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetProps) 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("getProps", 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 *graphStorageServiceProcessorGetProps) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetPropsArgs) + var result GraphStorageServiceGetPropsResult + if retval, err := p.handler.GetProps(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProps: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddVertices) 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("addVertices", 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 *graphStorageServiceProcessorAddVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddVerticesArgs) + var result GraphStorageServiceAddVerticesResult + if retval, err := p.handler.AddVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceAddEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorAddEdges) 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("addEdges", 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 *graphStorageServiceProcessorAddEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceAddEdgesArgs) + var result GraphStorageServiceAddEdgesResult + if retval, err := p.handler.AddEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteEdges) 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("deleteEdges", 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 *graphStorageServiceProcessorDeleteEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteEdgesArgs) + var result GraphStorageServiceDeleteEdgesResult + if retval, err := p.handler.DeleteEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteVertices) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteVerticesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteVertices) 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("deleteVertices", 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 *graphStorageServiceProcessorDeleteVertices) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteVerticesArgs) + var result GraphStorageServiceDeleteVerticesResult + if retval, err := p.handler.DeleteVertices(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteVertices: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorDeleteTags struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteTags) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceDeleteTagsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorDeleteTags) 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("deleteTags", 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 *graphStorageServiceProcessorDeleteTags) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceDeleteTagsArgs) + var result GraphStorageServiceDeleteTagsResult + if retval, err := p.handler.DeleteTags(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTags: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateVertex) 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("updateVertex", 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 *graphStorageServiceProcessorUpdateVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateVertexArgs) + var result GraphStorageServiceUpdateVertexResult + if retval, err := p.handler.UpdateVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceUpdateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorUpdateEdge) 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("updateEdge", 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 *graphStorageServiceProcessorUpdateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceUpdateEdgeArgs) + var result GraphStorageServiceUpdateEdgeResult + if retval, err := p.handler.UpdateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanVertex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanVertexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanVertex) 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("scanVertex", 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 *graphStorageServiceProcessorScanVertex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanVertexArgs) + var result GraphStorageServiceScanVertexResult + if retval, err := p.handler.ScanVertex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanVertex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorScanEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceScanEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorScanEdge) 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("scanEdge", 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 *graphStorageServiceProcessorScanEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceScanEdgeArgs) + var result GraphStorageServiceScanEdgeResult + if retval, err := p.handler.ScanEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorGetUUID struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetUUID) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceGetUUIDArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorGetUUID) 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("getUUID", 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 *graphStorageServiceProcessorGetUUID) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceGetUUIDArgs) + var result GraphStorageServiceGetUUIDResult + if retval, err := p.handler.GetUUID(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUUID: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupIndex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupIndex) 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("lookupIndex", 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 *graphStorageServiceProcessorLookupIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupIndexArgs) + var result GraphStorageServiceLookupIndexResult + if retval, err := p.handler.LookupIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorLookupAndTraverse struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceLookupAndTraverseArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) 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("lookupAndTraverse", 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 *graphStorageServiceProcessorLookupAndTraverse) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceLookupAndTraverseArgs) + var result GraphStorageServiceLookupAndTraverseResult + if retval, err := p.handler.LookupAndTraverse(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupAndTraverse: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorChainUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorChainUpdateEdge) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceChainUpdateEdgeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorChainUpdateEdge) 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("chainUpdateEdge", 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 *graphStorageServiceProcessorChainUpdateEdge) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceChainUpdateEdgeArgs) + var result GraphStorageServiceChainUpdateEdgeResult + if retval, err := p.handler.ChainUpdateEdge(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainUpdateEdge: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type graphStorageServiceProcessorChainAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorChainAddEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := GraphStorageServiceChainAddEdgesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *graphStorageServiceProcessorChainAddEdges) 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("chainAddEdges", 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 *graphStorageServiceProcessorChainAddEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*GraphStorageServiceChainAddEdgesArgs) + var result GraphStorageServiceChainAddEdgesResult + if retval, err := p.handler.ChainAddEdges(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainAddEdges: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type GraphStorageServiceGetNeighborsArgs struct { + thrift.IRequest + Req *GetNeighborsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetNeighborsArgs() *GraphStorageServiceGetNeighborsArgs { + return &GraphStorageServiceGetNeighborsArgs{ + Req: NewGetNeighborsRequest(), + } +} + +var GraphStorageServiceGetNeighborsArgs_Req_DEFAULT *GetNeighborsRequest +func (p *GraphStorageServiceGetNeighborsArgs) GetReq() *GetNeighborsRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetNeighborsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetNeighborsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetNeighborsRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsArgs) 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 *GraphStorageServiceGetNeighborsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetNeighborsResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetNeighborsResult() *GraphStorageServiceGetNeighborsResult { + return &GraphStorageServiceGetNeighborsResult{} +} + +var GraphStorageServiceGetNeighborsResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceGetNeighborsResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetNeighborsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetNeighborsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getNeighbors_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 *GraphStorageServiceGetNeighborsResult) 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 *GraphStorageServiceGetNeighborsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetNeighborsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetPropsArgs struct { + thrift.IRequest + Req *GetPropRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetPropsArgs() *GraphStorageServiceGetPropsArgs { + return &GraphStorageServiceGetPropsArgs{ + Req: NewGetPropRequest(), + } +} + +var GraphStorageServiceGetPropsArgs_Req_DEFAULT *GetPropRequest +func (p *GraphStorageServiceGetPropsArgs) GetReq() *GetPropRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetPropsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetPropsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetPropRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsArgs) 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 *GraphStorageServiceGetPropsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetPropsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetPropsResult struct { + thrift.IResponse + Success *GetPropResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetPropsResult() *GraphStorageServiceGetPropsResult { + return &GraphStorageServiceGetPropsResult{} +} + +var GraphStorageServiceGetPropsResult_Success_DEFAULT *GetPropResponse +func (p *GraphStorageServiceGetPropsResult) GetSuccess() *GetPropResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetPropsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetPropsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetPropResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getProps_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 *GraphStorageServiceGetPropsResult) 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 *GraphStorageServiceGetPropsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetPropsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddVerticesArgs struct { + thrift.IRequest + Req *AddVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddVerticesArgs() *GraphStorageServiceAddVerticesArgs { + return &GraphStorageServiceAddVerticesArgs{ + Req: NewAddVerticesRequest(), + } +} + +var GraphStorageServiceAddVerticesArgs_Req_DEFAULT *AddVerticesRequest +func (p *GraphStorageServiceAddVerticesArgs) GetReq() *AddVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesArgs) 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 *GraphStorageServiceAddVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddVerticesResult() *GraphStorageServiceAddVerticesResult { + return &GraphStorageServiceAddVerticesResult{} +} + +var GraphStorageServiceAddVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addVertices_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 *GraphStorageServiceAddVerticesResult) 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 *GraphStorageServiceAddVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceAddEdgesArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceAddEdgesArgs() *GraphStorageServiceAddEdgesArgs { + return &GraphStorageServiceAddEdgesArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceAddEdgesArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceAddEdgesArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceAddEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesArgs) 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 *GraphStorageServiceAddEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceAddEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceAddEdgesResult() *GraphStorageServiceAddEdgesResult { + return &GraphStorageServiceAddEdgesResult{} +} + +var GraphStorageServiceAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceAddEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addEdges_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 *GraphStorageServiceAddEdgesResult) 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 *GraphStorageServiceAddEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceAddEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteEdgesArgs struct { + thrift.IRequest + Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteEdgesArgs() *GraphStorageServiceDeleteEdgesArgs { + return &GraphStorageServiceDeleteEdgesArgs{ + Req: NewDeleteEdgesRequest(), + } +} + +var GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest +func (p *GraphStorageServiceDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesArgs) 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 *GraphStorageServiceDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteEdgesResult() *GraphStorageServiceDeleteEdgesResult { + return &GraphStorageServiceDeleteEdgesResult{} +} + +var GraphStorageServiceDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteEdges_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 *GraphStorageServiceDeleteEdgesResult) 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 *GraphStorageServiceDeleteEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteEdgesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteVerticesArgs struct { + thrift.IRequest + Req *DeleteVerticesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteVerticesArgs() *GraphStorageServiceDeleteVerticesArgs { + return &GraphStorageServiceDeleteVerticesArgs{ + Req: NewDeleteVerticesRequest(), + } +} + +var GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT *DeleteVerticesRequest +func (p *GraphStorageServiceDeleteVerticesArgs) GetReq() *DeleteVerticesRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteVerticesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteVerticesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteVerticesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesArgs) 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 *GraphStorageServiceDeleteVerticesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteVerticesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteVerticesResult() *GraphStorageServiceDeleteVerticesResult { + return &GraphStorageServiceDeleteVerticesResult{} +} + +var GraphStorageServiceDeleteVerticesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteVerticesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteVerticesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteVerticesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteVertices_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 *GraphStorageServiceDeleteVerticesResult) 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 *GraphStorageServiceDeleteVerticesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteVerticesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceDeleteTagsArgs struct { + thrift.IRequest + Req *DeleteTagsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteTagsArgs() *GraphStorageServiceDeleteTagsArgs { + return &GraphStorageServiceDeleteTagsArgs{ + Req: NewDeleteTagsRequest(), + } +} + +var GraphStorageServiceDeleteTagsArgs_Req_DEFAULT *DeleteTagsRequest +func (p *GraphStorageServiceDeleteTagsArgs) GetReq() *DeleteTagsRequest { + if !p.IsSetReq() { + return GraphStorageServiceDeleteTagsArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceDeleteTagsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) 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 *GraphStorageServiceDeleteTagsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDeleteTagsRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteTags_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 *GraphStorageServiceDeleteTagsArgs) 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 *GraphStorageServiceDeleteTagsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceDeleteTagsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteTagsResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceDeleteTagsResult() *GraphStorageServiceDeleteTagsResult { + return &GraphStorageServiceDeleteTagsResult{} +} + +var GraphStorageServiceDeleteTagsResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceDeleteTagsResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceDeleteTagsResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceDeleteTagsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceDeleteTagsResult) 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 *GraphStorageServiceDeleteTagsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("deleteTags_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 *GraphStorageServiceDeleteTagsResult) 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 *GraphStorageServiceDeleteTagsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceDeleteTagsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateVertexArgs struct { + thrift.IRequest + Req *UpdateVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateVertexArgs() *GraphStorageServiceUpdateVertexArgs { + return &GraphStorageServiceUpdateVertexArgs{ + Req: NewUpdateVertexRequest(), + } +} + +var GraphStorageServiceUpdateVertexArgs_Req_DEFAULT *UpdateVertexRequest +func (p *GraphStorageServiceUpdateVertexArgs) GetReq() *UpdateVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexArgs) 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 *GraphStorageServiceUpdateVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateVertexResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateVertexResult() *GraphStorageServiceUpdateVertexResult { + return &GraphStorageServiceUpdateVertexResult{} +} + +var GraphStorageServiceUpdateVertexResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateVertexResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateVertex_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 *GraphStorageServiceUpdateVertexResult) 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 *GraphStorageServiceUpdateVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceUpdateEdgeArgs struct { + thrift.IRequest + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceUpdateEdgeArgs() *GraphStorageServiceUpdateEdgeArgs { + return &GraphStorageServiceUpdateEdgeArgs{ + Req: NewUpdateEdgeRequest(), + } +} + +var GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT *UpdateEdgeRequest +func (p *GraphStorageServiceUpdateEdgeArgs) GetReq() *UpdateEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceUpdateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeArgs) 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 *GraphStorageServiceUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceUpdateEdgeResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceUpdateEdgeResult() *GraphStorageServiceUpdateEdgeResult { + return &GraphStorageServiceUpdateEdgeResult{} +} + +var GraphStorageServiceUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceUpdateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("updateEdge_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 *GraphStorageServiceUpdateEdgeResult) 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 *GraphStorageServiceUpdateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceUpdateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanVertexArgs struct { + thrift.IRequest + Req *ScanVertexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanVertexArgs() *GraphStorageServiceScanVertexArgs { + return &GraphStorageServiceScanVertexArgs{ + Req: NewScanVertexRequest(), + } +} + +var GraphStorageServiceScanVertexArgs_Req_DEFAULT *ScanVertexRequest +func (p *GraphStorageServiceScanVertexArgs) GetReq() *ScanVertexRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanVertexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanVertexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanVertexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexArgs) 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 *GraphStorageServiceScanVertexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanVertexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanVertexResult struct { + thrift.IResponse + Success *ScanVertexResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { + return &GraphStorageServiceScanVertexResult{} +} + +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanVertexResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanVertexResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanVertexResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanVertex_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 *GraphStorageServiceScanVertexResult) 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 *GraphStorageServiceScanVertexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanVertexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceScanEdgeArgs struct { + thrift.IRequest + Req *ScanEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceScanEdgeArgs() *GraphStorageServiceScanEdgeArgs { + return &GraphStorageServiceScanEdgeArgs{ + Req: NewScanEdgeRequest(), + } +} + +var GraphStorageServiceScanEdgeArgs_Req_DEFAULT *ScanEdgeRequest +func (p *GraphStorageServiceScanEdgeArgs) GetReq() *ScanEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceScanEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceScanEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewScanEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeArgs) 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 *GraphStorageServiceScanEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceScanEdgeResult struct { + thrift.IResponse + Success *ScanEdgeResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { + return &GraphStorageServiceScanEdgeResult{} +} + +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanEdgeResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanEdgeResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewScanEdgeResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("scanEdge_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 *GraphStorageServiceScanEdgeResult) 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 *GraphStorageServiceScanEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceScanEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceGetUUIDArgs struct { + thrift.IRequest + Req *GetUUIDReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetUUIDArgs() *GraphStorageServiceGetUUIDArgs { + return &GraphStorageServiceGetUUIDArgs{ + Req: NewGetUUIDReq(), + } +} + +var GraphStorageServiceGetUUIDArgs_Req_DEFAULT *GetUUIDReq +func (p *GraphStorageServiceGetUUIDArgs) GetReq() *GetUUIDReq { + if !p.IsSetReq() { + return GraphStorageServiceGetUUIDArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetUUIDArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetUUIDReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDArgs) 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 *GraphStorageServiceGetUUIDArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceGetUUIDResult struct { + thrift.IResponse + Success *GetUUIDResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetUUIDResult() *GraphStorageServiceGetUUIDResult { + return &GraphStorageServiceGetUUIDResult{} +} + +var GraphStorageServiceGetUUIDResult_Success_DEFAULT *GetUUIDResp +func (p *GraphStorageServiceGetUUIDResult) GetSuccess() *GetUUIDResp { + if !p.IsSetSuccess() { + return GraphStorageServiceGetUUIDResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetUUIDResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetUUIDResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getUUID_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 *GraphStorageServiceGetUUIDResult) 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 *GraphStorageServiceGetUUIDResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceGetUUIDResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupIndexArgs struct { + thrift.IRequest + Req *LookupIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupIndexArgs() *GraphStorageServiceLookupIndexArgs { + return &GraphStorageServiceLookupIndexArgs{ + Req: NewLookupIndexRequest(), + } +} + +var GraphStorageServiceLookupIndexArgs_Req_DEFAULT *LookupIndexRequest +func (p *GraphStorageServiceLookupIndexArgs) GetReq() *LookupIndexRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexArgs) 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 *GraphStorageServiceLookupIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupIndexResult struct { + thrift.IResponse + Success *LookupIndexResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupIndexResult() *GraphStorageServiceLookupIndexResult { + return &GraphStorageServiceLookupIndexResult{} +} + +var GraphStorageServiceLookupIndexResult_Success_DEFAULT *LookupIndexResp +func (p *GraphStorageServiceLookupIndexResult) GetSuccess() *LookupIndexResp { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewLookupIndexResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupIndex_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 *GraphStorageServiceLookupIndexResult) 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 *GraphStorageServiceLookupIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceLookupAndTraverseArgs struct { + thrift.IRequest + Req *LookupAndTraverseRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceLookupAndTraverseArgs() *GraphStorageServiceLookupAndTraverseArgs { + return &GraphStorageServiceLookupAndTraverseArgs{ + Req: NewLookupAndTraverseRequest(), + } +} + +var GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT *LookupAndTraverseRequest +func (p *GraphStorageServiceLookupAndTraverseArgs) GetReq() *LookupAndTraverseRequest { + if !p.IsSetReq() { + return GraphStorageServiceLookupAndTraverseArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceLookupAndTraverseArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewLookupAndTraverseRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseArgs) 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 *GraphStorageServiceLookupAndTraverseArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceLookupAndTraverseResult struct { + thrift.IResponse + Success *GetNeighborsResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceLookupAndTraverseResult() *GraphStorageServiceLookupAndTraverseResult { + return &GraphStorageServiceLookupAndTraverseResult{} +} + +var GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT *GetNeighborsResponse +func (p *GraphStorageServiceLookupAndTraverseResult) GetSuccess() *GetNeighborsResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceLookupAndTraverseResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceLookupAndTraverseResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetNeighborsResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("lookupAndTraverse_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 *GraphStorageServiceLookupAndTraverseResult) 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 *GraphStorageServiceLookupAndTraverseResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceLookupAndTraverseResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceChainUpdateEdgeArgs struct { + thrift.IRequest + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceChainUpdateEdgeArgs() *GraphStorageServiceChainUpdateEdgeArgs { + return &GraphStorageServiceChainUpdateEdgeArgs{ + Req: NewUpdateEdgeRequest(), + } +} + +var GraphStorageServiceChainUpdateEdgeArgs_Req_DEFAULT *UpdateEdgeRequest +func (p *GraphStorageServiceChainUpdateEdgeArgs) GetReq() *UpdateEdgeRequest { + if !p.IsSetReq() { + return GraphStorageServiceChainUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceChainUpdateEdgeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) 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 *GraphStorageServiceChainUpdateEdgeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewUpdateEdgeRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("chainUpdateEdge_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 *GraphStorageServiceChainUpdateEdgeArgs) 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 *GraphStorageServiceChainUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceChainUpdateEdgeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceChainUpdateEdgeResult struct { + thrift.IResponse + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceChainUpdateEdgeResult() *GraphStorageServiceChainUpdateEdgeResult { + return &GraphStorageServiceChainUpdateEdgeResult{} +} + +var GraphStorageServiceChainUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *GraphStorageServiceChainUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceChainUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceChainUpdateEdgeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) 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 *GraphStorageServiceChainUpdateEdgeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewUpdateResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("chainUpdateEdge_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 *GraphStorageServiceChainUpdateEdgeResult) 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 *GraphStorageServiceChainUpdateEdgeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceChainUpdateEdgeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type GraphStorageServiceChainAddEdgesArgs struct { + thrift.IRequest + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceChainAddEdgesArgs() *GraphStorageServiceChainAddEdgesArgs { + return &GraphStorageServiceChainAddEdgesArgs{ + Req: NewAddEdgesRequest(), + } +} + +var GraphStorageServiceChainAddEdgesArgs_Req_DEFAULT *AddEdgesRequest +func (p *GraphStorageServiceChainAddEdgesArgs) GetReq() *AddEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceChainAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceChainAddEdgesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) 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 *GraphStorageServiceChainAddEdgesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddEdgesRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("chainAddEdges_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 *GraphStorageServiceChainAddEdgesArgs) 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 *GraphStorageServiceChainAddEdgesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("GraphStorageServiceChainAddEdgesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type GraphStorageServiceChainAddEdgesResult struct { + thrift.IResponse + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceChainAddEdgesResult() *GraphStorageServiceChainAddEdgesResult { + return &GraphStorageServiceChainAddEdgesResult{} +} + +var GraphStorageServiceChainAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceChainAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceChainAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceChainAddEdgesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) 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 *GraphStorageServiceChainAddEdgesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewExecResponse() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("chainAddEdges_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 *GraphStorageServiceChainAddEdgesResult) 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 *GraphStorageServiceChainAddEdgesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("GraphStorageServiceChainAddEdgesResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/storage_admin_service-remote/storage_admin_service-remote.go b/ccore/nebula/internal/thrift/v2_6_0/storage/storage_admin_service-remote/storage_admin_service-remote.go new file mode 100755 index 0000000..ad0b77f --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -0,0 +1,540 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package main + +import ( + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + "../../github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/storage" +) + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " AdminExecResp transLeader(TransLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addPart(AddPartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addLearner(AddLearnerReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp removePart(RemovePartReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp memberChange(MemberChangeReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp waitingForCatchUpData(CatchUpDataReq req)") + fmt.Fprintln(os.Stderr, " CreateCPResp createCheckpoint(CreateCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp dropCheckpoint(DropCPRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp blockingWrites(BlockingSignRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildTagIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp rebuildEdgeIndex(RebuildIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetLeaderPartsResp getLeaderParts(GetLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp checkPeers(CheckPeersReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp addAdminTask(AddAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " AdminExecResp stopAdminTask(StopAdminTaskRequest req)") + fmt.Fprintln(os.Stderr, " ListClusterInfoResp listClusterInfo(ListClusterInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + var parsedUrl url.URL + var trans thrift.Transport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Parse() + + if len(urlString) > 0 { + parsedUrl, err := url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewHTTPPostClient(parsedUrl.String()) + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewSocket(thrift.SocketAddr(net.JoinHostPort(host, portStr))) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.ProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + client := storage.NewStorageAdminServiceClientFactory(trans, protocolFactory) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "transLeader": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") + flag.Usage() + } + arg186 := flag.Arg(1) + mbTrans187 := thrift.NewMemoryBufferLen(len(arg186)) + defer mbTrans187.Close() + _, err188 := mbTrans187.WriteString(arg186) + if err188 != nil { + Usage() + return + } + factory189 := thrift.NewSimpleJSONProtocolFactory() + jsProt190 := factory189.GetProtocol(mbTrans187) + argvalue0 := storage.NewTransLeaderReq() + err191 := argvalue0.Read(jsProt190) + if err191 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TransLeader(value0)) + fmt.Print("\n") + break + case "addPart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddPart requires 1 args") + flag.Usage() + } + arg192 := flag.Arg(1) + mbTrans193 := thrift.NewMemoryBufferLen(len(arg192)) + defer mbTrans193.Close() + _, err194 := mbTrans193.WriteString(arg192) + if err194 != nil { + Usage() + return + } + factory195 := thrift.NewSimpleJSONProtocolFactory() + jsProt196 := factory195.GetProtocol(mbTrans193) + argvalue0 := storage.NewAddPartReq() + err197 := argvalue0.Read(jsProt196) + if err197 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddPart(value0)) + fmt.Print("\n") + break + case "addLearner": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") + flag.Usage() + } + arg198 := flag.Arg(1) + mbTrans199 := thrift.NewMemoryBufferLen(len(arg198)) + defer mbTrans199.Close() + _, err200 := mbTrans199.WriteString(arg198) + if err200 != nil { + Usage() + return + } + factory201 := thrift.NewSimpleJSONProtocolFactory() + jsProt202 := factory201.GetProtocol(mbTrans199) + argvalue0 := storage.NewAddLearnerReq() + err203 := argvalue0.Read(jsProt202) + if err203 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddLearner(value0)) + fmt.Print("\n") + break + case "removePart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") + flag.Usage() + } + arg204 := flag.Arg(1) + mbTrans205 := thrift.NewMemoryBufferLen(len(arg204)) + defer mbTrans205.Close() + _, err206 := mbTrans205.WriteString(arg204) + if err206 != nil { + Usage() + return + } + factory207 := thrift.NewSimpleJSONProtocolFactory() + jsProt208 := factory207.GetProtocol(mbTrans205) + argvalue0 := storage.NewRemovePartReq() + err209 := argvalue0.Read(jsProt208) + if err209 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemovePart(value0)) + fmt.Print("\n") + break + case "memberChange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") + flag.Usage() + } + arg210 := flag.Arg(1) + mbTrans211 := thrift.NewMemoryBufferLen(len(arg210)) + defer mbTrans211.Close() + _, err212 := mbTrans211.WriteString(arg210) + if err212 != nil { + Usage() + return + } + factory213 := thrift.NewSimpleJSONProtocolFactory() + jsProt214 := factory213.GetProtocol(mbTrans211) + argvalue0 := storage.NewMemberChangeReq() + err215 := argvalue0.Read(jsProt214) + if err215 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MemberChange(value0)) + fmt.Print("\n") + break + case "waitingForCatchUpData": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") + flag.Usage() + } + arg216 := flag.Arg(1) + mbTrans217 := thrift.NewMemoryBufferLen(len(arg216)) + defer mbTrans217.Close() + _, err218 := mbTrans217.WriteString(arg216) + if err218 != nil { + Usage() + return + } + factory219 := thrift.NewSimpleJSONProtocolFactory() + jsProt220 := factory219.GetProtocol(mbTrans217) + argvalue0 := storage.NewCatchUpDataReq() + err221 := argvalue0.Read(jsProt220) + if err221 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.WaitingForCatchUpData(value0)) + fmt.Print("\n") + break + case "createCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") + flag.Usage() + } + arg222 := flag.Arg(1) + mbTrans223 := thrift.NewMemoryBufferLen(len(arg222)) + defer mbTrans223.Close() + _, err224 := mbTrans223.WriteString(arg222) + if err224 != nil { + Usage() + return + } + factory225 := thrift.NewSimpleJSONProtocolFactory() + jsProt226 := factory225.GetProtocol(mbTrans223) + argvalue0 := storage.NewCreateCPRequest() + err227 := argvalue0.Read(jsProt226) + if err227 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateCheckpoint(value0)) + fmt.Print("\n") + break + case "dropCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") + flag.Usage() + } + arg228 := flag.Arg(1) + mbTrans229 := thrift.NewMemoryBufferLen(len(arg228)) + defer mbTrans229.Close() + _, err230 := mbTrans229.WriteString(arg228) + if err230 != nil { + Usage() + return + } + factory231 := thrift.NewSimpleJSONProtocolFactory() + jsProt232 := factory231.GetProtocol(mbTrans229) + argvalue0 := storage.NewDropCPRequest() + err233 := argvalue0.Read(jsProt232) + if err233 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropCheckpoint(value0)) + fmt.Print("\n") + break + case "blockingWrites": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") + flag.Usage() + } + arg234 := flag.Arg(1) + mbTrans235 := thrift.NewMemoryBufferLen(len(arg234)) + defer mbTrans235.Close() + _, err236 := mbTrans235.WriteString(arg234) + if err236 != nil { + Usage() + return + } + factory237 := thrift.NewSimpleJSONProtocolFactory() + jsProt238 := factory237.GetProtocol(mbTrans235) + argvalue0 := storage.NewBlockingSignRequest() + err239 := argvalue0.Read(jsProt238) + if err239 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BlockingWrites(value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg240 := flag.Arg(1) + mbTrans241 := thrift.NewMemoryBufferLen(len(arg240)) + defer mbTrans241.Close() + _, err242 := mbTrans241.WriteString(arg240) + if err242 != nil { + Usage() + return + } + factory243 := thrift.NewSimpleJSONProtocolFactory() + jsProt244 := factory243.GetProtocol(mbTrans241) + argvalue0 := storage.NewRebuildIndexRequest() + err245 := argvalue0.Read(jsProt244) + if err245 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg246 := flag.Arg(1) + mbTrans247 := thrift.NewMemoryBufferLen(len(arg246)) + defer mbTrans247.Close() + _, err248 := mbTrans247.WriteString(arg246) + if err248 != nil { + Usage() + return + } + factory249 := thrift.NewSimpleJSONProtocolFactory() + jsProt250 := factory249.GetProtocol(mbTrans247) + argvalue0 := storage.NewRebuildIndexRequest() + err251 := argvalue0.Read(jsProt250) + if err251 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(value0)) + fmt.Print("\n") + break + case "getLeaderParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") + flag.Usage() + } + arg252 := flag.Arg(1) + mbTrans253 := thrift.NewMemoryBufferLen(len(arg252)) + defer mbTrans253.Close() + _, err254 := mbTrans253.WriteString(arg252) + if err254 != nil { + Usage() + return + } + factory255 := thrift.NewSimpleJSONProtocolFactory() + jsProt256 := factory255.GetProtocol(mbTrans253) + argvalue0 := storage.NewGetLeaderReq() + err257 := argvalue0.Read(jsProt256) + if err257 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetLeaderParts(value0)) + fmt.Print("\n") + break + case "checkPeers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") + flag.Usage() + } + arg258 := flag.Arg(1) + mbTrans259 := thrift.NewMemoryBufferLen(len(arg258)) + defer mbTrans259.Close() + _, err260 := mbTrans259.WriteString(arg258) + if err260 != nil { + Usage() + return + } + factory261 := thrift.NewSimpleJSONProtocolFactory() + jsProt262 := factory261.GetProtocol(mbTrans259) + argvalue0 := storage.NewCheckPeersReq() + err263 := argvalue0.Read(jsProt262) + if err263 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckPeers(value0)) + fmt.Print("\n") + break + case "addAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") + flag.Usage() + } + arg264 := flag.Arg(1) + mbTrans265 := thrift.NewMemoryBufferLen(len(arg264)) + defer mbTrans265.Close() + _, err266 := mbTrans265.WriteString(arg264) + if err266 != nil { + Usage() + return + } + factory267 := thrift.NewSimpleJSONProtocolFactory() + jsProt268 := factory267.GetProtocol(mbTrans265) + argvalue0 := storage.NewAddAdminTaskRequest() + err269 := argvalue0.Read(jsProt268) + if err269 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddAdminTask(value0)) + fmt.Print("\n") + break + case "stopAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") + flag.Usage() + } + arg270 := flag.Arg(1) + mbTrans271 := thrift.NewMemoryBufferLen(len(arg270)) + defer mbTrans271.Close() + _, err272 := mbTrans271.WriteString(arg270) + if err272 != nil { + Usage() + return + } + factory273 := thrift.NewSimpleJSONProtocolFactory() + jsProt274 := factory273.GetProtocol(mbTrans271) + argvalue0 := storage.NewStopAdminTaskRequest() + err275 := argvalue0.Read(jsProt274) + if err275 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.StopAdminTask(value0)) + fmt.Print("\n") + break + case "listClusterInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListClusterInfo requires 1 args") + flag.Usage() + } + arg276 := flag.Arg(1) + mbTrans277 := thrift.NewMemoryBufferLen(len(arg276)) + defer mbTrans277.Close() + _, err278 := mbTrans277.WriteString(arg276) + if err278 != nil { + Usage() + return + } + factory279 := thrift.NewSimpleJSONProtocolFactory() + jsProt280 := factory279.GetProtocol(mbTrans277) + argvalue0 := storage.NewListClusterInfoReq() + err281 := argvalue0.Read(jsProt280) + if err281 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListClusterInfo(value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/storageadminservice.go b/ccore/nebula/internal/thrift/v2_6_0/storage/storageadminservice.go new file mode 100644 index 0000000..998e1cb --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/storageadminservice.go @@ -0,0 +1,5142 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +type StorageAdminService interface { + // Parameters: + // - Req + TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClientInterface interface { + thrift.ClientInterface + // Parameters: + // - Req + TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddPart(req *AddPartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) + // Parameters: + // - Req + DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) + // Parameters: + // - Req + CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) + // Parameters: + // - Req + AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) + // Parameters: + // - Req + ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) +} + +type StorageAdminServiceClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn +} + +func(client *StorageAdminServiceClient) Open() error { + return client.CC.Open() +} + +func(client *StorageAdminServiceClient) Close() error { + return client.CC.Close() +} + +func(client *StorageAdminServiceClient) IsOpen() bool { + return client.CC.IsOpen() +} + +func NewStorageAdminServiceClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceClientProtocol(prot thrift.Protocol) *StorageAdminServiceClient { + return NewStorageAdminServiceClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceThreadsafeClient struct { + StorageAdminServiceClientInterface + CC thrift.ClientConn + Mu sync.Mutex +} + +func(client *StorageAdminServiceThreadsafeClient) Open() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Open() +} + +func(client *StorageAdminServiceThreadsafeClient) Close() error { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.Close() +} + +func(client *StorageAdminServiceThreadsafeClient) IsOpen() bool { + client.Mu.Lock() + defer client.Mu.Unlock() + return client.CC.IsOpen() +} + +func NewStorageAdminServiceThreadsafeClientFactory(t thrift.Transport, f thrift.ProtocolFactory) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConn(t, f) } +} + +func NewStorageAdminServiceThreadsafeClient(t thrift.Transport, iprot thrift.Protocol, oprot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return &StorageAdminServiceThreadsafeClient{ CC: thrift.NewClientConnWithProtocols(t, iprot, oprot) } +} + +func NewStorageAdminServiceThreadsafeClientProtocol(prot thrift.Protocol) *StorageAdminServiceThreadsafeClient { + return NewStorageAdminServiceThreadsafeClient(prot.Transport(), prot, prot) +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) TransLeader(req *TransLeaderReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + err = p.CC.SendMsg("transLeader", &args, thrift.CALL) + if err != nil { return } + return p.recvTransLeader() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvTransLeader() (value *AdminExecResp, err error) { + var result StorageAdminServiceTransLeaderResult + err = p.CC.RecvMsg("transLeader", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddPart(req *AddPartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + err = p.CC.SendMsg("addPart", &args, thrift.CALL) + if err != nil { return } + return p.recvAddPart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddPart() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddPartResult + err = p.CC.RecvMsg("addPart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddLearner(req *AddLearnerReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + err = p.CC.SendMsg("addLearner", &args, thrift.CALL) + if err != nil { return } + return p.recvAddLearner() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddLearner() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddLearnerResult + err = p.CC.RecvMsg("addLearner", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RemovePart(req *RemovePartReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + err = p.CC.SendMsg("removePart", &args, thrift.CALL) + if err != nil { return } + return p.recvRemovePart() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRemovePart() (value *AdminExecResp, err error) { + var result StorageAdminServiceRemovePartResult + err = p.CC.RecvMsg("removePart", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) MemberChange(req *MemberChangeReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + err = p.CC.SendMsg("memberChange", &args, thrift.CALL) + if err != nil { return } + return p.recvMemberChange() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvMemberChange() (value *AdminExecResp, err error) { + var result StorageAdminServiceMemberChangeResult + err = p.CC.RecvMsg("memberChange", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) WaitingForCatchUpData(req *CatchUpDataReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + err = p.CC.SendMsg("waitingForCatchUpData", &args, thrift.CALL) + if err != nil { return } + return p.recvWaitingForCatchUpData() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvWaitingForCatchUpData() (value *AdminExecResp, err error) { + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.CC.RecvMsg("waitingForCatchUpData", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CreateCheckpoint(req *CreateCPRequest) (_r *CreateCPResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("createCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvCreateCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCreateCheckpoint() (value *CreateCPResp, err error) { + var result StorageAdminServiceCreateCheckpointResult + err = p.CC.RecvMsg("createCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) DropCheckpoint(req *DropCPRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + err = p.CC.SendMsg("dropCheckpoint", &args, thrift.CALL) + if err != nil { return } + return p.recvDropCheckpoint() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvDropCheckpoint() (value *AdminExecResp, err error) { + var result StorageAdminServiceDropCheckpointResult + err = p.CC.RecvMsg("dropCheckpoint", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) BlockingWrites(req *BlockingSignRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + err = p.CC.SendMsg("blockingWrites", &args, thrift.CALL) + if err != nil { return } + return p.recvBlockingWrites() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvBlockingWrites() (value *AdminExecResp, err error) { + var result StorageAdminServiceBlockingWritesResult + err = p.CC.RecvMsg("blockingWrites", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildTagIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildTagIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildTagIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildTagIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildTagIndexResult + err = p.CC.RecvMsg("rebuildTagIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) RebuildEdgeIndex(req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + err = p.CC.SendMsg("rebuildEdgeIndex", &args, thrift.CALL) + if err != nil { return } + return p.recvRebuildEdgeIndex() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvRebuildEdgeIndex() (value *AdminExecResp, err error) { + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.CC.RecvMsg("rebuildEdgeIndex", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + err = p.CC.SendMsg("getLeaderParts", &args, thrift.CALL) + if err != nil { return } + return p.recvGetLeaderParts() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvGetLeaderParts() (value *GetLeaderPartsResp, err error) { + var result StorageAdminServiceGetLeaderPartsResult + err = p.CC.RecvMsg("getLeaderParts", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + err = p.CC.SendMsg("checkPeers", &args, thrift.CALL) + if err != nil { return } + return p.recvCheckPeers() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvCheckPeers() (value *AdminExecResp, err error) { + var result StorageAdminServiceCheckPeersResult + err = p.CC.RecvMsg("checkPeers", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) AddAdminTask(req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("addAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvAddAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvAddAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceAddAdminTaskResult + err = p.CC.RecvMsg("addAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) StopAdminTask(req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + err = p.CC.SendMsg("stopAdminTask", &args, thrift.CALL) + if err != nil { return } + return p.recvStopAdminTask() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvStopAdminTask() (value *AdminExecResp, err error) { + var result StorageAdminServiceStopAdminTaskResult + err = p.CC.RecvMsg("stopAdminTask", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceThreadsafeClient) ListClusterInfo(req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + p.Mu.Lock() + defer p.Mu.Unlock() + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + err = p.CC.SendMsg("listClusterInfo", &args, thrift.CALL) + if err != nil { return } + return p.recvListClusterInfo() +} + + +func (p *StorageAdminServiceThreadsafeClient) recvListClusterInfo() (value *ListClusterInfoResp, err error) { + var result StorageAdminServiceListClusterInfoResult + err = p.CC.RecvMsg("listClusterInfo", &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceChannelClient struct { + RequestChannel thrift.RequestChannel +} + +func (c *StorageAdminServiceChannelClient) Close() error { + return c.RequestChannel.Close() +} + +func (c *StorageAdminServiceChannelClient) IsOpen() bool { + return c.RequestChannel.IsOpen() +} + +func (c *StorageAdminServiceChannelClient) Open() error { + return c.RequestChannel.Open() +} + +func NewStorageAdminServiceChannelClient(channel thrift.RequestChannel) *StorageAdminServiceChannelClient { + return &StorageAdminServiceChannelClient{RequestChannel: channel} +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceTransLeaderArgs{ + Req : req, + } + var result StorageAdminServiceTransLeaderResult + err = p.RequestChannel.Call(ctx, "transLeader", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddPartArgs{ + Req : req, + } + var result StorageAdminServiceAddPartResult + err = p.RequestChannel.Call(ctx, "addPart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddLearnerArgs{ + Req : req, + } + var result StorageAdminServiceAddLearnerResult + err = p.RequestChannel.Call(ctx, "addLearner", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRemovePartArgs{ + Req : req, + } + var result StorageAdminServiceRemovePartResult + err = p.RequestChannel.Call(ctx, "removePart", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceMemberChangeArgs{ + Req : req, + } + var result StorageAdminServiceMemberChangeResult + err = p.RequestChannel.Call(ctx, "memberChange", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{ + Req : req, + } + var result StorageAdminServiceWaitingForCatchUpDataResult + err = p.RequestChannel.Call(ctx, "waitingForCatchUpData", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, err error) { + args := StorageAdminServiceCreateCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceCreateCheckpointResult + err = p.RequestChannel.Call(ctx, "createCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceDropCheckpointArgs{ + Req : req, + } + var result StorageAdminServiceDropCheckpointResult + err = p.RequestChannel.Call(ctx, "dropCheckpoint", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceBlockingWritesArgs{ + Req : req, + } + var result StorageAdminServiceBlockingWritesResult + err = p.RequestChannel.Call(ctx, "blockingWrites", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildTagIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildTagIndexResult + err = p.RequestChannel.Call(ctx, "rebuildTagIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceRebuildEdgeIndexArgs{ + Req : req, + } + var result StorageAdminServiceRebuildEdgeIndexResult + err = p.RequestChannel.Call(ctx, "rebuildEdgeIndex", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) { + args := StorageAdminServiceGetLeaderPartsArgs{ + Req : req, + } + var result StorageAdminServiceGetLeaderPartsResult + err = p.RequestChannel.Call(ctx, "getLeaderParts", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, err error) { + args := StorageAdminServiceCheckPeersArgs{ + Req : req, + } + var result StorageAdminServiceCheckPeersResult + err = p.RequestChannel.Call(ctx, "checkPeers", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) AddAdminTask(ctx context.Context, req *AddAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceAddAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceAddAdminTaskResult + err = p.RequestChannel.Call(ctx, "addAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) StopAdminTask(ctx context.Context, req *StopAdminTaskRequest) (_r *AdminExecResp, err error) { + args := StorageAdminServiceStopAdminTaskArgs{ + Req : req, + } + var result StorageAdminServiceStopAdminTaskResult + err = p.RequestChannel.Call(ctx, "stopAdminTask", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *StorageAdminServiceChannelClient) ListClusterInfo(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, err error) { + args := StorageAdminServiceListClusterInfoArgs{ + Req : req, + } + var result StorageAdminServiceListClusterInfoResult + err = p.RequestChannel.Call(ctx, "listClusterInfo", &args, &result) + if err != nil { return } + + return result.GetSuccess(), nil +} + + +type StorageAdminServiceProcessor struct { + processorMap map[string]thrift.ProcessorFunctionContext + handler StorageAdminService +} + +func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { + p.processorMap[key] = processor +} + +func (p *StorageAdminServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { + if processor, ok := p.processorMap[key]; ok { + return processor, nil + } + return nil, nil // generic error message will be sent +} + +func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { + return p.processorMap +} + +func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { + self184 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext)} + self184.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self184.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self184.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self184.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self184.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self184.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self184.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self184.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self184.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self184.processorMap["rebuildTagIndex"] = &storageAdminServiceProcessorRebuildTagIndex{handler:handler} + self184.processorMap["rebuildEdgeIndex"] = &storageAdminServiceProcessorRebuildEdgeIndex{handler:handler} + self184.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self184.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self184.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self184.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self184.processorMap["listClusterInfo"] = &storageAdminServiceProcessorListClusterInfo{handler:handler} + return self184 +} + +type storageAdminServiceProcessorTransLeader struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorTransLeader) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceTransLeaderArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorTransLeader) 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("transLeader", 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 *storageAdminServiceProcessorTransLeader) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceTransLeaderArgs) + var result StorageAdminServiceTransLeaderResult + if retval, err := p.handler.TransLeader(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transLeader: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddPart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddPart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddPartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddPart) 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("addPart", 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 *storageAdminServiceProcessorAddPart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddPartArgs) + var result StorageAdminServiceAddPartResult + if retval, err := p.handler.AddPart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addPart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddLearner struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddLearner) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddLearnerArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddLearner) 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("addLearner", 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 *storageAdminServiceProcessorAddLearner) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddLearnerArgs) + var result StorageAdminServiceAddLearnerResult + if retval, err := p.handler.AddLearner(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addLearner: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRemovePart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRemovePart) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRemovePartArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRemovePart) 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("removePart", 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 *storageAdminServiceProcessorRemovePart) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRemovePartArgs) + var result StorageAdminServiceRemovePartResult + if retval, err := p.handler.RemovePart(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removePart: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorMemberChange struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorMemberChange) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceMemberChangeArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorMemberChange) 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("memberChange", 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 *storageAdminServiceProcessorMemberChange) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceMemberChangeArgs) + var result StorageAdminServiceMemberChangeResult + if retval, err := p.handler.MemberChange(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing memberChange: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorWaitingForCatchUpData struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceWaitingForCatchUpDataArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) 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("waitingForCatchUpData", 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 *storageAdminServiceProcessorWaitingForCatchUpData) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceWaitingForCatchUpDataArgs) + var result StorageAdminServiceWaitingForCatchUpDataResult + if retval, err := p.handler.WaitingForCatchUpData(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing waitingForCatchUpData: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCreateCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCreateCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) 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("createCheckpoint", 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 *storageAdminServiceProcessorCreateCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCreateCheckpointArgs) + var result StorageAdminServiceCreateCheckpointResult + if retval, err := p.handler.CreateCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorDropCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorDropCheckpoint) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceDropCheckpointArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorDropCheckpoint) 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("dropCheckpoint", 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 *storageAdminServiceProcessorDropCheckpoint) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceDropCheckpointArgs) + var result StorageAdminServiceDropCheckpointResult + if retval, err := p.handler.DropCheckpoint(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropCheckpoint: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorBlockingWrites struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorBlockingWrites) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceBlockingWritesArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorBlockingWrites) 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("blockingWrites", 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 *storageAdminServiceProcessorBlockingWrites) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceBlockingWritesArgs) + var result StorageAdminServiceBlockingWritesResult + if retval, err := p.handler.BlockingWrites(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing blockingWrites: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildTagIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildTagIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildTagIndex) 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("rebuildTagIndex", 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 *storageAdminServiceProcessorRebuildTagIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildTagIndexArgs) + var result StorageAdminServiceRebuildTagIndexResult + if retval, err := p.handler.RebuildTagIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorRebuildEdgeIndex struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceRebuildEdgeIndexArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorRebuildEdgeIndex) 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("rebuildEdgeIndex", 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 *storageAdminServiceProcessorRebuildEdgeIndex) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceRebuildEdgeIndexArgs) + var result StorageAdminServiceRebuildEdgeIndexResult + if retval, err := p.handler.RebuildEdgeIndex(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorGetLeaderParts struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorGetLeaderParts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceGetLeaderPartsArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorGetLeaderParts) 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("getLeaderParts", 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 *storageAdminServiceProcessorGetLeaderParts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceGetLeaderPartsArgs) + var result StorageAdminServiceGetLeaderPartsResult + if retval, err := p.handler.GetLeaderParts(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getLeaderParts: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorCheckPeers struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCheckPeers) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceCheckPeersArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorCheckPeers) 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("checkPeers", 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 *storageAdminServiceProcessorCheckPeers) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceCheckPeersArgs) + var result StorageAdminServiceCheckPeersResult + if retval, err := p.handler.CheckPeers(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPeers: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorAddAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceAddAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorAddAdminTask) 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("addAdminTask", 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 *storageAdminServiceProcessorAddAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceAddAdminTaskArgs) + var result StorageAdminServiceAddAdminTaskResult + if retval, err := p.handler.AddAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorStopAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorStopAdminTask) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceStopAdminTaskArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorStopAdminTask) 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("stopAdminTask", 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 *storageAdminServiceProcessorStopAdminTask) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceStopAdminTaskArgs) + var result StorageAdminServiceStopAdminTaskResult + if retval, err := p.handler.StopAdminTask(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stopAdminTask: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + +type storageAdminServiceProcessorListClusterInfo struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorListClusterInfo) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { + args := StorageAdminServiceListClusterInfoArgs{} + if err := args.Read(iprot); err != nil { + return nil, err + } + iprot.ReadMessageEnd() + return &args, nil +} + +func (p *storageAdminServiceProcessorListClusterInfo) 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("listClusterInfo", 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 *storageAdminServiceProcessorListClusterInfo) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { + args := argStruct.(*StorageAdminServiceListClusterInfoArgs) + var result StorageAdminServiceListClusterInfoResult + if retval, err := p.handler.ListClusterInfo(ctx, args.Req); err != nil { + switch err.(type) { + default: + x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listClusterInfo: " + err.Error()) + return x, x + } + } else { + result.Success = retval + } + return &result, nil +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type StorageAdminServiceTransLeaderArgs struct { + thrift.IRequest + Req *TransLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceTransLeaderArgs() *StorageAdminServiceTransLeaderArgs { + return &StorageAdminServiceTransLeaderArgs{ + Req: NewTransLeaderReq(), + } +} + +var StorageAdminServiceTransLeaderArgs_Req_DEFAULT *TransLeaderReq +func (p *StorageAdminServiceTransLeaderArgs) GetReq() *TransLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceTransLeaderArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceTransLeaderArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewTransLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderArgs) 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 *StorageAdminServiceTransLeaderArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceTransLeaderResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceTransLeaderResult() *StorageAdminServiceTransLeaderResult { + return &StorageAdminServiceTransLeaderResult{} +} + +var StorageAdminServiceTransLeaderResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceTransLeaderResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceTransLeaderResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceTransLeaderResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("transLeader_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 *StorageAdminServiceTransLeaderResult) 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 *StorageAdminServiceTransLeaderResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceTransLeaderResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddPartArgs struct { + thrift.IRequest + Req *AddPartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddPartArgs() *StorageAdminServiceAddPartArgs { + return &StorageAdminServiceAddPartArgs{ + Req: NewAddPartReq(), + } +} + +var StorageAdminServiceAddPartArgs_Req_DEFAULT *AddPartReq +func (p *StorageAdminServiceAddPartArgs) GetReq() *AddPartReq { + if !p.IsSetReq() { + return StorageAdminServiceAddPartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddPartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddPartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartArgs) 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 *StorageAdminServiceAddPartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddPartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddPartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddPartResult() *StorageAdminServiceAddPartResult { + return &StorageAdminServiceAddPartResult{} +} + +var StorageAdminServiceAddPartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddPartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddPartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddPartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addPart_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 *StorageAdminServiceAddPartResult) 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 *StorageAdminServiceAddPartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddPartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddLearnerArgs struct { + thrift.IRequest + Req *AddLearnerReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddLearnerArgs() *StorageAdminServiceAddLearnerArgs { + return &StorageAdminServiceAddLearnerArgs{ + Req: NewAddLearnerReq(), + } +} + +var StorageAdminServiceAddLearnerArgs_Req_DEFAULT *AddLearnerReq +func (p *StorageAdminServiceAddLearnerArgs) GetReq() *AddLearnerReq { + if !p.IsSetReq() { + return StorageAdminServiceAddLearnerArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddLearnerArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddLearnerReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerArgs) 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 *StorageAdminServiceAddLearnerArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddLearnerResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddLearnerResult() *StorageAdminServiceAddLearnerResult { + return &StorageAdminServiceAddLearnerResult{} +} + +var StorageAdminServiceAddLearnerResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddLearnerResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddLearnerResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddLearnerResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addLearner_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 *StorageAdminServiceAddLearnerResult) 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 *StorageAdminServiceAddLearnerResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddLearnerResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRemovePartArgs struct { + thrift.IRequest + Req *RemovePartReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRemovePartArgs() *StorageAdminServiceRemovePartArgs { + return &StorageAdminServiceRemovePartArgs{ + Req: NewRemovePartReq(), + } +} + +var StorageAdminServiceRemovePartArgs_Req_DEFAULT *RemovePartReq +func (p *StorageAdminServiceRemovePartArgs) GetReq() *RemovePartReq { + if !p.IsSetReq() { + return StorageAdminServiceRemovePartArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRemovePartArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRemovePartReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartArgs) 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 *StorageAdminServiceRemovePartArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRemovePartArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRemovePartResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRemovePartResult() *StorageAdminServiceRemovePartResult { + return &StorageAdminServiceRemovePartResult{} +} + +var StorageAdminServiceRemovePartResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRemovePartResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRemovePartResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRemovePartResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("removePart_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 *StorageAdminServiceRemovePartResult) 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 *StorageAdminServiceRemovePartResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRemovePartResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceMemberChangeArgs struct { + thrift.IRequest + Req *MemberChangeReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceMemberChangeArgs() *StorageAdminServiceMemberChangeArgs { + return &StorageAdminServiceMemberChangeArgs{ + Req: NewMemberChangeReq(), + } +} + +var StorageAdminServiceMemberChangeArgs_Req_DEFAULT *MemberChangeReq +func (p *StorageAdminServiceMemberChangeArgs) GetReq() *MemberChangeReq { + if !p.IsSetReq() { + return StorageAdminServiceMemberChangeArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceMemberChangeArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewMemberChangeReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeArgs) 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 *StorageAdminServiceMemberChangeArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceMemberChangeResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceMemberChangeResult() *StorageAdminServiceMemberChangeResult { + return &StorageAdminServiceMemberChangeResult{} +} + +var StorageAdminServiceMemberChangeResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceMemberChangeResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceMemberChangeResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceMemberChangeResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("memberChange_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 *StorageAdminServiceMemberChangeResult) 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 *StorageAdminServiceMemberChangeResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceMemberChangeResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceWaitingForCatchUpDataArgs struct { + thrift.IRequest + Req *CatchUpDataReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataArgs() *StorageAdminServiceWaitingForCatchUpDataArgs { + return &StorageAdminServiceWaitingForCatchUpDataArgs{ + Req: NewCatchUpDataReq(), + } +} + +var StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT *CatchUpDataReq +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) GetReq() *CatchUpDataReq { + if !p.IsSetReq() { + return StorageAdminServiceWaitingForCatchUpDataArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCatchUpDataReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataArgs) 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 *StorageAdminServiceWaitingForCatchUpDataArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceWaitingForCatchUpDataResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceWaitingForCatchUpDataResult() *StorageAdminServiceWaitingForCatchUpDataResult { + return &StorageAdminServiceWaitingForCatchUpDataResult{} +} + +var StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceWaitingForCatchUpDataResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceWaitingForCatchUpDataResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceWaitingForCatchUpDataResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("waitingForCatchUpData_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 *StorageAdminServiceWaitingForCatchUpDataResult) 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 *StorageAdminServiceWaitingForCatchUpDataResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceWaitingForCatchUpDataResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCreateCheckpointArgs struct { + thrift.IRequest + Req *CreateCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCreateCheckpointArgs() *StorageAdminServiceCreateCheckpointArgs { + return &StorageAdminServiceCreateCheckpointArgs{ + Req: NewCreateCPRequest(), + } +} + +var StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT *CreateCPRequest +func (p *StorageAdminServiceCreateCheckpointArgs) GetReq() *CreateCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceCreateCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCreateCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCreateCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointArgs) 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 *StorageAdminServiceCreateCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCreateCheckpointResult struct { + thrift.IResponse + Success *CreateCPResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCreateCheckpointResult() *StorageAdminServiceCreateCheckpointResult { + return &StorageAdminServiceCreateCheckpointResult{} +} + +var StorageAdminServiceCreateCheckpointResult_Success_DEFAULT *CreateCPResp +func (p *StorageAdminServiceCreateCheckpointResult) GetSuccess() *CreateCPResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCreateCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCreateCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewCreateCPResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("createCheckpoint_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 *StorageAdminServiceCreateCheckpointResult) 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 *StorageAdminServiceCreateCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCreateCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceDropCheckpointArgs struct { + thrift.IRequest + Req *DropCPRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceDropCheckpointArgs() *StorageAdminServiceDropCheckpointArgs { + return &StorageAdminServiceDropCheckpointArgs{ + Req: NewDropCPRequest(), + } +} + +var StorageAdminServiceDropCheckpointArgs_Req_DEFAULT *DropCPRequest +func (p *StorageAdminServiceDropCheckpointArgs) GetReq() *DropCPRequest { + if !p.IsSetReq() { + return StorageAdminServiceDropCheckpointArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceDropCheckpointArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewDropCPRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointArgs) 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 *StorageAdminServiceDropCheckpointArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceDropCheckpointResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { + return &StorageAdminServiceDropCheckpointResult{} +} + +var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceDropCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("dropCheckpoint_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 *StorageAdminServiceDropCheckpointResult) 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 *StorageAdminServiceDropCheckpointResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceDropCheckpointResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceBlockingWritesArgs struct { + thrift.IRequest + Req *BlockingSignRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceBlockingWritesArgs() *StorageAdminServiceBlockingWritesArgs { + return &StorageAdminServiceBlockingWritesArgs{ + Req: NewBlockingSignRequest(), + } +} + +var StorageAdminServiceBlockingWritesArgs_Req_DEFAULT *BlockingSignRequest +func (p *StorageAdminServiceBlockingWritesArgs) GetReq() *BlockingSignRequest { + if !p.IsSetReq() { + return StorageAdminServiceBlockingWritesArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceBlockingWritesArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewBlockingSignRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesArgs) 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 *StorageAdminServiceBlockingWritesArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceBlockingWritesResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { + return &StorageAdminServiceBlockingWritesResult{} +} + +var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceBlockingWritesResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("blockingWrites_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 *StorageAdminServiceBlockingWritesResult) 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 *StorageAdminServiceBlockingWritesResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceBlockingWritesResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildTagIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildTagIndexArgs() *StorageAdminServiceRebuildTagIndexArgs { + return &StorageAdminServiceRebuildTagIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildTagIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildTagIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildTagIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexArgs) 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 *StorageAdminServiceRebuildTagIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildTagIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildTagIndexResult() *StorageAdminServiceRebuildTagIndexResult { + return &StorageAdminServiceRebuildTagIndexResult{} +} + +var StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildTagIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildTagIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildTagIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildTagIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildTagIndex_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 *StorageAdminServiceRebuildTagIndexResult) 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 *StorageAdminServiceRebuildTagIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildTagIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceRebuildEdgeIndexArgs struct { + thrift.IRequest + Req *RebuildIndexRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceRebuildEdgeIndexArgs() *StorageAdminServiceRebuildEdgeIndexArgs { + return &StorageAdminServiceRebuildEdgeIndexArgs{ + Req: NewRebuildIndexRequest(), + } +} + +var StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT *RebuildIndexRequest +func (p *StorageAdminServiceRebuildEdgeIndexArgs) GetReq() *RebuildIndexRequest { + if !p.IsSetReq() { + return StorageAdminServiceRebuildEdgeIndexArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceRebuildEdgeIndexArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewRebuildIndexRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexArgs) 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 *StorageAdminServiceRebuildEdgeIndexArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceRebuildEdgeIndexResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceRebuildEdgeIndexResult() *StorageAdminServiceRebuildEdgeIndexResult { + return &StorageAdminServiceRebuildEdgeIndexResult{} +} + +var StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceRebuildEdgeIndexResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceRebuildEdgeIndexResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceRebuildEdgeIndexResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRebuildEdgeIndexResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("rebuildEdgeIndex_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 *StorageAdminServiceRebuildEdgeIndexResult) 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 *StorageAdminServiceRebuildEdgeIndexResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceRebuildEdgeIndexResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceGetLeaderPartsArgs struct { + thrift.IRequest + Req *GetLeaderReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceGetLeaderPartsArgs() *StorageAdminServiceGetLeaderPartsArgs { + return &StorageAdminServiceGetLeaderPartsArgs{ + Req: NewGetLeaderReq(), + } +} + +var StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT *GetLeaderReq +func (p *StorageAdminServiceGetLeaderPartsArgs) GetReq() *GetLeaderReq { + if !p.IsSetReq() { + return StorageAdminServiceGetLeaderPartsArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceGetLeaderPartsArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewGetLeaderReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsArgs) 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 *StorageAdminServiceGetLeaderPartsArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceGetLeaderPartsResult struct { + thrift.IResponse + Success *GetLeaderPartsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceGetLeaderPartsResult() *StorageAdminServiceGetLeaderPartsResult { + return &StorageAdminServiceGetLeaderPartsResult{} +} + +var StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT *GetLeaderPartsResp +func (p *StorageAdminServiceGetLeaderPartsResult) GetSuccess() *GetLeaderPartsResp { + if !p.IsSetSuccess() { + return StorageAdminServiceGetLeaderPartsResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceGetLeaderPartsResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewGetLeaderPartsResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("getLeaderParts_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 *StorageAdminServiceGetLeaderPartsResult) 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 *StorageAdminServiceGetLeaderPartsResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceGetLeaderPartsResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceCheckPeersArgs struct { + thrift.IRequest + Req *CheckPeersReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceCheckPeersArgs() *StorageAdminServiceCheckPeersArgs { + return &StorageAdminServiceCheckPeersArgs{ + Req: NewCheckPeersReq(), + } +} + +var StorageAdminServiceCheckPeersArgs_Req_DEFAULT *CheckPeersReq +func (p *StorageAdminServiceCheckPeersArgs) GetReq() *CheckPeersReq { + if !p.IsSetReq() { + return StorageAdminServiceCheckPeersArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceCheckPeersArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewCheckPeersReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersArgs) 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 *StorageAdminServiceCheckPeersArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceCheckPeersResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceCheckPeersResult() *StorageAdminServiceCheckPeersResult { + return &StorageAdminServiceCheckPeersResult{} +} + +var StorageAdminServiceCheckPeersResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceCheckPeersResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceCheckPeersResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceCheckPeersResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("checkPeers_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 *StorageAdminServiceCheckPeersResult) 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 *StorageAdminServiceCheckPeersResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceCheckPeersResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceAddAdminTaskArgs struct { + thrift.IRequest + Req *AddAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { + return &StorageAdminServiceAddAdminTaskArgs{ + Req: NewAddAdminTaskRequest(), + } +} + +var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddAdminTaskRequest +func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewAddAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskArgs) 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 *StorageAdminServiceAddAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceAddAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { + return &StorageAdminServiceAddAdminTaskResult{} +} + +var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("addAdminTask_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 *StorageAdminServiceAddAdminTaskResult) 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 *StorageAdminServiceAddAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceAddAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceStopAdminTaskArgs struct { + thrift.IRequest + Req *StopAdminTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { + return &StorageAdminServiceStopAdminTaskArgs{ + Req: NewStopAdminTaskRequest(), + } +} + +var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopAdminTaskRequest +func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopAdminTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewStopAdminTaskRequest() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskArgs) 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 *StorageAdminServiceStopAdminTaskArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceStopAdminTaskResult struct { + thrift.IResponse + Success *AdminExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { + return &StorageAdminServiceStopAdminTaskResult{} +} + +var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *AdminExecResp +func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *AdminExecResp { + if !p.IsSetSuccess() { + return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewAdminExecResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("stopAdminTask_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 *StorageAdminServiceStopAdminTaskResult) 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 *StorageAdminServiceStopAdminTaskResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceStopAdminTaskResult({Success:%s})", successVal) +} + +// Attributes: +// - Req +type StorageAdminServiceListClusterInfoArgs struct { + thrift.IRequest + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceListClusterInfoArgs() *StorageAdminServiceListClusterInfoArgs { + return &StorageAdminServiceListClusterInfoArgs{ + Req: NewListClusterInfoReq(), + } +} + +var StorageAdminServiceListClusterInfoArgs_Req_DEFAULT *ListClusterInfoReq +func (p *StorageAdminServiceListClusterInfoArgs) GetReq() *ListClusterInfoReq { + if !p.IsSetReq() { + return StorageAdminServiceListClusterInfoArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceListClusterInfoArgs) IsSetReq() bool { + return p != nil && p.Req != nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) ReadField1(iprot thrift.Protocol) error { + p.Req = NewListClusterInfoReq() + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoArgs) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoArgs) 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 *StorageAdminServiceListClusterInfoArgs) String() string { + if p == nil { + return "" + } + + var reqVal string + if p.Req == nil { + reqVal = "" + } else { + reqVal = fmt.Sprintf("%v", p.Req) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoArgs({Req:%s})", reqVal) +} + +// Attributes: +// - Success +type StorageAdminServiceListClusterInfoResult struct { + thrift.IResponse + Success *ListClusterInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceListClusterInfoResult() *StorageAdminServiceListClusterInfoResult { + return &StorageAdminServiceListClusterInfoResult{} +} + +var StorageAdminServiceListClusterInfoResult_Success_DEFAULT *ListClusterInfoResp +func (p *StorageAdminServiceListClusterInfoResult) GetSuccess() *ListClusterInfoResp { + if !p.IsSetSuccess() { + return StorageAdminServiceListClusterInfoResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceListClusterInfoResult) IsSetSuccess() bool { + return p != nil && p.Success != nil +} + +func (p *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) ReadField0(iprot thrift.Protocol) error { + p.Success = NewListClusterInfoResp() + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceListClusterInfoResult) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("listClusterInfo_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 *StorageAdminServiceListClusterInfoResult) 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 *StorageAdminServiceListClusterInfoResult) String() string { + if p == nil { + return "" + } + + var successVal string + if p.Success == nil { + successVal = "" + } else { + successVal = fmt.Sprintf("%v", p.Success) + } + return fmt.Sprintf("StorageAdminServiceListClusterInfoResult({Success:%s})", successVal) +} + + diff --git a/ccore/nebula/internal/thrift/v2_6_0/storage/ttypes.go b/ccore/nebula/internal/thrift/v2_6_0/storage/ttypes.go new file mode 100644 index 0000000..729151b --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/storage/ttypes.go @@ -0,0 +1,14095 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package storage + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nebula0 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0" + meta1 "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/internal/thrift/v2_6_0/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var _ = nebula0.GoUnusedProtection__ +var _ = meta1.GoUnusedProtection__ +var GoUnusedProtection__ int; + +type StatType int64 +const ( + StatType_SUM StatType = 1 + StatType_COUNT StatType = 2 + StatType_AVG StatType = 3 + StatType_MAX StatType = 4 + StatType_MIN StatType = 5 +) + +var StatTypeToName = map[StatType]string { + StatType_SUM: "SUM", + StatType_COUNT: "COUNT", + StatType_AVG: "AVG", + StatType_MAX: "MAX", + StatType_MIN: "MIN", +} + +var StatTypeToValue = map[string]StatType { + "SUM": StatType_SUM, + "COUNT": StatType_COUNT, + "AVG": StatType_AVG, + "MAX": StatType_MAX, + "MIN": StatType_MIN, +} + +var StatTypeNames = []string { + "SUM", + "COUNT", + "AVG", + "MAX", + "MIN", +} + +var StatTypeValues = []StatType { + StatType_SUM, + StatType_COUNT, + StatType_AVG, + StatType_MAX, + StatType_MIN, +} + +func (p StatType) String() string { + if v, ok := StatTypeToName[p]; ok { + return v + } + return "" +} + +func StatTypeFromString(s string) (StatType, error) { + if v, ok := StatTypeToValue[s]; ok { + return v, nil + } + return StatType(0), fmt.Errorf("not a valid StatType string") +} + +func StatTypePtr(v StatType) *StatType { return &v } + +type OrderDirection int64 +const ( + OrderDirection_ASCENDING OrderDirection = 1 + OrderDirection_DESCENDING OrderDirection = 2 +) + +var OrderDirectionToName = map[OrderDirection]string { + OrderDirection_ASCENDING: "ASCENDING", + OrderDirection_DESCENDING: "DESCENDING", +} + +var OrderDirectionToValue = map[string]OrderDirection { + "ASCENDING": OrderDirection_ASCENDING, + "DESCENDING": OrderDirection_DESCENDING, +} + +var OrderDirectionNames = []string { + "ASCENDING", + "DESCENDING", +} + +var OrderDirectionValues = []OrderDirection { + OrderDirection_ASCENDING, + OrderDirection_DESCENDING, +} + +func (p OrderDirection) String() string { + if v, ok := OrderDirectionToName[p]; ok { + return v + } + return "" +} + +func OrderDirectionFromString(s string) (OrderDirection, error) { + if v, ok := OrderDirectionToValue[s]; ok { + return v, nil + } + return OrderDirection(0), fmt.Errorf("not a valid OrderDirection string") +} + +func OrderDirectionPtr(v OrderDirection) *OrderDirection { return &v } + +type EdgeDirection int64 +const ( + EdgeDirection_BOTH EdgeDirection = 1 + EdgeDirection_IN_EDGE EdgeDirection = 2 + EdgeDirection_OUT_EDGE EdgeDirection = 3 +) + +var EdgeDirectionToName = map[EdgeDirection]string { + EdgeDirection_BOTH: "BOTH", + EdgeDirection_IN_EDGE: "IN_EDGE", + EdgeDirection_OUT_EDGE: "OUT_EDGE", +} + +var EdgeDirectionToValue = map[string]EdgeDirection { + "BOTH": EdgeDirection_BOTH, + "IN_EDGE": EdgeDirection_IN_EDGE, + "OUT_EDGE": EdgeDirection_OUT_EDGE, +} + +var EdgeDirectionNames = []string { + "BOTH", + "IN_EDGE", + "OUT_EDGE", +} + +var EdgeDirectionValues = []EdgeDirection { + EdgeDirection_BOTH, + EdgeDirection_IN_EDGE, + EdgeDirection_OUT_EDGE, +} + +func (p EdgeDirection) String() string { + if v, ok := EdgeDirectionToName[p]; ok { + return v + } + return "" +} + +func EdgeDirectionFromString(s string) (EdgeDirection, error) { + if v, ok := EdgeDirectionToValue[s]; ok { + return v, nil + } + return EdgeDirection(0), fmt.Errorf("not a valid EdgeDirection string") +} + +func EdgeDirectionPtr(v EdgeDirection) *EdgeDirection { return &v } + +type ScanType int64 +const ( + ScanType_PREFIX ScanType = 1 + ScanType_RANGE ScanType = 2 +) + +var ScanTypeToName = map[ScanType]string { + ScanType_PREFIX: "PREFIX", + ScanType_RANGE: "RANGE", +} + +var ScanTypeToValue = map[string]ScanType { + "PREFIX": ScanType_PREFIX, + "RANGE": ScanType_RANGE, +} + +var ScanTypeNames = []string { + "PREFIX", + "RANGE", +} + +var ScanTypeValues = []ScanType { + ScanType_PREFIX, + ScanType_RANGE, +} + +func (p ScanType) String() string { + if v, ok := ScanTypeToName[p]; ok { + return v + } + return "" +} + +func ScanTypeFromString(s string) (ScanType, error) { + if v, ok := ScanTypeToValue[s]; ok { + return v, nil + } + return ScanType(0), fmt.Errorf("not a valid ScanType string") +} + +func ScanTypePtr(v ScanType) *ScanType { return &v } + +type EngineSignType int64 +const ( + EngineSignType_BLOCK_ON EngineSignType = 1 + EngineSignType_BLOCK_OFF EngineSignType = 2 +) + +var EngineSignTypeToName = map[EngineSignType]string { + EngineSignType_BLOCK_ON: "BLOCK_ON", + EngineSignType_BLOCK_OFF: "BLOCK_OFF", +} + +var EngineSignTypeToValue = map[string]EngineSignType { + "BLOCK_ON": EngineSignType_BLOCK_ON, + "BLOCK_OFF": EngineSignType_BLOCK_OFF, +} + +var EngineSignTypeNames = []string { + "BLOCK_ON", + "BLOCK_OFF", +} + +var EngineSignTypeValues = []EngineSignType { + EngineSignType_BLOCK_ON, + EngineSignType_BLOCK_OFF, +} + +func (p EngineSignType) String() string { + if v, ok := EngineSignTypeToName[p]; ok { + return v + } + return "" +} + +func EngineSignTypeFromString(s string) (EngineSignType, error) { + if v, ok := EngineSignTypeToValue[s]; ok { + return v, nil + } + return EngineSignType(0), fmt.Errorf("not a valid EngineSignType string") +} + +func EngineSignTypePtr(v EngineSignType) *EngineSignType { return &v } + +// Attributes: +// - SessionID +// - PlanID +// - ProfileDetail +type RequestCommon struct { + SessionID *nebula0.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id,omitempty"` + PlanID *nebula0.ExecutionPlanID `thrift:"plan_id,2" db:"plan_id" json:"plan_id,omitempty"` + ProfileDetail *bool `thrift:"profile_detail,3" db:"profile_detail" json:"profile_detail,omitempty"` +} + +func NewRequestCommon() *RequestCommon { + return &RequestCommon{} +} + +var RequestCommon_SessionID_DEFAULT nebula0.SessionID +func (p *RequestCommon) GetSessionID() nebula0.SessionID { + if !p.IsSetSessionID() { + return RequestCommon_SessionID_DEFAULT + } +return *p.SessionID +} +var RequestCommon_PlanID_DEFAULT nebula0.ExecutionPlanID +func (p *RequestCommon) GetPlanID() nebula0.ExecutionPlanID { + if !p.IsSetPlanID() { + return RequestCommon_PlanID_DEFAULT + } +return *p.PlanID +} +var RequestCommon_ProfileDetail_DEFAULT bool +func (p *RequestCommon) GetProfileDetail() bool { + if !p.IsSetProfileDetail() { + return RequestCommon_ProfileDetail_DEFAULT + } +return *p.ProfileDetail +} +func (p *RequestCommon) IsSetSessionID() bool { + return p != nil && p.SessionID != nil +} + +func (p *RequestCommon) IsSetPlanID() bool { + return p != nil && p.PlanID != nil +} + +func (p *RequestCommon) IsSetProfileDetail() bool { + return p != nil && p.ProfileDetail != nil +} + +func (p *RequestCommon) 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 *RequestCommon) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.SessionID(v) + p.SessionID = &temp +} + return nil +} + +func (p *RequestCommon) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.ExecutionPlanID(v) + p.PlanID = &temp +} + return nil +} + +func (p *RequestCommon) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ProfileDetail = &v +} + return nil +} + +func (p *RequestCommon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RequestCommon"); 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 *RequestCommon) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin("session_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + } + return err +} + +func (p *RequestCommon) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetPlanID() { + if err := oprot.WriteFieldBegin("plan_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:plan_id: ", p), err) } + if err := oprot.WriteI64(int64(*p.PlanID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.plan_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:plan_id: ", p), err) } + } + return err +} + +func (p *RequestCommon) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetProfileDetail() { + if err := oprot.WriteFieldBegin("profile_detail", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:profile_detail: ", p), err) } + if err := oprot.WriteBool(bool(*p.ProfileDetail)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.profile_detail (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:profile_detail: ", p), err) } + } + return err +} + +func (p *RequestCommon) String() string { + if p == nil { + return "" + } + + var sessionIDVal string + if p.SessionID == nil { + sessionIDVal = "" + } else { + sessionIDVal = fmt.Sprintf("%v", *p.SessionID) + } + var planIDVal string + if p.PlanID == nil { + planIDVal = "" + } else { + planIDVal = fmt.Sprintf("%v", *p.PlanID) + } + var profileDetailVal string + if p.ProfileDetail == nil { + profileDetailVal = "" + } else { + profileDetailVal = fmt.Sprintf("%v", *p.ProfileDetail) + } + return fmt.Sprintf("RequestCommon({SessionID:%s PlanID:%s ProfileDetail:%s})", sessionIDVal, planIDVal, profileDetailVal) +} + +// Attributes: +// - Code +// - PartID +// - Leader +type PartitionResult_ struct { + Code nebula0.ErrorCode `thrift:"code,1,required" db:"code" json:"code"` + PartID nebula0.PartitionID `thrift:"part_id,2,required" db:"part_id" json:"part_id"` + Leader *nebula0.HostAddr `thrift:"leader,3" db:"leader" json:"leader,omitempty"` +} + +func NewPartitionResult_() *PartitionResult_ { + return &PartitionResult_{} +} + + +func (p *PartitionResult_) GetCode() nebula0.ErrorCode { + return p.Code +} + +func (p *PartitionResult_) GetPartID() nebula0.PartitionID { + return p.PartID +} +var PartitionResult__Leader_DEFAULT *nebula0.HostAddr +func (p *PartitionResult_) GetLeader() *nebula0.HostAddr { + if !p.IsSetLeader() { + return PartitionResult__Leader_DEFAULT + } +return p.Leader +} +func (p *PartitionResult_) IsSetLeader() bool { + return p != nil && p.Leader != nil +} + +func (p *PartitionResult_) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetCode bool = false; + var issetPartID 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 + } + issetCode = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetPartID = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetCode{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")); + } + if !issetPartID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + return nil +} + +func (p *PartitionResult_) 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 *PartitionResult_) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartitionResult_) ReadField3(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 *PartitionResult_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionResult"); 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 *PartitionResult_) 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 *PartitionResult_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:leader: ", p), err) } + } + return err +} + +func (p *PartitionResult_) String() string { + if p == nil { + return "" + } + + codeVal := fmt.Sprintf("%v", p.Code) + partIDVal := fmt.Sprintf("%v", p.PartID) + var leaderVal string + if p.Leader == nil { + leaderVal = "" + } else { + leaderVal = fmt.Sprintf("%v", p.Leader) + } + return fmt.Sprintf("PartitionResult_({Code:%s PartID:%s Leader:%s})", codeVal, partIDVal, leaderVal) +} + +// Attributes: +// - FailedParts +// - LatencyInUs +// - LatencyDetailUs +type ResponseCommon struct { + FailedParts []*PartitionResult_ `thrift:"failed_parts,1,required" db:"failed_parts" json:"failed_parts"` + LatencyInUs int32 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + LatencyDetailUs map[string]int32 `thrift:"latency_detail_us,3" db:"latency_detail_us" json:"latency_detail_us,omitempty"` +} + +func NewResponseCommon() *ResponseCommon { + return &ResponseCommon{} +} + + +func (p *ResponseCommon) GetFailedParts() []*PartitionResult_ { + return p.FailedParts +} + +func (p *ResponseCommon) GetLatencyInUs() int32 { + return p.LatencyInUs +} +var ResponseCommon_LatencyDetailUs_DEFAULT map[string]int32 + +func (p *ResponseCommon) GetLatencyDetailUs() map[string]int32 { + return p.LatencyDetailUs +} +func (p *ResponseCommon) IsSetLatencyDetailUs() bool { + return p != nil && p.LatencyDetailUs != nil +} + +func (p *ResponseCommon) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFailedParts bool = false; + var issetLatencyInUs 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 + } + issetFailedParts = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetLatencyInUs = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetFailedParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedParts is not set")); + } + if !issetLatencyInUs{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ResponseCommon) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartitionResult_, 0, size) + p.FailedParts = tSlice + for i := 0; i < size; i ++ { + _elem2 := NewPartitionResult_() + if err := _elem2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.FailedParts = append(p.FailedParts, _elem2) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ResponseCommon) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ResponseCommon) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]int32, size) + p.LatencyDetailUs = tMap + for i := 0; i < size; i ++ { +var _key3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key3 = v +} +var _val4 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val4 = v +} + p.LatencyDetailUs[_key3] = _val4 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ResponseCommon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ResponseCommon"); 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 *ResponseCommon) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("failed_parts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:failed_parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FailedParts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.FailedParts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:failed_parts: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("latency_in_us", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI32(int32(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetLatencyDetailUs() { + if err := oprot.WriteFieldBegin("latency_detail_us", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:latency_detail_us: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.LatencyDetailUs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LatencyDetailUs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:latency_detail_us: ", p), err) } + } + return err +} + +func (p *ResponseCommon) String() string { + if p == nil { + return "" + } + + failedPartsVal := fmt.Sprintf("%v", p.FailedParts) + latencyInUsVal := fmt.Sprintf("%v", p.LatencyInUs) + latencyDetailUsVal := fmt.Sprintf("%v", p.LatencyDetailUs) + return fmt.Sprintf("ResponseCommon({FailedParts:%s LatencyInUs:%s LatencyDetailUs:%s})", failedPartsVal, latencyInUsVal, latencyDetailUsVal) +} + +// Attributes: +// - Alias +// - Prop +// - Stat +type StatProp struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Prop []byte `thrift:"prop,2" db:"prop" json:"prop"` + Stat StatType `thrift:"stat,3" db:"stat" json:"stat"` +} + +func NewStatProp() *StatProp { + return &StatProp{} +} + + +func (p *StatProp) GetAlias() []byte { + return p.Alias +} + +func (p *StatProp) GetProp() []byte { + return p.Prop +} + +func (p *StatProp) GetStat() StatType { + return p.Stat +} +func (p *StatProp) 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 *StatProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *StatProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *StatProp) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := StatType(v) + p.Stat = temp +} + return nil +} + +func (p *StatProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StatProp"); 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 *StatProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *StatProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prop: ", p), err) } + return err +} + +func (p *StatProp) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("stat", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat: ", p), err) } + if err := oprot.WriteI32(int32(p.Stat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stat (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat: ", p), err) } + return err +} + +func (p *StatProp) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + propVal := fmt.Sprintf("%v", p.Prop) + statVal := fmt.Sprintf("%v", p.Stat) + return fmt.Sprintf("StatProp({Alias:%s Prop:%s Stat:%s})", aliasVal, propVal, statVal) +} + +// Attributes: +// - Alias +// - Expr +type Expr struct { + Alias []byte `thrift:"alias,1" db:"alias" json:"alias"` + Expr []byte `thrift:"expr,2" db:"expr" json:"expr"` +} + +func NewExpr() *Expr { + return &Expr{} +} + + +func (p *Expr) GetAlias() []byte { + return p.Alias +} + +func (p *Expr) GetExpr() []byte { + return p.Expr +} +func (p *Expr) 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 *Expr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *Expr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Expr = v +} + return nil +} + +func (p *Expr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Expr"); 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 *Expr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *Expr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("expr", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expr: ", p), err) } + if err := oprot.WriteBinary(p.Expr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expr: ", p), err) } + return err +} + +func (p *Expr) String() string { + if p == nil { + return "" + } + + aliasVal := fmt.Sprintf("%v", p.Alias) + exprVal := fmt.Sprintf("%v", p.Expr) + return fmt.Sprintf("Expr({Alias:%s Expr:%s})", aliasVal, exprVal) +} + +// Attributes: +// - Type +// - Props +type EdgeProp struct { + Type nebula0.EdgeType `thrift:"type,1" db:"type" json:"type"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewEdgeProp() *EdgeProp { + return &EdgeProp{} +} + + +func (p *EdgeProp) GetType() nebula0.EdgeType { + return p.Type +} + +func (p *EdgeProp) GetProps() [][]byte { + return p.Props +} +func (p *EdgeProp) 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 *EdgeProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *EdgeProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem5 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Props = append(p.Props, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *EdgeProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeProp"); 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 *EdgeProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *EdgeProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *EdgeProp) String() string { + if p == nil { + return "" + } + + typeVal := fmt.Sprintf("%v", p.Type) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("EdgeProp({Type:%s Props:%s})", typeVal, propsVal) +} + +// Attributes: +// - Tag +// - Props +type VertexProp struct { + Tag nebula0.TagID `thrift:"tag,1" db:"tag" json:"tag"` + Props [][]byte `thrift:"props,2" db:"props" json:"props"` +} + +func NewVertexProp() *VertexProp { + return &VertexProp{} +} + + +func (p *VertexProp) GetTag() nebula0.TagID { + return p.Tag +} + +func (p *VertexProp) GetProps() [][]byte { + return p.Props +} +func (p *VertexProp) 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 *VertexProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.Tag = temp +} + return nil +} + +func (p *VertexProp) 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.Props = tSlice + for i := 0; i < size; i ++ { +var _elem6 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem6 = v +} + p.Props = append(p.Props, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *VertexProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("VertexProp"); 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 *VertexProp) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) } + if err := oprot.WriteI32(int32(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) } + return err +} + +func (p *VertexProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *VertexProp) String() string { + if p == nil { + return "" + } + + tagVal := fmt.Sprintf("%v", p.Tag) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("VertexProp({Tag:%s Props:%s})", tagVal, propsVal) +} + +// Attributes: +// - Prop +// - Direction +type OrderBy struct { + Prop []byte `thrift:"prop,1" db:"prop" json:"prop"` + Direction OrderDirection `thrift:"direction,2" db:"direction" json:"direction"` +} + +func NewOrderBy() *OrderBy { + return &OrderBy{} +} + + +func (p *OrderBy) GetProp() []byte { + return p.Prop +} + +func (p *OrderBy) GetDirection() OrderDirection { + return p.Direction +} +func (p *OrderBy) 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 *OrderBy) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *OrderBy) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := OrderDirection(v) + p.Direction = temp +} + return nil +} + +func (p *OrderBy) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("OrderBy"); 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 *OrderBy) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prop: ", p), err) } + if err := oprot.WriteBinary(p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prop: ", p), err) } + return err +} + +func (p *OrderBy) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:direction: ", p), err) } + if err := oprot.WriteI32(int32(p.Direction)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:direction: ", p), err) } + return err +} + +func (p *OrderBy) String() string { + if p == nil { + return "" + } + + propVal := fmt.Sprintf("%v", p.Prop) + directionVal := fmt.Sprintf("%v", p.Direction) + return fmt.Sprintf("OrderBy({Prop:%s Direction:%s})", propVal, directionVal) +} + +// Attributes: +// - EdgeTypes +// - EdgeDirection +// - Dedup +// - StatProps +// - VertexProps +// - EdgeProps +// - Expressions +// - OrderBy +// - Random +// - Limit +// - Filter +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"` + Dedup bool `thrift:"dedup,3" db:"dedup" json:"dedup"` + StatProps []*StatProp `thrift:"stat_props,4" db:"stat_props" json:"stat_props,omitempty"` + VertexProps []*VertexProp `thrift:"vertex_props,5" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,6" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,7" db:"expressions" json:"expressions,omitempty"` + OrderBy []*OrderBy `thrift:"order_by,8" db:"order_by" json:"order_by,omitempty"` + Random *bool `thrift:"random,9" db:"random" json:"random,omitempty"` + Limit *int64 `thrift:"limit,10" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,11" db:"filter" json:"filter,omitempty"` +} + +func NewTraverseSpec() *TraverseSpec { + return &TraverseSpec{ + EdgeDirection: 1, + } +} + + +func (p *TraverseSpec) GetEdgeTypes() []nebula0.EdgeType { + return p.EdgeTypes +} + +func (p *TraverseSpec) GetEdgeDirection() EdgeDirection { + return p.EdgeDirection +} + +func (p *TraverseSpec) GetDedup() bool { + return p.Dedup +} +var TraverseSpec_StatProps_DEFAULT []*StatProp + +func (p *TraverseSpec) GetStatProps() []*StatProp { + return p.StatProps +} +var TraverseSpec_VertexProps_DEFAULT []*VertexProp + +func (p *TraverseSpec) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var TraverseSpec_EdgeProps_DEFAULT []*EdgeProp + +func (p *TraverseSpec) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var TraverseSpec_Expressions_DEFAULT []*Expr + +func (p *TraverseSpec) GetExpressions() []*Expr { + return p.Expressions +} +var TraverseSpec_OrderBy_DEFAULT []*OrderBy + +func (p *TraverseSpec) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var TraverseSpec_Random_DEFAULT bool +func (p *TraverseSpec) GetRandom() bool { + if !p.IsSetRandom() { + return TraverseSpec_Random_DEFAULT + } +return *p.Random +} +var TraverseSpec_Limit_DEFAULT int64 +func (p *TraverseSpec) GetLimit() int64 { + if !p.IsSetLimit() { + return TraverseSpec_Limit_DEFAULT + } +return *p.Limit +} +var TraverseSpec_Filter_DEFAULT []byte + +func (p *TraverseSpec) GetFilter() []byte { + return p.Filter +} +func (p *TraverseSpec) IsSetStatProps() bool { + return p != nil && p.StatProps != nil +} + +func (p *TraverseSpec) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *TraverseSpec) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *TraverseSpec) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *TraverseSpec) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *TraverseSpec) IsSetRandom() bool { + return p != nil && p.Random != nil +} + +func (p *TraverseSpec) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *TraverseSpec) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *TraverseSpec) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *TraverseSpec) ReadField1(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 _elem7 nebula0.EdgeType + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.EdgeType(v) + _elem7 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeDirection(v) + p.EdgeDirection = temp +} + return nil +} + +func (p *TraverseSpec) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *TraverseSpec) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*StatProp, 0, size) + p.StatProps = tSlice + for i := 0; i < size; i ++ { + _elem8 := NewStatProp() + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + p.StatProps = append(p.StatProps, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.VertexProps = tSlice + for i := 0; i < size; i ++ { + _elem9 := NewVertexProp() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.VertexProps = append(p.VertexProps, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField6(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.EdgeProps = tSlice + for i := 0; i < size; i ++ { + _elem10 := NewEdgeProp() + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.EdgeProps = append(p.EdgeProps, _elem10) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Expr, 0, size) + p.Expressions = tSlice + for i := 0; i < size; i ++ { + _elem11 := NewExpr() + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.Expressions = append(p.Expressions, _elem11) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField8(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OrderBy, 0, size) + p.OrderBy = tSlice + for i := 0; i < size; i ++ { + _elem12 := NewOrderBy() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.OrderBy = append(p.OrderBy, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Random = &v +} + return nil +} + +func (p *TraverseSpec) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *TraverseSpec) ReadField11(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.Filter = 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) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TraverseSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:edge_types: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_direction: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeDirection)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_direction: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dedup: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetStatProps() { + if err := oprot.WriteFieldBegin("stat_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stat_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StatProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stat_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vertex_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + 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 7:expressions: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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:order_by: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetRandom() { + if err := oprot.WriteFieldBegin("random", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:random: ", p), err) } + if err := oprot.WriteBool(bool(*p.Random)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.random (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:random: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:limit: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) String() string { + if p == nil { + return "" + } + + edgeTypesVal := fmt.Sprintf("%v", p.EdgeTypes) + edgeDirectionVal := fmt.Sprintf("%v", p.EdgeDirection) + dedupVal := fmt.Sprintf("%v", p.Dedup) + statPropsVal := fmt.Sprintf("%v", p.StatProps) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var randomVal string + if p.Random == nil { + randomVal = "" + } else { + randomVal = fmt.Sprintf("%v", *p.Random) + } + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + 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) +} + +// Attributes: +// - SpaceID +// - ColumnNames +// - Parts +// - TraverseSpec +// - Common +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"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` +} + +func NewGetNeighborsRequest() *GetNeighborsRequest { + return &GetNeighborsRequest{ + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *GetNeighborsRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetNeighborsRequest) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *GetNeighborsRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetNeighborsRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *GetNeighborsRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return GetNeighborsRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +var GetNeighborsRequest_Common_DEFAULT *RequestCommon +func (p *GetNeighborsRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return GetNeighborsRequest_Common_DEFAULT + } +return p.Common +} +func (p *GetNeighborsRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *GetNeighborsRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *GetNeighborsRequest) 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 + } + 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.Row, 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.Row, 0, size) + _val15 := 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) + } + _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" 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 +} + +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: +// - Result_ +type ExecResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` +} + +func NewExecResponse() *ExecResponse { + return &ExecResponse{ + Result_: NewResponseCommon(), + } +} + +var ExecResponse_Result__DEFAULT *ResponseCommon +func (p *ExecResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ExecResponse_Result__DEFAULT + } +return p.Result_ +} +func (p *ExecResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ExecResponse) 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 + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 *ExecResponse) 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 *ExecResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ExecResponse"); 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 *ExecResponse) 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 *ExecResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + return fmt.Sprintf("ExecResponse({Result_:%s})", resultVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - VertexProps +// - EdgeProps +// - Expressions +// - Dedup +// - OrderBy +// - Limit +// - Filter +// - Common +type GetPropRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.Row `thrift:"parts,2" db:"parts" json:"parts"` + VertexProps []*VertexProp `thrift:"vertex_props,3" db:"vertex_props" json:"vertex_props,omitempty"` + EdgeProps []*EdgeProp `thrift:"edge_props,4" db:"edge_props" json:"edge_props,omitempty"` + Expressions []*Expr `thrift:"expressions,5" db:"expressions" json:"expressions,omitempty"` + Dedup bool `thrift:"dedup,6" db:"dedup" json:"dedup"` + OrderBy []*OrderBy `thrift:"order_by,7" db:"order_by" json:"order_by,omitempty"` + Limit *int64 `thrift:"limit,8" db:"limit" json:"limit,omitempty"` + Filter []byte `thrift:"filter,9" db:"filter" json:"filter,omitempty"` + Common *RequestCommon `thrift:"common,10" db:"common" json:"common,omitempty"` +} + +func NewGetPropRequest() *GetPropRequest { + return &GetPropRequest{} +} + + +func (p *GetPropRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetPropRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Row { + return p.Parts +} +var GetPropRequest_VertexProps_DEFAULT []*VertexProp + +func (p *GetPropRequest) GetVertexProps() []*VertexProp { + return p.VertexProps +} +var GetPropRequest_EdgeProps_DEFAULT []*EdgeProp + +func (p *GetPropRequest) GetEdgeProps() []*EdgeProp { + return p.EdgeProps +} +var GetPropRequest_Expressions_DEFAULT []*Expr + +func (p *GetPropRequest) GetExpressions() []*Expr { + return p.Expressions +} + +func (p *GetPropRequest) GetDedup() bool { + return p.Dedup +} +var GetPropRequest_OrderBy_DEFAULT []*OrderBy + +func (p *GetPropRequest) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var GetPropRequest_Limit_DEFAULT int64 +func (p *GetPropRequest) GetLimit() int64 { + if !p.IsSetLimit() { + return GetPropRequest_Limit_DEFAULT + } +return *p.Limit +} +var GetPropRequest_Filter_DEFAULT []byte + +func (p *GetPropRequest) GetFilter() []byte { + return p.Filter +} +var GetPropRequest_Common_DEFAULT *RequestCommon +func (p *GetPropRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return GetPropRequest_Common_DEFAULT + } +return p.Common +} +func (p *GetPropRequest) IsSetVertexProps() bool { + return p != nil && p.VertexProps != nil +} + +func (p *GetPropRequest) IsSetEdgeProps() bool { + return p != nil && p.EdgeProps != nil +} + +func (p *GetPropRequest) IsSetExpressions() bool { + return p != nil && p.Expressions != nil +} + +func (p *GetPropRequest) IsSetOrderBy() bool { + return p != nil && p.OrderBy != nil +} + +func (p *GetPropRequest) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *GetPropRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *GetPropRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *GetPropRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(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 *GetPropRequest) 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 *GetPropRequest) 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) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key17 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key17 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Row, 0, size) + _val18 := 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) + } + _val18 = append(_val18, _elem19) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key17] = _val18 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.VertexProps = append(p.VertexProps, _elem20) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.EdgeProps = append(p.EdgeProps, _elem21) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Expressions = append(p.Expressions, _elem22) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *GetPropRequest) ReadField7(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.OrderBy = append(p.OrderBy, _elem23) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *GetPropRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *GetPropRequest) ReadField10(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 *GetPropRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropRequest) 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 *GetPropRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin("vertex_props", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin("edge_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:edge_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:edge_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin("expressions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:expressions: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:expressions: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dedup", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dedup: ", p), err) } + if err := oprot.WriteBool(bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dedup: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin("order_by", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:order_by: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + 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 7:order_by: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:limit: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:filter: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10: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 10:common: ", p), err) } + } + return err +} + +func (p *GetPropRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + vertexPropsVal := fmt.Sprintf("%v", p.VertexProps) + edgePropsVal := fmt.Sprintf("%v", p.EdgeProps) + expressionsVal := fmt.Sprintf("%v", p.Expressions) + dedupVal := fmt.Sprintf("%v", p.Dedup) + orderByVal := fmt.Sprintf("%v", p.OrderBy) + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + limitVal = fmt.Sprintf("%v", *p.Limit) + } + filterVal := fmt.Sprintf("%v", p.Filter) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("GetPropRequest({SpaceID:%s Parts:%s VertexProps:%s EdgeProps:%s Expressions:%s Dedup:%s OrderBy:%s Limit:%s Filter:%s Common:%s})", spaceIDVal, partsVal, vertexPropsVal, edgePropsVal, expressionsVal, dedupVal, orderByVal, limitVal, filterVal, commonVal) +} + +// Attributes: +// - Result_ +// - Props +type GetPropResponse struct { + Result_ *ResponseCommon `thrift:"result,1" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewGetPropResponse() *GetPropResponse { + return &GetPropResponse{ + Result_: NewResponseCommon(), + } +} + +var GetPropResponse_Result__DEFAULT *ResponseCommon +func (p *GetPropResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetPropResponse_Result__DEFAULT + } +return p.Result_ +} +var GetPropResponse_Props_DEFAULT *nebula0.DataSet +func (p *GetPropResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return GetPropResponse_Props_DEFAULT + } +return p.Props +} +func (p *GetPropResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetPropResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *GetPropResponse) 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 *GetPropResponse) 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 *GetPropResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *GetPropResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetPropResponse"); 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 *GetPropResponse) 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 *GetPropResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *GetPropResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("GetPropResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - TagID +// - Props +type NewTag_ struct { + TagID nebula0.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewTag_() *NewTag_ { + return &NewTag_{} +} + + +func (p *NewTag_) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *NewTag_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewTag_) 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 *NewTag_) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *NewTag_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Props = append(p.Props, _elem24) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewTag_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewTag"); 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 *NewTag_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *NewTag_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewTag_) String() string { + if p == nil { + return "" + } + + tagIDVal := fmt.Sprintf("%v", p.TagID) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewTag_({TagID:%s Props:%s})", tagIDVal, propsVal) +} + +// Attributes: +// - Id +// - Tags +type NewVertex_ struct { + Id *nebula0.Value `thrift:"id,1" db:"id" json:"id"` + Tags []*NewTag_ `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewNewVertex_() *NewVertex_ { + return &NewVertex_{} +} + +var NewVertex__Id_DEFAULT *nebula0.Value +func (p *NewVertex_) GetId() *nebula0.Value { + if !p.IsSetId() { + return NewVertex__Id_DEFAULT + } +return p.Id +} + +func (p *NewVertex_) GetTags() []*NewTag_ { + return p.Tags +} +func (p *NewVertex_) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *NewVertex_) 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 *NewVertex_) ReadField1(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *NewVertex_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Tags = append(p.Tags, _elem25) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewVertex_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewVertex"); 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 *NewVertex_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *NewVertex_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *NewVertex_) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("NewVertex_({Id:%s Tags:%s})", idVal, tagsVal) +} + +// Attributes: +// - Src +// - EdgeType +// - Ranking +// - Dst +type EdgeKey struct { + Src *nebula0.Value `thrift:"src,1" db:"src" json:"src"` + EdgeType nebula0.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type"` + Ranking nebula0.EdgeRanking `thrift:"ranking,3" db:"ranking" json:"ranking"` + Dst *nebula0.Value `thrift:"dst,4" db:"dst" json:"dst"` +} + +func NewEdgeKey() *EdgeKey { + return &EdgeKey{} +} + +var EdgeKey_Src_DEFAULT *nebula0.Value +func (p *EdgeKey) GetSrc() *nebula0.Value { + if !p.IsSetSrc() { + return EdgeKey_Src_DEFAULT + } +return p.Src +} + +func (p *EdgeKey) GetEdgeType() nebula0.EdgeType { + return p.EdgeType +} + +func (p *EdgeKey) GetRanking() nebula0.EdgeRanking { + return p.Ranking +} +var EdgeKey_Dst_DEFAULT *nebula0.Value +func (p *EdgeKey) GetDst() *nebula0.Value { + if !p.IsSetDst() { + return EdgeKey_Dst_DEFAULT + } +return p.Dst +} +func (p *EdgeKey) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *EdgeKey) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *EdgeKey) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeKey) ReadField1(iprot thrift.Protocol) error { + p.Src = nebula0.NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *EdgeKey) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeKey) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *EdgeKey) ReadField4(iprot thrift.Protocol) error { + p.Dst = nebula0.NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *EdgeKey) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("EdgeKey"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeKey) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *EdgeKey) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + return err +} + +func (p *EdgeKey) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ranking: ", p), err) } + return err +} + +func (p *EdgeKey) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dst: ", p), err) } + return err +} + +func (p *EdgeKey) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + edgeTypeVal := fmt.Sprintf("%v", p.EdgeType) + rankingVal := fmt.Sprintf("%v", p.Ranking) + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + return fmt.Sprintf("EdgeKey({Src:%s EdgeType:%s Ranking:%s Dst:%s})", srcVal, edgeTypeVal, rankingVal, dstVal) +} + +// Attributes: +// - Key +// - Props +type NewEdge_ struct { + Key *EdgeKey `thrift:"key,1" db:"key" json:"key"` + Props []*nebula0.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewEdge_() *NewEdge_ { + return &NewEdge_{ + Key: NewEdgeKey(), + } +} + +var NewEdge__Key_DEFAULT *EdgeKey +func (p *NewEdge_) GetKey() *EdgeKey { + if !p.IsSetKey() { + return NewEdge__Key_DEFAULT + } +return p.Key +} + +func (p *NewEdge_) GetProps() []*nebula0.Value { + return p.Props +} +func (p *NewEdge_) IsSetKey() bool { + return p != nil && p.Key != nil +} + +func (p *NewEdge_) 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 *NewEdge_) ReadField1(iprot thrift.Protocol) error { + p.Key = NewEdgeKey() + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *NewEdge_) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Props = append(p.Props, _elem26) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewEdge_) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NewEdge"); 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 *NewEdge_) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := p.Key.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *NewEdge_) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + 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:props: ", p), err) } + return err +} + +func (p *NewEdge_) String() string { + if p == nil { + return "" + } + + var keyVal string + if p.Key == nil { + keyVal = "" + } else { + keyVal = fmt.Sprintf("%v", p.Key) + } + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("NewEdge_({Key:%s Props:%s})", keyVal, propsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - Common +type AddVerticesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` +} + +func NewAddVerticesRequest() *AddVerticesRequest { + return &AddVerticesRequest{} +} + + +func (p *AddVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddVerticesRequest) GetParts() map[nebula0.PartitionID][]*NewVertex_ { + return p.Parts +} + +func (p *AddVerticesRequest) GetPropNames() map[nebula0.TagID][][]byte { + return p.PropNames +} + +func (p *AddVerticesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +var AddVerticesRequest_Common_DEFAULT *RequestCommon +func (p *AddVerticesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return AddVerticesRequest_Common_DEFAULT + } +return p.Common +} +func (p *AddVerticesRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *AddVerticesRequest) 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 + } + 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 *AddVerticesRequest) 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 *AddVerticesRequest) 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][]*NewVertex_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key27 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key27 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewVertex_, 0, size) + _val28 := 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) + } + _val28 = append(_val28, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key27] = _val28 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField3(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.TagID][][]byte, size) + p.PropNames = tMap + for i := 0; i < size; i ++ { +var _key30 nebula0.TagID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.TagID(v) + _key30 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val31 := tSlice + for i := 0; i < size; i ++ { +var _elem32 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem32 = v +} + _val31 = append(_val31, _elem32) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PropNames[_key30] = _val31 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddVerticesRequest"); 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 *AddVerticesRequest) 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 *AddVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PropNames { + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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:prop_names: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddVerticesRequest) 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 *AddVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, commonVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - Common +type AddEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` +} + +func NewAddEdgesRequest() *AddEdgesRequest { + return &AddEdgesRequest{} +} + + +func (p *AddEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddEdgesRequest) GetParts() map[nebula0.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *AddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *AddEdgesRequest) GetIfNotExists() bool { + return p.IfNotExists +} +var AddEdgesRequest_Common_DEFAULT *RequestCommon +func (p *AddEdgesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return AddEdgesRequest_Common_DEFAULT + } +return p.Common +} +func (p *AddEdgesRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *AddEdgesRequest) 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 + } + 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 *AddEdgesRequest) 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 *AddEdgesRequest) 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][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key33 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key33 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val34 := 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) + } + _val34 = append(_val34, _elem35) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key33] = _val34 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField3(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.PropNames = tSlice + for i := 0; i < size; i ++ { +var _elem36 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem36 = v +} + p.PropNames = append(p.PropNames, _elem36) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddEdgesRequest"); 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 *AddEdgesRequest) 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 *AddEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddEdgesRequest) 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 *AddEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, commonVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteVerticesRequest 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"` + Common *RequestCommon `thrift:"common,3" db:"common" json:"common,omitempty"` +} + +func NewDeleteVerticesRequest() *DeleteVerticesRequest { + return &DeleteVerticesRequest{} +} + + +func (p *DeleteVerticesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteVerticesRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { + return p.Parts +} +var DeleteVerticesRequest_Common_DEFAULT *RequestCommon +func (p *DeleteVerticesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return DeleteVerticesRequest_Common_DEFAULT + } +return p.Common +} +func (p *DeleteVerticesRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key37 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key37 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.Value, 0, size) + _val38 := 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) + } + _val38 = append(_val38, _elem39) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key37] = _val38 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteVerticesRequest) ReadField3(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 *DeleteVerticesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteVerticesRequest"); 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 *DeleteVerticesRequest) 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 *DeleteVerticesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:common: ", p), err) } + } + return err +} + +func (p *DeleteVerticesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("DeleteVerticesRequest({SpaceID:%s Parts:%s Common:%s})", spaceIDVal, partsVal, commonVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*EdgeKey `thrift:"parts,2" db:"parts" json:"parts"` + Common *RequestCommon `thrift:"common,3" db:"common" json:"common,omitempty"` +} + +func NewDeleteEdgesRequest() *DeleteEdgesRequest { + return &DeleteEdgesRequest{} +} + + +func (p *DeleteEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteEdgesRequest) GetParts() map[nebula0.PartitionID][]*EdgeKey { + return p.Parts +} +var DeleteEdgesRequest_Common_DEFAULT *RequestCommon +func (p *DeleteEdgesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return DeleteEdgesRequest_Common_DEFAULT + } +return p.Common +} +func (p *DeleteEdgesRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key40 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key40 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val41 := 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) + } + _val41 = append(_val41, _elem42) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key40] = _val41 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteEdgesRequest) ReadField3(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 *DeleteEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteEdgesRequest"); 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 *DeleteEdgesRequest) 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 *DeleteEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:common: ", p), err) } + } + return err +} + +func (p *DeleteEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("DeleteEdgesRequest({SpaceID:%s Parts:%s Common:%s})", spaceIDVal, partsVal, commonVal) +} + +// Attributes: +// - Id +// - Tags +type DelTags struct { + Id *nebula0.Value `thrift:"id,1" db:"id" json:"id"` + Tags []nebula0.TagID `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewDelTags() *DelTags { + return &DelTags{} +} + +var DelTags_Id_DEFAULT *nebula0.Value +func (p *DelTags) GetId() *nebula0.Value { + if !p.IsSetId() { + return DelTags_Id_DEFAULT + } +return p.Id +} + +func (p *DelTags) GetTags() []nebula0.TagID { + return p.Tags +} +func (p *DelTags) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *DelTags) 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 *DelTags) ReadField1(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *DelTags) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.TagID, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { +var _elem43 nebula0.TagID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.TagID(v) + _elem43 = temp +} + p.Tags = append(p.Tags, _elem43) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DelTags) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DelTags"); 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 *DelTags) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *DelTags) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) } + return err +} + +func (p *DelTags) String() string { + if p == nil { + return "" + } + + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("DelTags({Id:%s Tags:%s})", idVal, tagsVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteTagsRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*DelTags `thrift:"parts,2" db:"parts" json:"parts"` + Common *RequestCommon `thrift:"common,3" db:"common" json:"common,omitempty"` +} + +func NewDeleteTagsRequest() *DeleteTagsRequest { + return &DeleteTagsRequest{} +} + + +func (p *DeleteTagsRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteTagsRequest) GetParts() map[nebula0.PartitionID][]*DelTags { + return p.Parts +} +var DeleteTagsRequest_Common_DEFAULT *RequestCommon +func (p *DeleteTagsRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return DeleteTagsRequest_Common_DEFAULT + } +return p.Common +} +func (p *DeleteTagsRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *DeleteTagsRequest) 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 *DeleteTagsRequest) 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 *DeleteTagsRequest) 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][]*DelTags, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key44 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key44 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DelTags, 0, size) + _val45 := 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) + } + _val45 = append(_val45, _elem46) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key44] = _val45 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteTagsRequest) ReadField3(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 *DeleteTagsRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DeleteTagsRequest"); 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 *DeleteTagsRequest) 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 *DeleteTagsRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *DeleteTagsRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:common: ", p), err) } + } + return err +} + +func (p *DeleteTagsRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("DeleteTagsRequest({SpaceID:%s Parts:%s Common:%s})", spaceIDVal, partsVal, commonVal) +} + +// Attributes: +// - Result_ +// - Props +type UpdateResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula0.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` +} + +func NewUpdateResponse() *UpdateResponse { + return &UpdateResponse{ + Result_: NewResponseCommon(), + } +} + +var UpdateResponse_Result__DEFAULT *ResponseCommon +func (p *UpdateResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return UpdateResponse_Result__DEFAULT + } +return p.Result_ +} +var UpdateResponse_Props_DEFAULT *nebula0.DataSet +func (p *UpdateResponse) GetProps() *nebula0.DataSet { + if !p.IsSetProps() { + return UpdateResponse_Props_DEFAULT + } +return p.Props +} +func (p *UpdateResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *UpdateResponse) IsSetProps() bool { + return p != nil && p.Props != nil +} + +func (p *UpdateResponse) 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 *UpdateResponse) 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 *UpdateResponse) ReadField2(iprot thrift.Protocol) error { + p.Props = nebula0.NewDataSet() + if err := p.Props.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *UpdateResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateResponse"); 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 *UpdateResponse) 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 *UpdateResponse) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := p.Props.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var propsVal string + if p.Props == nil { + propsVal = "" + } else { + propsVal = fmt.Sprintf("%v", p.Props) + } + return fmt.Sprintf("UpdateResponse({Result_:%s Props:%s})", resultVal, propsVal) +} + +// Attributes: +// - Name +// - Value +type UpdatedProp struct { + Name []byte `thrift:"name,1,required" db:"name" json:"name"` + Value []byte `thrift:"value,2,required" db:"value" json:"value"` +} + +func NewUpdatedProp() *UpdatedProp { + return &UpdatedProp{} +} + + +func (p *UpdatedProp) GetName() []byte { + return p.Name +} + +func (p *UpdatedProp) GetValue() []byte { + return p.Value +} +func (p *UpdatedProp) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + var issetValue 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 + } + issetName = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetValue = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetName{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetValue{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *UpdatedProp) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *UpdatedProp) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *UpdatedProp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdatedProp"); 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 *UpdatedProp) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *UpdatedProp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *UpdatedProp) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("UpdatedProp({Name:%s Value:%s})", nameVal, valueVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - VertexID +// - TagID +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +// - Common +type UpdateVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + VertexID *nebula0.Value `thrift:"vertex_id,3" db:"vertex_id" json:"vertex_id"` + TagID nebula0.TagID `thrift:"tag_id,4,required" db:"tag_id" json:"tag_id"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,5" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,6" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,7" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,8" db:"condition" json:"condition,omitempty"` + Common *RequestCommon `thrift:"common,9" db:"common" json:"common,omitempty"` +} + +func NewUpdateVertexRequest() *UpdateVertexRequest { + return &UpdateVertexRequest{} +} + + +func (p *UpdateVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateVertexRequest_VertexID_DEFAULT *nebula0.Value +func (p *UpdateVertexRequest) GetVertexID() *nebula0.Value { + if !p.IsSetVertexID() { + return UpdateVertexRequest_VertexID_DEFAULT + } +return p.VertexID +} + +func (p *UpdateVertexRequest) GetTagID() nebula0.TagID { + return p.TagID +} + +func (p *UpdateVertexRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateVertexRequest_Insertable_DEFAULT bool = false + +func (p *UpdateVertexRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateVertexRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateVertexRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateVertexRequest_Condition_DEFAULT []byte + +func (p *UpdateVertexRequest) GetCondition() []byte { + return p.Condition +} +var UpdateVertexRequest_Common_DEFAULT *RequestCommon +func (p *UpdateVertexRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return UpdateVertexRequest_Common_DEFAULT + } +return p.Common +} +func (p *UpdateVertexRequest) IsSetVertexID() bool { + return p != nil && p.VertexID != nil +} + +func (p *UpdateVertexRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateVertexRequest_Insertable_DEFAULT +} + +func (p *UpdateVertexRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateVertexRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateVertexRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *UpdateVertexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTagID 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 + } + 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 + } + issetTagID = true + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + } + if err := 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 !issetTagID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagID is not set")); + } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField3(iprot thrift.Protocol) error { + p.VertexID = nebula0.NewValue() + if err := p.VertexID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexID), err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.UpdatedProps = append(p.UpdatedProps, _elem47) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField7(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem48 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem48 = v +} + p.ReturnProps = append(p.ReturnProps, _elem48) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField9(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 *UpdateVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateVertexRequest) 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 *UpdateVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_id", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vertex_id: ", p), err) } + if err := p.VertexID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tag_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updated_props: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:insertable: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:return_props: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:condition: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9: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 9:common: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var vertexIDVal string + if p.VertexID == nil { + vertexIDVal = "" + } else { + vertexIDVal = fmt.Sprintf("%v", p.VertexID) + } + tagIDVal := fmt.Sprintf("%v", p.TagID) + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("UpdateVertexRequest({SpaceID:%s PartID:%s VertexID:%s TagID:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s Common:%s})", spaceIDVal, partIDVal, vertexIDVal, tagIDVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal, commonVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - EdgeKey +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +// - Common +type UpdateEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + EdgeKey *EdgeKey `thrift:"edge_key,3" db:"edge_key" json:"edge_key"` + UpdatedProps []*UpdatedProp `thrift:"updated_props,4" db:"updated_props" json:"updated_props"` + Insertable bool `thrift:"insertable,5" db:"insertable" json:"insertable,omitempty"` + ReturnProps [][]byte `thrift:"return_props,6" db:"return_props" json:"return_props,omitempty"` + Condition []byte `thrift:"condition,7" db:"condition" json:"condition,omitempty"` + Common *RequestCommon `thrift:"common,8" db:"common" json:"common,omitempty"` +} + +func NewUpdateEdgeRequest() *UpdateEdgeRequest { + return &UpdateEdgeRequest{ + EdgeKey: NewEdgeKey(), + } +} + + +func (p *UpdateEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var UpdateEdgeRequest_EdgeKey_DEFAULT *EdgeKey +func (p *UpdateEdgeRequest) GetEdgeKey() *EdgeKey { + if !p.IsSetEdgeKey() { + return UpdateEdgeRequest_EdgeKey_DEFAULT + } +return p.EdgeKey +} + +func (p *UpdateEdgeRequest) GetUpdatedProps() []*UpdatedProp { + return p.UpdatedProps +} +var UpdateEdgeRequest_Insertable_DEFAULT bool = false + +func (p *UpdateEdgeRequest) GetInsertable() bool { + return p.Insertable +} +var UpdateEdgeRequest_ReturnProps_DEFAULT [][]byte + +func (p *UpdateEdgeRequest) GetReturnProps() [][]byte { + return p.ReturnProps +} +var UpdateEdgeRequest_Condition_DEFAULT []byte + +func (p *UpdateEdgeRequest) GetCondition() []byte { + return p.Condition +} +var UpdateEdgeRequest_Common_DEFAULT *RequestCommon +func (p *UpdateEdgeRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return UpdateEdgeRequest_Common_DEFAULT + } +return p.Common +} +func (p *UpdateEdgeRequest) IsSetEdgeKey() bool { + return p != nil && p.EdgeKey != nil +} + +func (p *UpdateEdgeRequest) IsSetInsertable() bool { + return p != nil && p.Insertable != UpdateEdgeRequest_Insertable_DEFAULT +} + +func (p *UpdateEdgeRequest) IsSetReturnProps() bool { + return p != nil && p.ReturnProps != nil +} + +func (p *UpdateEdgeRequest) IsSetCondition() bool { + return p != nil && p.Condition != nil +} + +func (p *UpdateEdgeRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *UpdateEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField3(iprot thrift.Protocol) error { + p.EdgeKey = NewEdgeKey() + if err := p.EdgeKey.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeKey), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.UpdatedProps = append(p.UpdatedProps, _elem49) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField6(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.ReturnProps = tSlice + for i := 0; i < size; i ++ { +var _elem50 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem50 = v +} + p.ReturnProps = append(p.ReturnProps, _elem50) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField8(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 *UpdateEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("UpdateEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateEdgeRequest) 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 *UpdateEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_key", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_key: ", p), err) } + if err := p.EdgeKey.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeKey), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_key: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("updated_props", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:updated_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:updated_props: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin("insertable", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:insertable: ", p), err) } + if err := oprot.WriteBool(bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:insertable: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin("return_props", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_props: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + 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 6:return_props: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin("condition", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:condition: ", p), err) } + if err := oprot.WriteBinary(p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:condition: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8: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 8:common: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var edgeKeyVal string + if p.EdgeKey == nil { + edgeKeyVal = "" + } else { + edgeKeyVal = fmt.Sprintf("%v", p.EdgeKey) + } + updatedPropsVal := fmt.Sprintf("%v", p.UpdatedProps) + insertableVal := fmt.Sprintf("%v", p.Insertable) + returnPropsVal := fmt.Sprintf("%v", p.ReturnProps) + conditionVal := fmt.Sprintf("%v", p.Condition) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("UpdateEdgeRequest({SpaceID:%s PartID:%s EdgeKey:%s UpdatedProps:%s Insertable:%s ReturnProps:%s Condition:%s Common:%s})", spaceIDVal, partIDVal, edgeKeyVal, updatedPropsVal, insertableVal, returnPropsVal, conditionVal, commonVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Name +// - Common +type GetUUIDReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Name []byte `thrift:"name,3" db:"name" json:"name"` + Common *RequestCommon `thrift:"common,4" db:"common" json:"common,omitempty"` +} + +func NewGetUUIDReq() *GetUUIDReq { + return &GetUUIDReq{} +} + + +func (p *GetUUIDReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *GetUUIDReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *GetUUIDReq) GetName() []byte { + return p.Name +} +var GetUUIDReq_Common_DEFAULT *RequestCommon +func (p *GetUUIDReq) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return GetUUIDReq_Common_DEFAULT + } +return p.Common +} +func (p *GetUUIDReq) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *GetUUIDReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetUUIDReq) 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 *GetUUIDReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *GetUUIDReq) 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) + } + return nil +} + +func (p *GetUUIDReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetUUIDReq) 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 *GetUUIDReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + 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 4:common: ", p), err) } + } + return err +} + +func (p *GetUUIDReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + nameVal := fmt.Sprintf("%v", p.Name) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("GetUUIDReq({SpaceID:%s PartID:%s Name:%s Common:%s})", spaceIDVal, partIDVal, nameVal, commonVal) +} + +// Attributes: +// - Result_ +// - Id +type GetUUIDResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Id *nebula0.Value `thrift:"id,2" db:"id" json:"id"` +} + +func NewGetUUIDResp() *GetUUIDResp { + return &GetUUIDResp{ + Result_: NewResponseCommon(), + } +} + +var GetUUIDResp_Result__DEFAULT *ResponseCommon +func (p *GetUUIDResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetUUIDResp_Result__DEFAULT + } +return p.Result_ +} +var GetUUIDResp_Id_DEFAULT *nebula0.Value +func (p *GetUUIDResp) GetId() *nebula0.Value { + if !p.IsSetId() { + return GetUUIDResp_Id_DEFAULT + } +return p.Id +} +func (p *GetUUIDResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetUUIDResp) IsSetId() bool { + return p != nil && p.Id != nil +} + +func (p *GetUUIDResp) 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 *GetUUIDResp) 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 *GetUUIDResp) ReadField2(iprot thrift.Protocol) error { + p.Id = nebula0.NewValue() + if err := p.Id.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Id), err) + } + return nil +} + +func (p *GetUUIDResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetUUIDResp"); 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 *GetUUIDResp) 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 *GetUUIDResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := p.Id.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Id), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *GetUUIDResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var idVal string + if p.Id == nil { + idVal = "" + } else { + idVal = fmt.Sprintf("%v", p.Id) + } + return fmt.Sprintf("GetUUIDResp({Result_:%s Id:%s})", resultVal, idVal) +} + +// Attributes: +// - Result_ +// - Data +type LookupIndexResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Data *nebula0.DataSet `thrift:"data,2" db:"data" json:"data,omitempty"` +} + +func NewLookupIndexResp() *LookupIndexResp { + return &LookupIndexResp{ + Result_: NewResponseCommon(), + } +} + +var LookupIndexResp_Result__DEFAULT *ResponseCommon +func (p *LookupIndexResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return LookupIndexResp_Result__DEFAULT + } +return p.Result_ +} +var LookupIndexResp_Data_DEFAULT *nebula0.DataSet +func (p *LookupIndexResp) GetData() *nebula0.DataSet { + if !p.IsSetData() { + return LookupIndexResp_Data_DEFAULT + } +return p.Data +} +func (p *LookupIndexResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *LookupIndexResp) IsSetData() bool { + return p != nil && p.Data != nil +} + +func (p *LookupIndexResp) 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 *LookupIndexResp) 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 *LookupIndexResp) ReadField2(iprot thrift.Protocol) error { + p.Data = nebula0.NewDataSet() + if err := p.Data.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *LookupIndexResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexResp"); 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 *LookupIndexResp) 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 *LookupIndexResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := p.Data.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dataVal string + if p.Data == nil { + dataVal = "" + } else { + dataVal = fmt.Sprintf("%v", p.Data) + } + return fmt.Sprintf("LookupIndexResp({Result_:%s Data:%s})", resultVal, dataVal) +} + +// Attributes: +// - ColumnName +// - ScanType +// - BeginValue +// - EndValue +type IndexColumnHint struct { + ColumnName []byte `thrift:"column_name,1" db:"column_name" json:"column_name"` + ScanType ScanType `thrift:"scan_type,2" db:"scan_type" json:"scan_type"` + BeginValue *nebula0.Value `thrift:"begin_value,3" db:"begin_value" json:"begin_value"` + EndValue *nebula0.Value `thrift:"end_value,4" db:"end_value" json:"end_value"` +} + +func NewIndexColumnHint() *IndexColumnHint { + return &IndexColumnHint{} +} + + +func (p *IndexColumnHint) GetColumnName() []byte { + return p.ColumnName +} + +func (p *IndexColumnHint) GetScanType() ScanType { + return p.ScanType +} +var IndexColumnHint_BeginValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetBeginValue() *nebula0.Value { + if !p.IsSetBeginValue() { + return IndexColumnHint_BeginValue_DEFAULT + } +return p.BeginValue +} +var IndexColumnHint_EndValue_DEFAULT *nebula0.Value +func (p *IndexColumnHint) GetEndValue() *nebula0.Value { + if !p.IsSetEndValue() { + return IndexColumnHint_EndValue_DEFAULT + } +return p.EndValue +} +func (p *IndexColumnHint) IsSetBeginValue() bool { + return p != nil && p.BeginValue != nil +} + +func (p *IndexColumnHint) IsSetEndValue() bool { + return p != nil && p.EndValue != nil +} + +func (p *IndexColumnHint) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *IndexColumnHint) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ScanType(v) + p.ScanType = temp +} + return nil +} + +func (p *IndexColumnHint) ReadField3(iprot thrift.Protocol) error { + p.BeginValue = nebula0.NewValue() + if err := p.BeginValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BeginValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField4(iprot thrift.Protocol) error { + p.EndValue = nebula0.NewValue() + if err := p.EndValue.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndValue), err) + } + return nil +} + +func (p *IndexColumnHint) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexColumnHint"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexColumnHint) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:column_name: ", p), err) } + if err := oprot.WriteBinary(p.ColumnName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.column_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_name: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("scan_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:scan_type: ", p), err) } + if err := oprot.WriteI32(int32(p.ScanType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.scan_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:scan_type: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("begin_value", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:begin_value: ", p), err) } + if err := p.BeginValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BeginValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:begin_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("end_value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:end_value: ", p), err) } + if err := p.EndValue.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndValue), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:end_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) String() string { + if p == nil { + return "" + } + + columnNameVal := fmt.Sprintf("%v", p.ColumnName) + scanTypeVal := fmt.Sprintf("%v", p.ScanType) + var beginValueVal string + if p.BeginValue == nil { + beginValueVal = "" + } else { + beginValueVal = fmt.Sprintf("%v", p.BeginValue) + } + var endValueVal string + if p.EndValue == nil { + endValueVal = "" + } else { + endValueVal = fmt.Sprintf("%v", p.EndValue) + } + return fmt.Sprintf("IndexColumnHint({ColumnName:%s ScanType:%s BeginValue:%s EndValue:%s})", columnNameVal, scanTypeVal, beginValueVal, endValueVal) +} + +// Attributes: +// - IndexID +// - Filter +// - ColumnHints +type IndexQueryContext struct { + IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + Filter []byte `thrift:"filter,2" db:"filter" json:"filter"` + ColumnHints []*IndexColumnHint `thrift:"column_hints,3" db:"column_hints" json:"column_hints"` +} + +func NewIndexQueryContext() *IndexQueryContext { + return &IndexQueryContext{} +} + + +func (p *IndexQueryContext) GetIndexID() nebula0.IndexID { + return p.IndexID +} + +func (p *IndexQueryContext) GetFilter() []byte { + return p.Filter +} + +func (p *IndexQueryContext) GetColumnHints() []*IndexColumnHint { + return p.ColumnHints +} +func (p *IndexQueryContext) 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 *IndexQueryContext) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexQueryContext) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *IndexQueryContext) ReadField3(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.ColumnHints = append(p.ColumnHints, _elem51) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexQueryContext) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexQueryContext"); 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 *IndexQueryContext) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:filter: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_hints", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:column_hints: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColumnHints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnHints { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:column_hints: ", p), err) } + return err +} + +func (p *IndexQueryContext) String() string { + if p == nil { + return "" + } + + indexIDVal := fmt.Sprintf("%v", p.IndexID) + filterVal := fmt.Sprintf("%v", p.Filter) + columnHintsVal := fmt.Sprintf("%v", p.ColumnHints) + return fmt.Sprintf("IndexQueryContext({IndexID:%s Filter:%s ColumnHints:%s})", indexIDVal, filterVal, columnHintsVal) +} + +// Attributes: +// - Contexts +// - SchemaID +type IndexSpec struct { + Contexts []*IndexQueryContext `thrift:"contexts,1,required" db:"contexts" json:"contexts"` + SchemaID *nebula0.SchemaID `thrift:"schema_id,2" db:"schema_id" json:"schema_id"` +} + +func NewIndexSpec() *IndexSpec { + return &IndexSpec{} +} + + +func (p *IndexSpec) GetContexts() []*IndexQueryContext { + return p.Contexts +} +var IndexSpec_SchemaID_DEFAULT *nebula0.SchemaID +func (p *IndexSpec) GetSchemaID() *nebula0.SchemaID { + if !p.IsSetSchemaID() { + return IndexSpec_SchemaID_DEFAULT + } +return p.SchemaID +} +func (p *IndexSpec) IsSetSchemaID() bool { + return p != nil && p.SchemaID != nil +} + +func (p *IndexSpec) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetContexts 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 + } + issetContexts = 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 !issetContexts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Contexts is not set")); + } + return nil +} + +func (p *IndexSpec) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + 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) + } + p.Contexts = append(p.Contexts, _elem52) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexSpec) ReadField2(iprot thrift.Protocol) error { + p.SchemaID = nebula0.NewSchemaID() + if err := p.SchemaID.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexSpec) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("IndexSpec"); 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 *IndexSpec) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("contexts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:contexts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Contexts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Contexts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:contexts: ", p), err) } + return err +} + +func (p *IndexSpec) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("schema_id", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema_id: ", p), err) } + if err := p.SchemaID.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_id: ", p), err) } + return err +} + +func (p *IndexSpec) String() string { + if p == nil { + return "" + } + + contextsVal := fmt.Sprintf("%v", p.Contexts) + var schemaIDVal string + if p.SchemaID == nil { + schemaIDVal = "" + } else { + schemaIDVal = fmt.Sprintf("%v", p.SchemaID) + } + return fmt.Sprintf("IndexSpec({Contexts:%s SchemaID:%s})", contextsVal, schemaIDVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - ReturnColumns +// - Common +// - Limit +type LookupIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + ReturnColumns [][]byte `thrift:"return_columns,4" db:"return_columns" json:"return_columns,omitempty"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` + Limit *int64 `thrift:"limit,6" db:"limit" json:"limit,omitempty"` +} + +func NewLookupIndexRequest() *LookupIndexRequest { + return &LookupIndexRequest{ + Indices: NewIndexSpec(), + } +} + + +func (p *LookupIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupIndexRequest_Indices_DEFAULT *IndexSpec +func (p *LookupIndexRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupIndexRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupIndexRequest_ReturnColumns_DEFAULT [][]byte + +func (p *LookupIndexRequest) GetReturnColumns() [][]byte { + return p.ReturnColumns +} +var LookupIndexRequest_Common_DEFAULT *RequestCommon +func (p *LookupIndexRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return LookupIndexRequest_Common_DEFAULT + } +return p.Common +} +var LookupIndexRequest_Limit_DEFAULT int64 +func (p *LookupIndexRequest) GetLimit() int64 { + if !p.IsSetLimit() { + return LookupIndexRequest_Limit_DEFAULT + } +return *p.Limit +} +func (p *LookupIndexRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupIndexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *LookupIndexRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *LookupIndexRequest) IsSetLimit() bool { + return p != nil && p.Limit != nil +} + +func (p *LookupIndexRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem53 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem53 = temp +} + p.Parts = append(p.Parts, _elem53) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField4(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.ReturnColumns = tSlice + for i := 0; i < size; i ++ { +var _elem54 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem54 = v +} + p.ReturnColumns = append(p.ReturnColumns, _elem54) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *LookupIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupIndexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetReturnColumns() { + if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + 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 4:return_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) 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 *LookupIndexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:limit: ", p), err) } + if err := oprot.WriteI64(int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:limit: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + returnColumnsVal := fmt.Sprintf("%v", p.ReturnColumns) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + var limitVal string + if p.Limit == nil { + limitVal = "" + } else { + limitVal = fmt.Sprintf("%v", *p.Limit) + } + return fmt.Sprintf("LookupIndexRequest({SpaceID:%s Parts:%s Indices:%s ReturnColumns:%s Common:%s Limit:%s})", spaceIDVal, partsVal, indicesVal, returnColumnsVal, commonVal, limitVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - TraverseSpec +// - Common +type LookupAndTraverseRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2,required" db:"parts" json:"parts"` + Indices *IndexSpec `thrift:"indices,3" db:"indices" json:"indices"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` +} + +func NewLookupAndTraverseRequest() *LookupAndTraverseRequest { + return &LookupAndTraverseRequest{ + Indices: NewIndexSpec(), + TraverseSpec: NewTraverseSpec(), + } +} + + +func (p *LookupAndTraverseRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupAndTraverseRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +var LookupAndTraverseRequest_Indices_DEFAULT *IndexSpec +func (p *LookupAndTraverseRequest) GetIndices() *IndexSpec { + if !p.IsSetIndices() { + return LookupAndTraverseRequest_Indices_DEFAULT + } +return p.Indices +} +var LookupAndTraverseRequest_TraverseSpec_DEFAULT *TraverseSpec +func (p *LookupAndTraverseRequest) GetTraverseSpec() *TraverseSpec { + if !p.IsSetTraverseSpec() { + return LookupAndTraverseRequest_TraverseSpec_DEFAULT + } +return p.TraverseSpec +} +var LookupAndTraverseRequest_Common_DEFAULT *RequestCommon +func (p *LookupAndTraverseRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return LookupAndTraverseRequest_Common_DEFAULT + } +return p.Common +} +func (p *LookupAndTraverseRequest) IsSetIndices() bool { + return p != nil && p.Indices != nil +} + +func (p *LookupAndTraverseRequest) IsSetTraverseSpec() bool { + return p != nil && p.TraverseSpec != nil +} + +func (p *LookupAndTraverseRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *LookupAndTraverseRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSpaceID bool = false; + var issetParts 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 + } + issetSpaceID = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetParts = true + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(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) + } + if !issetSpaceID{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem55 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem55 = temp +} + p.Parts = append(p.Parts, _elem55) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField3(iprot thrift.Protocol) error { + p.Indices = NewIndexSpec() + if err := p.Indices.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LookupAndTraverseRequest"); 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 *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("indices", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indices: ", p), err) } + if err := p.Indices.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) 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 *LookupAndTraverseRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + var indicesVal string + if p.Indices == nil { + indicesVal = "" + } else { + indicesVal = fmt.Sprintf("%v", p.Indices) + } + 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("LookupAndTraverseRequest({SpaceID:%s Parts:%s Indices:%s TraverseSpec:%s Common:%s})", spaceIDVal, partsVal, indicesVal, traverseSpecVal, commonVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +// - Common +type ScanVertexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *VertexProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` + Common *RequestCommon `thrift:"common,11" db:"common" json:"common,omitempty"` +} + +func NewScanVertexRequest() *ScanVertexRequest { + return &ScanVertexRequest{ + ReturnColumns: NewVertexProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanVertexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanVertexRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanVertexRequest_Cursor_DEFAULT []byte + +func (p *ScanVertexRequest) GetCursor() []byte { + return p.Cursor +} +var ScanVertexRequest_ReturnColumns_DEFAULT *VertexProp +func (p *ScanVertexRequest) GetReturnColumns() *VertexProp { + if !p.IsSetReturnColumns() { + return ScanVertexRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanVertexRequest) GetLimit() int64 { + return p.Limit +} +var ScanVertexRequest_StartTime_DEFAULT int64 +func (p *ScanVertexRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanVertexRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanVertexRequest_EndTime_DEFAULT int64 +func (p *ScanVertexRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanVertexRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanVertexRequest_Filter_DEFAULT []byte + +func (p *ScanVertexRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanVertexRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanVertexRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +var ScanVertexRequest_Common_DEFAULT *RequestCommon +func (p *ScanVertexRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return ScanVertexRequest_Common_DEFAULT + } +return p.Common +} +func (p *ScanVertexRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanVertexRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanVertexRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanVertexRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanVertexRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanVertexRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *ScanVertexRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *ScanVertexRequest) 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 *ScanVertexRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanVertexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewVertexProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField11(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 *ScanVertexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexRequest) 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 *ScanVertexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11: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 11:common: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("ScanVertexRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s Common:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal, commonVal) +} + +// Attributes: +// - Result_ +// - VertexData +// - HasNext +// - NextCursor +type ScanVertexResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + VertexData *nebula0.DataSet `thrift:"vertex_data,2" db:"vertex_data" json:"vertex_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanVertexResponse() *ScanVertexResponse { + return &ScanVertexResponse{ + Result_: NewResponseCommon(), + VertexData: nebula0.NewDataSet(), + } +} + +var ScanVertexResponse_Result__DEFAULT *ResponseCommon +func (p *ScanVertexResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanVertexResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanVertexResponse_VertexData_DEFAULT *nebula0.DataSet +func (p *ScanVertexResponse) GetVertexData() *nebula0.DataSet { + if !p.IsSetVertexData() { + return ScanVertexResponse_VertexData_DEFAULT + } +return p.VertexData +} + +func (p *ScanVertexResponse) GetHasNext() bool { + return p.HasNext +} +var ScanVertexResponse_NextCursor_DEFAULT []byte + +func (p *ScanVertexResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanVertexResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanVertexResponse) IsSetVertexData() bool { + return p != nil && p.VertexData != nil +} + +func (p *ScanVertexResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanVertexResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanVertexResponse) ReadField1(iprot thrift.Protocol) error { + p.Result_ = NewResponseCommon() + if err := p.Result_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField2(iprot thrift.Protocol) error { + p.VertexData = nebula0.NewDataSet() + if err := p.VertexData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexData), err) + } + return nil +} + +func (p *ScanVertexResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanVertexResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanVertexResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanVertexResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexResponse) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } + if err := p.Result_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vertex_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertex_data: ", p), err) } + if err := p.VertexData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertex_data: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanVertexResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanVertexResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var vertexDataVal string + if p.VertexData == nil { + vertexDataVal = "" + } else { + vertexDataVal = fmt.Sprintf("%v", p.VertexData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanVertexResponse({Result_:%s VertexData:%s HasNext:%s NextCursor:%s})", resultVal, vertexDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Cursor +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +// - Common +type ScanEdgeRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Cursor []byte `thrift:"cursor,3" db:"cursor" json:"cursor,omitempty"` + ReturnColumns *EdgeProp `thrift:"return_columns,4" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,5" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,6" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,7" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,8" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,9" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,10" db:"enable_read_from_follower" json:"enable_read_from_follower"` + Common *RequestCommon `thrift:"common,11" db:"common" json:"common,omitempty"` +} + +func NewScanEdgeRequest() *ScanEdgeRequest { + return &ScanEdgeRequest{ + ReturnColumns: NewEdgeProp(), + EnableReadFromFollower: true, + } +} + + +func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanEdgeRequest) GetPartID() nebula0.PartitionID { + return p.PartID +} +var ScanEdgeRequest_Cursor_DEFAULT []byte + +func (p *ScanEdgeRequest) GetCursor() []byte { + return p.Cursor +} +var ScanEdgeRequest_ReturnColumns_DEFAULT *EdgeProp +func (p *ScanEdgeRequest) GetReturnColumns() *EdgeProp { + if !p.IsSetReturnColumns() { + return ScanEdgeRequest_ReturnColumns_DEFAULT + } +return p.ReturnColumns +} + +func (p *ScanEdgeRequest) GetLimit() int64 { + return p.Limit +} +var ScanEdgeRequest_StartTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetStartTime() int64 { + if !p.IsSetStartTime() { + return ScanEdgeRequest_StartTime_DEFAULT + } +return *p.StartTime +} +var ScanEdgeRequest_EndTime_DEFAULT int64 +func (p *ScanEdgeRequest) GetEndTime() int64 { + if !p.IsSetEndTime() { + return ScanEdgeRequest_EndTime_DEFAULT + } +return *p.EndTime +} +var ScanEdgeRequest_Filter_DEFAULT []byte + +func (p *ScanEdgeRequest) GetFilter() []byte { + return p.Filter +} + +func (p *ScanEdgeRequest) GetOnlyLatestVersion() bool { + return p.OnlyLatestVersion +} + +func (p *ScanEdgeRequest) GetEnableReadFromFollower() bool { + return p.EnableReadFromFollower +} +var ScanEdgeRequest_Common_DEFAULT *RequestCommon +func (p *ScanEdgeRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return ScanEdgeRequest_Common_DEFAULT + } +return p.Common +} +func (p *ScanEdgeRequest) IsSetCursor() bool { + return p != nil && p.Cursor != nil +} + +func (p *ScanEdgeRequest) IsSetReturnColumns() bool { + return p != nil && p.ReturnColumns != nil +} + +func (p *ScanEdgeRequest) IsSetStartTime() bool { + return p != nil && p.StartTime != nil +} + +func (p *ScanEdgeRequest) IsSetEndTime() bool { + return p != nil && p.EndTime != nil +} + +func (p *ScanEdgeRequest) IsSetFilter() bool { + return p != nil && p.Filter != nil +} + +func (p *ScanEdgeRequest) IsSetCommon() bool { + return p != nil && p.Common != nil +} + +func (p *ScanEdgeRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(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 *ScanEdgeRequest) 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 *ScanEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ScanEdgeRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Cursor = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField4(iprot thrift.Protocol) error { + p.ReturnColumns = NewEdgeProp() + if err := p.ReturnColumns.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ReturnColumns), err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField8(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField9(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField10(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField11(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 *ScanEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeRequest) 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 *ScanEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetCursor() { + if err := oprot.WriteFieldBegin("cursor", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursor: ", p), err) } + if err := oprot.WriteBinary(p.Cursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cursor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_columns", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:return_columns: ", p), err) } + if err := p.ReturnColumns.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ReturnColumns), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("limit", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:limit: ", p), err) } + if err := oprot.WriteI64(int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:limit: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin("start_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin("end_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:end_time: ", p), err) } + if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:end_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin("filter", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:filter: ", p), err) } + if err := oprot.WriteBinary(p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:filter: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField9(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:only_latest_version: ", p), err) } + if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:only_latest_version: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField10(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11: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 11:common: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + cursorVal := fmt.Sprintf("%v", p.Cursor) + var returnColumnsVal string + if p.ReturnColumns == nil { + returnColumnsVal = "" + } else { + returnColumnsVal = fmt.Sprintf("%v", p.ReturnColumns) + } + limitVal := fmt.Sprintf("%v", p.Limit) + var startTimeVal string + if p.StartTime == nil { + startTimeVal = "" + } else { + startTimeVal = fmt.Sprintf("%v", *p.StartTime) + } + var endTimeVal string + if p.EndTime == nil { + endTimeVal = "" + } else { + endTimeVal = fmt.Sprintf("%v", *p.EndTime) + } + filterVal := fmt.Sprintf("%v", p.Filter) + onlyLatestVersionVal := fmt.Sprintf("%v", p.OnlyLatestVersion) + enableReadFromFollowerVal := fmt.Sprintf("%v", p.EnableReadFromFollower) + var commonVal string + if p.Common == nil { + commonVal = "" + } else { + commonVal = fmt.Sprintf("%v", p.Common) + } + return fmt.Sprintf("ScanEdgeRequest({SpaceID:%s PartID:%s Cursor:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s Common:%s})", spaceIDVal, partIDVal, cursorVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal, commonVal) +} + +// Attributes: +// - Result_ +// - EdgeData +// - HasNext +// - NextCursor +type ScanEdgeResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + EdgeData *nebula0.DataSet `thrift:"edge_data,2" db:"edge_data" json:"edge_data"` + HasNext bool `thrift:"has_next,3" db:"has_next" json:"has_next"` + NextCursor []byte `thrift:"next_cursor,4" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanEdgeResponse() *ScanEdgeResponse { + return &ScanEdgeResponse{ + Result_: NewResponseCommon(), + EdgeData: nebula0.NewDataSet(), + } +} + +var ScanEdgeResponse_Result__DEFAULT *ResponseCommon +func (p *ScanEdgeResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanEdgeResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanEdgeResponse_EdgeData_DEFAULT *nebula0.DataSet +func (p *ScanEdgeResponse) GetEdgeData() *nebula0.DataSet { + if !p.IsSetEdgeData() { + return ScanEdgeResponse_EdgeData_DEFAULT + } +return p.EdgeData +} + +func (p *ScanEdgeResponse) GetHasNext() bool { + return p.HasNext +} +var ScanEdgeResponse_NextCursor_DEFAULT []byte + +func (p *ScanEdgeResponse) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanEdgeResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ScanEdgeResponse) IsSetEdgeData() bool { + return p != nil && p.EdgeData != nil +} + +func (p *ScanEdgeResponse) IsSetNextCursor() bool { + return p != nil && p.NextCursor != nil +} + +func (p *ScanEdgeResponse) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if err := p.ReadField1(iprot); err != nil { + return err + } + issetResult_ = true + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + case 3: + if err := p.ReadField3(iprot); err != nil { + return err + } + case 4: + if err := p.ReadField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) ReadField2(iprot thrift.Protocol) error { + p.EdgeData = nebula0.NewDataSet() + if err := p.EdgeData.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeData), err) + } + return nil +} + +func (p *ScanEdgeResponse) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasNext = v +} + return nil +} + +func (p *ScanEdgeResponse) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanEdgeResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ScanEdgeResponse"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeResponse) 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 *ScanEdgeResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("edge_data", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_data: ", p), err) } + if err := p.EdgeData.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeData), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_data: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("has_next", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:has_next: ", p), err) } + if err := oprot.WriteBool(bool(p.HasNext)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.has_next (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:has_next: ", p), err) } + return err +} + +func (p *ScanEdgeResponse) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:next_cursor: ", p), err) } + if err := oprot.WriteBinary(p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanEdgeResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var edgeDataVal string + if p.EdgeData == nil { + edgeDataVal = "" + } else { + edgeDataVal = fmt.Sprintf("%v", p.EdgeData) + } + hasNextVal := fmt.Sprintf("%v", p.HasNext) + nextCursorVal := fmt.Sprintf("%v", p.NextCursor) + return fmt.Sprintf("ScanEdgeResponse({Result_:%s EdgeData:%s HasNext:%s NextCursor:%s})", resultVal, edgeDataVal, hasNextVal, nextCursorVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - TaskSpecficParas +type TaskPara struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts,omitempty"` + TaskSpecficParas [][]byte `thrift:"task_specfic_paras,3" db:"task_specfic_paras" json:"task_specfic_paras,omitempty"` +} + +func NewTaskPara() *TaskPara { + return &TaskPara{} +} + + +func (p *TaskPara) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} +var TaskPara_Parts_DEFAULT []nebula0.PartitionID + +func (p *TaskPara) GetParts() []nebula0.PartitionID { + return p.Parts +} +var TaskPara_TaskSpecficParas_DEFAULT [][]byte + +func (p *TaskPara) GetTaskSpecficParas() [][]byte { + return p.TaskSpecficParas +} +func (p *TaskPara) IsSetParts() bool { + return p != nil && p.Parts != nil +} + +func (p *TaskPara) IsSetTaskSpecficParas() bool { + return p != nil && p.TaskSpecficParas != nil +} + +func (p *TaskPara) 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 *TaskPara) 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 *TaskPara) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem56 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem56 = temp +} + p.Parts = append(p.Parts, _elem56) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) ReadField3(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.TaskSpecficParas = tSlice + for i := 0; i < size; i ++ { +var _elem57 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem57 = v +} + p.TaskSpecficParas = append(p.TaskSpecficParas, _elem57) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TaskPara"); 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 *TaskPara) 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 *TaskPara) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetParts() { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + } + return err +} + +func (p *TaskPara) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetTaskSpecficParas() { + if err := oprot.WriteFieldBegin("task_specfic_paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specfic_paras: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.TaskSpecficParas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskSpecficParas { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_specfic_paras: ", p), err) } + } + return err +} + +func (p *TaskPara) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + taskSpecficParasVal := fmt.Sprintf("%v", p.TaskSpecficParas) + return fmt.Sprintf("TaskPara({SpaceID:%s Parts:%s TaskSpecficParas:%s})", spaceIDVal, partsVal, taskSpecficParasVal) +} + +// Attributes: +// - Cmd +// - JobID +// - TaskID +// - Para +// - Concurrency +type AddAdminTaskRequest struct { + Cmd meta1.AdminCmd `thrift:"cmd,1" db:"cmd" json:"cmd"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Para *TaskPara `thrift:"para,4" db:"para" json:"para"` + Concurrency *int32 `thrift:"concurrency,5" db:"concurrency" json:"concurrency,omitempty"` +} + +func NewAddAdminTaskRequest() *AddAdminTaskRequest { + return &AddAdminTaskRequest{ + Para: NewTaskPara(), + } +} + + +func (p *AddAdminTaskRequest) GetCmd() meta1.AdminCmd { + return p.Cmd +} + +func (p *AddAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *AddAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +var AddAdminTaskRequest_Para_DEFAULT *TaskPara +func (p *AddAdminTaskRequest) GetPara() *TaskPara { + if !p.IsSetPara() { + return AddAdminTaskRequest_Para_DEFAULT + } +return p.Para +} +var AddAdminTaskRequest_Concurrency_DEFAULT int32 +func (p *AddAdminTaskRequest) GetConcurrency() int32 { + if !p.IsSetConcurrency() { + return AddAdminTaskRequest_Concurrency_DEFAULT + } +return *p.Concurrency +} +func (p *AddAdminTaskRequest) IsSetPara() bool { + return p != nil && p.Para != nil +} + +func (p *AddAdminTaskRequest) IsSetConcurrency() bool { + return p != nil && p.Concurrency != nil +} + +func (p *AddAdminTaskRequest) 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 + } + 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 *AddAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := meta1.AdminCmd(v) + p.Cmd = temp +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *AddAdminTaskRequest) ReadField4(iprot thrift.Protocol) error { + p.Para = NewTaskPara() + if err := p.Para.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Para), err) + } + return nil +} + +func (p *AddAdminTaskRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Concurrency = &v +} + return nil +} + +func (p *AddAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddAdminTaskRequest"); 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 *AddAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("cmd", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cmd: ", p), err) } + if err := oprot.WriteI32(int32(p.Cmd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cmd (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cmd: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("para", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:para: ", p), err) } + if err := p.Para.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Para), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:para: ", p), err) } + return err +} + +func (p *AddAdminTaskRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetConcurrency() { + if err := oprot.WriteFieldBegin("concurrency", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:concurrency: ", p), err) } + if err := oprot.WriteI32(int32(*p.Concurrency)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.concurrency (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:concurrency: ", p), err) } + } + return err +} + +func (p *AddAdminTaskRequest) String() string { + if p == nil { + return "" + } + + cmdVal := fmt.Sprintf("%v", p.Cmd) + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + var paraVal string + if p.Para == nil { + paraVal = "" + } else { + paraVal = fmt.Sprintf("%v", p.Para) + } + var concurrencyVal string + if p.Concurrency == nil { + concurrencyVal = "" + } else { + concurrencyVal = fmt.Sprintf("%v", *p.Concurrency) + } + return fmt.Sprintf("AddAdminTaskRequest({Cmd:%s JobID:%s TaskID:%s Para:%s Concurrency:%s})", cmdVal, jobIDVal, taskIDVal, paraVal, concurrencyVal) +} + +// Attributes: +// - JobID +// - TaskID +type StopAdminTaskRequest struct { + JobID int32 `thrift:"job_id,1" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,2" db:"task_id" json:"task_id"` +} + +func NewStopAdminTaskRequest() *StopAdminTaskRequest { + return &StopAdminTaskRequest{} +} + + +func (p *StopAdminTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *StopAdminTaskRequest) GetTaskID() int32 { + return p.TaskID +} +func (p *StopAdminTaskRequest) 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 *StopAdminTaskRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *StopAdminTaskRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *StopAdminTaskRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("StopAdminTaskRequest"); 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 *StopAdminTaskRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("job_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_id: ", p), err) } + if err := oprot.WriteI32(int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("task_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:task_id: ", p), err) } + if err := oprot.WriteI32(int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:task_id: ", p), err) } + return err +} + +func (p *StopAdminTaskRequest) String() string { + if p == nil { + return "" + } + + jobIDVal := fmt.Sprintf("%v", p.JobID) + taskIDVal := fmt.Sprintf("%v", p.TaskID) + return fmt.Sprintf("StopAdminTaskRequest({JobID:%s TaskID:%s})", jobIDVal, taskIDVal) +} + +// Attributes: +// - Result_ +// - Stats +type AdminExecResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Stats *meta1.StatsItem `thrift:"stats,2" db:"stats" json:"stats,omitempty"` +} + +func NewAdminExecResp() *AdminExecResp { + return &AdminExecResp{ + Result_: NewResponseCommon(), + } +} + +var AdminExecResp_Result__DEFAULT *ResponseCommon +func (p *AdminExecResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return AdminExecResp_Result__DEFAULT + } +return p.Result_ +} +var AdminExecResp_Stats_DEFAULT *meta1.StatsItem +func (p *AdminExecResp) GetStats() *meta1.StatsItem { + if !p.IsSetStats() { + return AdminExecResp_Stats_DEFAULT + } +return p.Stats +} +func (p *AdminExecResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *AdminExecResp) IsSetStats() bool { + return p != nil && p.Stats != nil +} + +func (p *AdminExecResp) 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 *AdminExecResp) 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 *AdminExecResp) ReadField2(iprot thrift.Protocol) error { + p.Stats = meta1.NewStatsItem() + if err := p.Stats.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *AdminExecResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AdminExecResp"); 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 *AdminExecResp) 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 *AdminExecResp) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetStats() { + if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stats: ", p), err) } + if err := p.Stats.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stats: ", p), err) } + } + return err +} + +func (p *AdminExecResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var statsVal string + if p.Stats == nil { + statsVal = "" + } else { + statsVal = fmt.Sprintf("%v", p.Stats) + } + return fmt.Sprintf("AdminExecResp({Result_:%s Stats:%s})", resultVal, statsVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - NewLeader_ +type TransLeaderReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + NewLeader_ *nebula0.HostAddr `thrift:"new_leader,3" db:"new_leader" json:"new_leader"` +} + +func NewTransLeaderReq() *TransLeaderReq { + return &TransLeaderReq{ + NewLeader_: nebula0.NewHostAddr(), + } +} + + +func (p *TransLeaderReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *TransLeaderReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var TransLeaderReq_NewLeader__DEFAULT *nebula0.HostAddr +func (p *TransLeaderReq) GetNewLeader_() *nebula0.HostAddr { + if !p.IsSetNewLeader_() { + return TransLeaderReq_NewLeader__DEFAULT + } +return p.NewLeader_ +} +func (p *TransLeaderReq) IsSetNewLeader_() bool { + return p != nil && p.NewLeader_ != nil +} + +func (p *TransLeaderReq) 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 *TransLeaderReq) 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 *TransLeaderReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField3(iprot thrift.Protocol) error { + p.NewLeader_ = nebula0.NewHostAddr() + if err := p.NewLeader_.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewLeader_), err) + } + return nil +} + +func (p *TransLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("TransLeaderReq"); 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 *TransLeaderReq) 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 *TransLeaderReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("new_leader", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_leader: ", p), err) } + if err := p.NewLeader_.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewLeader_), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_leader: ", p), err) } + return err +} + +func (p *TransLeaderReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var newLeaderVal string + if p.NewLeader_ == nil { + newLeaderVal = "" + } else { + newLeaderVal = fmt.Sprintf("%v", p.NewLeader_) + } + return fmt.Sprintf("TransLeaderReq({SpaceID:%s PartID:%s NewLeader_:%s})", spaceIDVal, partIDVal, newLeaderVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - AsLearner +// - Peers +type AddPartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + AsLearner bool `thrift:"as_learner,3" db:"as_learner" json:"as_learner"` + Peers []*nebula0.HostAddr `thrift:"peers,4" db:"peers" json:"peers"` +} + +func NewAddPartReq() *AddPartReq { + return &AddPartReq{} +} + + +func (p *AddPartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddPartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *AddPartReq) GetAsLearner() bool { + return p.AsLearner +} + +func (p *AddPartReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *AddPartReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddPartReq) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.AsLearner = v +} + return nil +} + +func (p *AddPartReq) ReadField4(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem58 := nebula0.NewHostAddr() + if err := _elem58.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Peers = append(p.Peers, _elem58) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddPartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddPartReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddPartReq) 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 *AddPartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("as_learner", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:as_learner: ", p), err) } + if err := oprot.WriteBool(bool(p.AsLearner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.as_learner (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:as_learner: ", p), err) } + return err +} + +func (p *AddPartReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:peers: ", p), err) } + return err +} + +func (p *AddPartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + asLearnerVal := fmt.Sprintf("%v", p.AsLearner) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("AddPartReq({SpaceID:%s PartID:%s AsLearner:%s Peers:%s})", spaceIDVal, partIDVal, asLearnerVal, peersVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Learner +type AddLearnerReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Learner *nebula0.HostAddr `thrift:"learner,3" db:"learner" json:"learner"` +} + +func NewAddLearnerReq() *AddLearnerReq { + return &AddLearnerReq{ + Learner: nebula0.NewHostAddr(), + } +} + + +func (p *AddLearnerReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *AddLearnerReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var AddLearnerReq_Learner_DEFAULT *nebula0.HostAddr +func (p *AddLearnerReq) GetLearner() *nebula0.HostAddr { + if !p.IsSetLearner() { + return AddLearnerReq_Learner_DEFAULT + } +return p.Learner +} +func (p *AddLearnerReq) IsSetLearner() bool { + return p != nil && p.Learner != nil +} + +func (p *AddLearnerReq) 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 *AddLearnerReq) 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 *AddLearnerReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField3(iprot thrift.Protocol) error { + p.Learner = nebula0.NewHostAddr() + if err := p.Learner.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Learner), err) + } + return nil +} + +func (p *AddLearnerReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("AddLearnerReq"); 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 *AddLearnerReq) 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 *AddLearnerReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("learner", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:learner: ", p), err) } + if err := p.Learner.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Learner), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:learner: ", p), err) } + return err +} + +func (p *AddLearnerReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var learnerVal string + if p.Learner == nil { + learnerVal = "" + } else { + learnerVal = fmt.Sprintf("%v", p.Learner) + } + return fmt.Sprintf("AddLearnerReq({SpaceID:%s PartID:%s Learner:%s})", spaceIDVal, partIDVal, learnerVal) +} + +// Attributes: +// - SpaceID +// - PartID +type RemovePartReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` +} + +func NewRemovePartReq() *RemovePartReq { + return &RemovePartReq{} +} + + +func (p *RemovePartReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RemovePartReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +func (p *RemovePartReq) 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 *RemovePartReq) 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 *RemovePartReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *RemovePartReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RemovePartReq"); 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 *RemovePartReq) 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 *RemovePartReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *RemovePartReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + return fmt.Sprintf("RemovePartReq({SpaceID:%s PartID:%s})", spaceIDVal, partIDVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peer +// - Add +type MemberChangeReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peer *nebula0.HostAddr `thrift:"peer,3" db:"peer" json:"peer"` + Add bool `thrift:"add,4" db:"add" json:"add"` +} + +func NewMemberChangeReq() *MemberChangeReq { + return &MemberChangeReq{ + Peer: nebula0.NewHostAddr(), + } +} + + +func (p *MemberChangeReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *MemberChangeReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var MemberChangeReq_Peer_DEFAULT *nebula0.HostAddr +func (p *MemberChangeReq) GetPeer() *nebula0.HostAddr { + if !p.IsSetPeer() { + return MemberChangeReq_Peer_DEFAULT + } +return p.Peer +} + +func (p *MemberChangeReq) GetAdd() bool { + return p.Add +} +func (p *MemberChangeReq) IsSetPeer() bool { + return p != nil && p.Peer != nil +} + +func (p *MemberChangeReq) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField3(iprot thrift.Protocol) error { + p.Peer = nebula0.NewHostAddr() + if err := p.Peer.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Peer), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Add = v +} + return nil +} + +func (p *MemberChangeReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("MemberChangeReq"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MemberChangeReq) 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 *MemberChangeReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peer", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peer: ", p), err) } + if err := p.Peer.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Peer), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peer: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("add", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:add: ", p), err) } + if err := oprot.WriteBool(bool(p.Add)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.add (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:add: ", p), err) } + return err +} + +func (p *MemberChangeReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var peerVal string + if p.Peer == nil { + peerVal = "" + } else { + peerVal = fmt.Sprintf("%v", p.Peer) + } + addVal := fmt.Sprintf("%v", p.Add) + return fmt.Sprintf("MemberChangeReq({SpaceID:%s PartID:%s Peer:%s Add:%s})", spaceIDVal, partIDVal, peerVal, addVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Target +type CatchUpDataReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Target *nebula0.HostAddr `thrift:"target,3" db:"target" json:"target"` +} + +func NewCatchUpDataReq() *CatchUpDataReq { + return &CatchUpDataReq{ + Target: nebula0.NewHostAddr(), + } +} + + +func (p *CatchUpDataReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CatchUpDataReq) GetPartID() nebula0.PartitionID { + return p.PartID +} +var CatchUpDataReq_Target_DEFAULT *nebula0.HostAddr +func (p *CatchUpDataReq) GetTarget() *nebula0.HostAddr { + if !p.IsSetTarget() { + return CatchUpDataReq_Target_DEFAULT + } +return p.Target +} +func (p *CatchUpDataReq) IsSetTarget() bool { + return p != nil && p.Target != nil +} + +func (p *CatchUpDataReq) 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 *CatchUpDataReq) 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 *CatchUpDataReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField3(iprot thrift.Protocol) error { + p.Target = nebula0.NewHostAddr() + if err := p.Target.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *CatchUpDataReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CatchUpDataReq"); 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 *CatchUpDataReq) 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 *CatchUpDataReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("target", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:target: ", p), err) } + if err := p.Target.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target: ", p), err) } + return err +} + +func (p *CatchUpDataReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + var targetVal string + if p.Target == nil { + targetVal = "" + } else { + targetVal = fmt.Sprintf("%v", p.Target) + } + return fmt.Sprintf("CatchUpDataReq({SpaceID:%s PartID:%s Target:%s})", spaceIDVal, partIDVal, targetVal) +} + +type GetLeaderReq struct { +} + +func NewGetLeaderReq() *GetLeaderReq { + return &GetLeaderReq{} +} + +func (p *GetLeaderReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("GetLeaderReq({})") +} + +// Attributes: +// - SpaceID +// - Name +type CreateCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewCreateCPRequest() *CreateCPRequest { + return &CreateCPRequest{} +} + + +func (p *CreateCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CreateCPRequest) GetName() []byte { + return p.Name +} +func (p *CreateCPRequest) 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 *CreateCPRequest) 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 *CreateCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *CreateCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPRequest"); 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 *CreateCPRequest) 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 *CreateCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *CreateCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("CreateCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Name +type DropCPRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewDropCPRequest() *DropCPRequest { + return &DropCPRequest{} +} + + +func (p *DropCPRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *DropCPRequest) GetName() []byte { + return p.Name +} +func (p *DropCPRequest) 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 *DropCPRequest) 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 *DropCPRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *DropCPRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DropCPRequest"); 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 *DropCPRequest) 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 *DropCPRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *DropCPRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + nameVal := fmt.Sprintf("%v", p.Name) + return fmt.Sprintf("DropCPRequest({SpaceID:%s Name:%s})", spaceIDVal, nameVal) +} + +// Attributes: +// - SpaceID +// - Sign +type BlockingSignRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` +} + +func NewBlockingSignRequest() *BlockingSignRequest { + return &BlockingSignRequest{} +} + + +func (p *BlockingSignRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *BlockingSignRequest) GetSign() EngineSignType { + return p.Sign +} +func (p *BlockingSignRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSign 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 + } + case 2: + if err := p.ReadField2(iprot); err != nil { + return err + } + issetSign = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetSign{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Sign is not set")); + } + return nil +} + +func (p *BlockingSignRequest) 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 *BlockingSignRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EngineSignType(v) + p.Sign = temp +} + return nil +} + +func (p *BlockingSignRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("BlockingSignRequest"); 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 *BlockingSignRequest) 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 *BlockingSignRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sign", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sign: ", p), err) } + if err := oprot.WriteI32(int32(p.Sign)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sign (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sign: ", p), err) } + return err +} + +func (p *BlockingSignRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + signVal := fmt.Sprintf("%v", p.Sign) + return fmt.Sprintf("BlockingSignRequest({SpaceID:%s Sign:%s})", spaceIDVal, signVal) +} + +// Attributes: +// - Result_ +// - LeaderParts +type GetLeaderPartsResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + LeaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` +} + +func NewGetLeaderPartsResp() *GetLeaderPartsResp { + return &GetLeaderPartsResp{ + Result_: NewResponseCommon(), + } +} + +var GetLeaderPartsResp_Result__DEFAULT *ResponseCommon +func (p *GetLeaderPartsResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetLeaderPartsResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula0.GraphSpaceID][]nebula0.PartitionID { + return p.LeaderParts +} +func (p *GetLeaderPartsResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *GetLeaderPartsResp) 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.GraphSpaceID][]nebula0.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key59 nebula0.GraphSpaceID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + _key59 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + _val60 := tSlice + for i := 0; i < size; i ++ { +var _elem61 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem61 = temp +} + _val60 = append(_val60, _elem61) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key59] = _val60 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetLeaderPartsResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("GetLeaderPartsResp"); 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 *GetLeaderPartsResp) 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 *GetLeaderPartsResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("leader_parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.LeaderParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.LeaderParts { + 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.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader_parts: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) + return fmt.Sprintf("GetLeaderPartsResp({Result_:%s LeaderParts:%s})", resultVal, leaderPartsVal) +} + +// Attributes: +// - SpaceID +// - PartID +// - Peers +type CheckPeersReq struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula0.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peers []*nebula0.HostAddr `thrift:"peers,3" db:"peers" json:"peers"` +} + +func NewCheckPeersReq() *CheckPeersReq { + return &CheckPeersReq{} +} + + +func (p *CheckPeersReq) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *CheckPeersReq) GetPartID() nebula0.PartitionID { + return p.PartID +} + +func (p *CheckPeersReq) GetPeers() []*nebula0.HostAddr { + return p.Peers +} +func (p *CheckPeersReq) 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 *CheckPeersReq) 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 *CheckPeersReq) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula0.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField3(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.Peers = tSlice + for i := 0; i < size; i ++ { + _elem62 := nebula0.NewHostAddr() + if err := _elem62.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Peers = append(p.Peers, _elem62) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckPeersReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckPeersReq"); 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 *CheckPeersReq) 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 *CheckPeersReq) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("part_id", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:part_id: ", p), err) } + if err := oprot.WriteI32(int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *CheckPeersReq) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partIDVal := fmt.Sprintf("%v", p.PartID) + peersVal := fmt.Sprintf("%v", p.Peers) + return fmt.Sprintf("CheckPeersReq({SpaceID:%s PartID:%s Peers:%s})", spaceIDVal, partIDVal, peersVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - IndexID +type RebuildIndexRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,2" db:"parts" json:"parts"` + IndexID nebula0.IndexID `thrift:"index_id,3" db:"index_id" json:"index_id"` +} + +func NewRebuildIndexRequest() *RebuildIndexRequest { + return &RebuildIndexRequest{} +} + + +func (p *RebuildIndexRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} + +func (p *RebuildIndexRequest) GetIndexID() nebula0.IndexID { + return p.IndexID +} +func (p *RebuildIndexRequest) 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem63 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem63 = temp +} + p.Parts = append(p.Parts, _elem63) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula0.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *RebuildIndexRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("RebuildIndexRequest"); 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 *RebuildIndexRequest) 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 *RebuildIndexRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("index_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_id: ", p), err) } + if err := oprot.WriteI32(int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + indexIDVal := fmt.Sprintf("%v", p.IndexID) + return fmt.Sprintf("RebuildIndexRequest({SpaceID:%s Parts:%s IndexID:%s})", spaceIDVal, partsVal, indexIDVal) +} + +// Attributes: +// - Result_ +// - Info +type CreateCPResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewCreateCPResp() *CreateCPResp { + return &CreateCPResp{ + Result_: NewResponseCommon(), + } +} + +var CreateCPResp_Result__DEFAULT *ResponseCommon +func (p *CreateCPResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return CreateCPResp_Result__DEFAULT + } +return p.Result_ +} + +func (p *CreateCPResp) GetInfo() []*nebula0.CheckpointInfo { + return p.Info +} +func (p *CreateCPResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *CreateCPResp) 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 *CreateCPResp) 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 *CreateCPResp) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem64 := nebula0.NewCheckpointInfo() + if err := _elem64.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.Info = append(p.Info, _elem64) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateCPResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CreateCPResp"); 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 *CreateCPResp) 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 *CreateCPResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + 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:info: ", p), err) } + return err +} + +func (p *CreateCPResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("CreateCPResp({Result_:%s Info:%s})", resultVal, infoVal) +} + +// Attributes: +// - Result_ +// - Dir +type ListClusterInfoResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Dir *nebula0.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{ + Result_: NewResponseCommon(), + Dir: nebula0.NewDirInfo(), + } +} + +var ListClusterInfoResp_Result__DEFAULT *ResponseCommon +func (p *ListClusterInfoResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ListClusterInfoResp_Result__DEFAULT + } +return p.Result_ +} +var ListClusterInfoResp_Dir_DEFAULT *nebula0.DirInfo +func (p *ListClusterInfoResp) GetDir() *nebula0.DirInfo { + if !p.IsSetDir() { + return ListClusterInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *ListClusterInfoResp) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *ListClusterInfoResp) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *ListClusterInfoResp) 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) ReadField2(iprot thrift.Protocol) error { + p.Dir = nebula0.NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoResp"); 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 *ListClusterInfoResp) 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 *ListClusterInfoResp) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("ListClusterInfoResp({Result_:%s Dir:%s})", resultVal, dirVal) +} + +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) 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; } + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + + return fmt.Sprintf("ListClusterInfoReq({})") +} + +// Attributes: +// - SpaceID +// - Parts +// - ReturnPartly +type KVGetRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` + ReturnPartly bool `thrift:"return_partly,3" db:"return_partly" json:"return_partly"` +} + +func NewKVGetRequest() *KVGetRequest { + return &KVGetRequest{} +} + + +func (p *KVGetRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVGetRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} + +func (p *KVGetRequest) GetReturnPartly() bool { + return p.ReturnPartly +} +func (p *KVGetRequest) 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 *KVGetRequest) 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 *KVGetRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key65 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key65 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val66 := tSlice + for i := 0; i < size; i ++ { +var _elem67 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem67 = v +} + _val66 = append(_val66, _elem67) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key65] = _val66 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReturnPartly = v +} + return nil +} + +func (p *KVGetRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetRequest"); 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 *KVGetRequest) 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 *KVGetRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("return_partly", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_partly: ", p), err) } + if err := oprot.WriteBool(bool(p.ReturnPartly)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_partly (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_partly: ", p), err) } + return err +} + +func (p *KVGetRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + returnPartlyVal := fmt.Sprintf("%v", p.ReturnPartly) + return fmt.Sprintf("KVGetRequest({SpaceID:%s Parts:%s ReturnPartly:%s})", spaceIDVal, partsVal, returnPartlyVal) +} + +// Attributes: +// - Result_ +// - KeyValues +type KVGetResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + KeyValues map[string][]byte `thrift:"key_values,2" db:"key_values" json:"key_values"` +} + +func NewKVGetResponse() *KVGetResponse { + return &KVGetResponse{ + Result_: NewResponseCommon(), + } +} + +var KVGetResponse_Result__DEFAULT *ResponseCommon +func (p *KVGetResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return KVGetResponse_Result__DEFAULT + } +return p.Result_ +} + +func (p *KVGetResponse) GetKeyValues() map[string][]byte { + return p.KeyValues +} +func (p *KVGetResponse) IsSetResult_() bool { + return p != nil && p.Result_ != nil +} + +func (p *KVGetResponse) 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 *KVGetResponse) 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 *KVGetResponse) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]byte, size) + p.KeyValues = tMap + for i := 0; i < size; i ++ { +var _key68 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key68 = v +} +var _val69 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val69 = v +} + p.KeyValues[_key68] = _val69 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetResponse) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVGetResponse"); 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 *KVGetResponse) 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 *KVGetResponse) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key_values", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:key_values: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.KeyValues)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.KeyValues { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key_values: ", p), err) } + return err +} + +func (p *KVGetResponse) String() string { + if p == nil { + return "" + } + + var resultVal string + if p.Result_ == nil { + resultVal = "" + } else { + resultVal = fmt.Sprintf("%v", p.Result_) + } + keyValuesVal := fmt.Sprintf("%v", p.KeyValues) + return fmt.Sprintf("KVGetResponse({Result_:%s KeyValues:%s})", resultVal, keyValuesVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVPutRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*nebula0.KeyValue `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVPutRequest() *KVPutRequest { + return &KVPutRequest{} +} + + +func (p *KVPutRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVPutRequest) GetParts() map[nebula0.PartitionID][]*nebula0.KeyValue { + return p.Parts +} +func (p *KVPutRequest) 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 *KVPutRequest) 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 *KVPutRequest) 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.KeyValue, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key70 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key70 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula0.KeyValue, 0, size) + _val71 := tSlice + for i := 0; i < size; i ++ { + _elem72 := nebula0.NewKeyValue() + if err := _elem72.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) + } + _val71 = append(_val71, _elem72) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key70] = _val71 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVPutRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVPutRequest"); 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 *KVPutRequest) 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 *KVPutRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *KVPutRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVPutRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - SpaceID +// - Parts +type KVRemoveRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVRemoveRequest() *KVRemoveRequest { + return &KVRemoveRequest{} +} + + +func (p *KVRemoveRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *KVRemoveRequest) GetParts() map[nebula0.PartitionID][][]byte { + return p.Parts +} +func (p *KVRemoveRequest) 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key73 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key73 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val74 := tSlice + for i := 0; i < size; i ++ { +var _elem75 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem75 = v +} + _val74 = append(_val74, _elem75) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key73] = _val74 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVRemoveRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KVRemoveRequest"); 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 *KVRemoveRequest) 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 *KVRemoveRequest) 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) + } + 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.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVRemoveRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("KVRemoveRequest({SpaceID:%s Parts:%s})", spaceIDVal, partsVal) +} + +// Attributes: +// - TxnID +// - TermOfParts +// - AddEdgeReq +// - UpdEdgeReq +// - EdgeVer +type InternalTxnRequest struct { + TxnID int64 `thrift:"txn_id,1" db:"txn_id" json:"txn_id"` + TermOfParts map[nebula0.PartitionID]int64 `thrift:"term_of_parts,2" db:"term_of_parts" json:"term_of_parts"` + AddEdgeReq *AddEdgesRequest `thrift:"add_edge_req,3" db:"add_edge_req" json:"add_edge_req,omitempty"` + UpdEdgeReq *UpdateEdgeRequest `thrift:"upd_edge_req,4" db:"upd_edge_req" json:"upd_edge_req,omitempty"` + EdgeVer map[nebula0.PartitionID][]int64 `thrift:"edge_ver,5" db:"edge_ver" json:"edge_ver,omitempty"` +} + +func NewInternalTxnRequest() *InternalTxnRequest { + return &InternalTxnRequest{} +} + + +func (p *InternalTxnRequest) GetTxnID() int64 { + return p.TxnID +} + +func (p *InternalTxnRequest) GetTermOfParts() map[nebula0.PartitionID]int64 { + return p.TermOfParts +} +var InternalTxnRequest_AddEdgeReq_DEFAULT *AddEdgesRequest +func (p *InternalTxnRequest) GetAddEdgeReq() *AddEdgesRequest { + if !p.IsSetAddEdgeReq() { + return InternalTxnRequest_AddEdgeReq_DEFAULT + } +return p.AddEdgeReq +} +var InternalTxnRequest_UpdEdgeReq_DEFAULT *UpdateEdgeRequest +func (p *InternalTxnRequest) GetUpdEdgeReq() *UpdateEdgeRequest { + if !p.IsSetUpdEdgeReq() { + return InternalTxnRequest_UpdEdgeReq_DEFAULT + } +return p.UpdEdgeReq +} +var InternalTxnRequest_EdgeVer_DEFAULT map[nebula0.PartitionID][]int64 + +func (p *InternalTxnRequest) GetEdgeVer() map[nebula0.PartitionID][]int64 { + return p.EdgeVer +} +func (p *InternalTxnRequest) IsSetAddEdgeReq() bool { + return p != nil && p.AddEdgeReq != nil +} + +func (p *InternalTxnRequest) IsSetUpdEdgeReq() bool { + return p != nil && p.UpdEdgeReq != nil +} + +func (p *InternalTxnRequest) IsSetEdgeVer() bool { + return p != nil && p.EdgeVer != nil +} + +func (p *InternalTxnRequest) 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 + } + 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 *InternalTxnRequest) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TxnID = v +} + return nil +} + +func (p *InternalTxnRequest) 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]int64, size) + p.TermOfParts = tMap + for i := 0; i < size; i ++ { +var _key76 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key76 = temp +} +var _val77 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val77 = v +} + p.TermOfParts[_key76] = _val77 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *InternalTxnRequest) ReadField3(iprot thrift.Protocol) error { + p.AddEdgeReq = NewAddEdgesRequest() + if err := p.AddEdgeReq.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.AddEdgeReq), err) + } + return nil +} + +func (p *InternalTxnRequest) ReadField4(iprot thrift.Protocol) error { + p.UpdEdgeReq = NewUpdateEdgeRequest() + if err := p.UpdEdgeReq.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UpdEdgeReq), err) + } + return nil +} + +func (p *InternalTxnRequest) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula0.PartitionID][]int64, size) + p.EdgeVer = tMap + for i := 0; i < size; i ++ { +var _key78 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key78 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + _val79 := tSlice + for i := 0; i < size; i ++ { +var _elem80 int64 + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem80 = v +} + _val79 = append(_val79, _elem80) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.EdgeVer[_key78] = _val79 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *InternalTxnRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("InternalTxnRequest"); 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 *InternalTxnRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("txn_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:txn_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TxnID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.txn_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:txn_id: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term_of_parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term_of_parts: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.I64, len(p.TermOfParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.TermOfParts { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_of_parts: ", p), err) } + return err +} + +func (p *InternalTxnRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetAddEdgeReq() { + if err := oprot.WriteFieldBegin("add_edge_req", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:add_edge_req: ", p), err) } + if err := p.AddEdgeReq.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.AddEdgeReq), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:add_edge_req: ", p), err) } + } + return err +} + +func (p *InternalTxnRequest) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetUpdEdgeReq() { + if err := oprot.WriteFieldBegin("upd_edge_req", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:upd_edge_req: ", p), err) } + if err := p.UpdEdgeReq.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UpdEdgeReq), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:upd_edge_req: ", p), err) } + } + return err +} + +func (p *InternalTxnRequest) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeVer() { + if err := oprot.WriteFieldBegin("edge_ver", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:edge_ver: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.EdgeVer)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.EdgeVer { + 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.I64, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteI64(int64(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.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:edge_ver: ", p), err) } + } + return err +} + +func (p *InternalTxnRequest) String() string { + if p == nil { + return "" + } + + txnIDVal := fmt.Sprintf("%v", p.TxnID) + termOfPartsVal := fmt.Sprintf("%v", p.TermOfParts) + var addEdgeReqVal string + if p.AddEdgeReq == nil { + addEdgeReqVal = "" + } else { + addEdgeReqVal = fmt.Sprintf("%v", p.AddEdgeReq) + } + var updEdgeReqVal string + if p.UpdEdgeReq == nil { + updEdgeReqVal = "" + } else { + updEdgeReqVal = fmt.Sprintf("%v", p.UpdEdgeReq) + } + edgeVerVal := fmt.Sprintf("%v", p.EdgeVer) + return fmt.Sprintf("InternalTxnRequest({TxnID:%s TermOfParts:%s AddEdgeReq:%s UpdEdgeReq:%s EdgeVer:%s})", txnIDVal, termOfPartsVal, addEdgeReqVal, updEdgeReqVal, edgeVerVal) +} + +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - Term +// - EdgeVersion +type ChainAddEdgesRequest struct { + SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` + IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` + Term int64 `thrift:"term,5" db:"term" json:"term"` + EdgeVersion *int64 `thrift:"edge_version,6" db:"edge_version" json:"edge_version,omitempty"` +} + +func NewChainAddEdgesRequest() *ChainAddEdgesRequest { + return &ChainAddEdgesRequest{} +} + + +func (p *ChainAddEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ChainAddEdgesRequest) GetParts() map[nebula0.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *ChainAddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *ChainAddEdgesRequest) GetIfNotExists() bool { + return p.IfNotExists +} + +func (p *ChainAddEdgesRequest) GetTerm() int64 { + return p.Term +} +var ChainAddEdgesRequest_EdgeVersion_DEFAULT int64 +func (p *ChainAddEdgesRequest) GetEdgeVersion() int64 { + if !p.IsSetEdgeVersion() { + return ChainAddEdgesRequest_EdgeVersion_DEFAULT + } +return *p.EdgeVersion +} +func (p *ChainAddEdgesRequest) IsSetEdgeVersion() bool { + return p != nil && p.EdgeVersion != nil +} + +func (p *ChainAddEdgesRequest) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ChainAddEdgesRequest) 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 *ChainAddEdgesRequest) 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][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key81 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _key81 = temp +} + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val82 := tSlice + for i := 0; i < size; i ++ { + _elem83 := NewNewEdge_() + if err := _elem83.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) + } + _val82 = append(_val82, _elem83) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key81] = _val82 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ChainAddEdgesRequest) ReadField3(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.PropNames = tSlice + for i := 0; i < size; i ++ { +var _elem84 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem84 = v +} + p.PropNames = append(p.PropNames, _elem84) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ChainAddEdgesRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *ChainAddEdgesRequest) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *ChainAddEdgesRequest) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.EdgeVersion = &v +} + return nil +} + +func (p *ChainAddEdgesRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChainAddEdgesRequest"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ChainAddEdgesRequest) 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 *ChainAddEdgesRequest) 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) + } + 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 2:parts: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("prop_names", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:prop_names: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("if_not_exists", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:if_not_exists: ", p), err) } + if err := oprot.WriteBool(bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:term: ", p), err) } + if err := oprot.WriteI64(int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:term: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeVersion() { + if err := oprot.WriteFieldBegin("edge_version", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:edge_version: ", p), err) } + if err := oprot.WriteI64(int64(*p.EdgeVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_version (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_version: ", p), err) } + } + return err +} + +func (p *ChainAddEdgesRequest) String() string { + if p == nil { + return "" + } + + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + propNamesVal := fmt.Sprintf("%v", p.PropNames) + ifNotExistsVal := fmt.Sprintf("%v", p.IfNotExists) + termVal := fmt.Sprintf("%v", p.Term) + var edgeVersionVal string + if p.EdgeVersion == nil { + edgeVersionVal = "" + } else { + edgeVersionVal = fmt.Sprintf("%v", *p.EdgeVersion) + } + return fmt.Sprintf("ChainAddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s Term:%s EdgeVersion:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, termVal, edgeVersionVal) +} + +// Attributes: +// - UpdateEdgeRequest +// - Term +// - EdgeVersion +// - SpaceID +// - Parts +type ChainUpdateEdgeRequest struct { + UpdateEdgeRequest *UpdateEdgeRequest `thrift:"update_edge_request,1" db:"update_edge_request" json:"update_edge_request"` + Term int64 `thrift:"term,2" db:"term" json:"term"` + EdgeVersion *int64 `thrift:"edge_version,3" db:"edge_version" json:"edge_version,omitempty"` + SpaceID nebula0.GraphSpaceID `thrift:"space_id,4" db:"space_id" json:"space_id"` + Parts []nebula0.PartitionID `thrift:"parts,5,required" db:"parts" json:"parts"` +} + +func NewChainUpdateEdgeRequest() *ChainUpdateEdgeRequest { + return &ChainUpdateEdgeRequest{ + UpdateEdgeRequest: NewUpdateEdgeRequest(), + } +} + +var ChainUpdateEdgeRequest_UpdateEdgeRequest_DEFAULT *UpdateEdgeRequest +func (p *ChainUpdateEdgeRequest) GetUpdateEdgeRequest() *UpdateEdgeRequest { + if !p.IsSetUpdateEdgeRequest() { + return ChainUpdateEdgeRequest_UpdateEdgeRequest_DEFAULT + } +return p.UpdateEdgeRequest +} + +func (p *ChainUpdateEdgeRequest) GetTerm() int64 { + return p.Term +} +var ChainUpdateEdgeRequest_EdgeVersion_DEFAULT int64 +func (p *ChainUpdateEdgeRequest) GetEdgeVersion() int64 { + if !p.IsSetEdgeVersion() { + return ChainUpdateEdgeRequest_EdgeVersion_DEFAULT + } +return *p.EdgeVersion +} + +func (p *ChainUpdateEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { + return p.SpaceID +} + +func (p *ChainUpdateEdgeRequest) GetParts() []nebula0.PartitionID { + return p.Parts +} +func (p *ChainUpdateEdgeRequest) IsSetUpdateEdgeRequest() bool { + return p != nil && p.UpdateEdgeRequest != nil +} + +func (p *ChainUpdateEdgeRequest) IsSetEdgeVersion() bool { + return p != nil && p.EdgeVersion != nil +} + +func (p *ChainUpdateEdgeRequest) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetParts 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 + } + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + issetParts = true + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := 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 !issetParts{ + return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField1(iprot thrift.Protocol) error { + p.UpdateEdgeRequest = NewUpdateEdgeRequest() + if err := p.UpdateEdgeRequest.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UpdateEdgeRequest), err) + } + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.EdgeVersion = &v +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula0.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField5(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula0.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem85 nebula0.PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula0.PartitionID(v) + _elem85 = temp +} + p.Parts = append(p.Parts, _elem85) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ChainUpdateEdgeRequest) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("ChainUpdateEdgeRequest"); 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 *ChainUpdateEdgeRequest) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("update_edge_request", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:update_edge_request: ", p), err) } + if err := p.UpdateEdgeRequest.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UpdateEdgeRequest), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:update_edge_request: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) } + if err := oprot.WriteI64(int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeVersion() { + if err := oprot.WriteFieldBegin("edge_version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_version: ", p), err) } + if err := oprot.WriteI64(int64(*p.EdgeVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_version: ", p), err) } + } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("space_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:space_id: ", p), err) } + if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_id: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("parts", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:parts: ", p), err) } + if err := oprot.WriteListBegin(thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + 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 5:parts: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) String() string { + if p == nil { + return "" + } + + var updateEdgeRequestVal string + if p.UpdateEdgeRequest == nil { + updateEdgeRequestVal = "" + } else { + updateEdgeRequestVal = fmt.Sprintf("%v", p.UpdateEdgeRequest) + } + termVal := fmt.Sprintf("%v", p.Term) + var edgeVersionVal string + if p.EdgeVersion == nil { + edgeVersionVal = "" + } else { + edgeVersionVal = fmt.Sprintf("%v", *p.EdgeVersion) + } + spaceIDVal := fmt.Sprintf("%v", p.SpaceID) + partsVal := fmt.Sprintf("%v", p.Parts) + return fmt.Sprintf("ChainUpdateEdgeRequest({UpdateEdgeRequest:%s Term:%s EdgeVersion:%s SpaceID:%s Parts:%s})", updateEdgeRequestVal, termVal, edgeVersionVal, spaceIDVal, partsVal) +} + diff --git a/ccore/nebula/internal/thrift/v2_6_0/ttypes.go b/ccore/nebula/internal/thrift/v2_6_0/ttypes.go new file mode 100644 index 0000000..4ee74bc --- /dev/null +++ b/ccore/nebula/internal/thrift/v2_6_0/ttypes.go @@ -0,0 +1,5480 @@ +// Autogenerated by Thrift Compiler (facebook) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// @generated + +package nebula + +import ( + "bytes" + "context" + "sync" + "fmt" + thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = sync.Mutex{} +var _ = bytes.Equal +var _ = context.Background + +var GoUnusedProtection__ int; + +type NullType int64 +const ( + NullType___NULL__ NullType = 0 + NullType_NaN NullType = 1 + NullType_BAD_DATA NullType = 2 + NullType_BAD_TYPE NullType = 3 + NullType_ERR_OVERFLOW NullType = 4 + NullType_UNKNOWN_PROP NullType = 5 + NullType_DIV_BY_ZERO NullType = 6 + NullType_OUT_OF_RANGE NullType = 7 +) + +var NullTypeToName = map[NullType]string { + NullType___NULL__: "__NULL__", + NullType_NaN: "NaN", + NullType_BAD_DATA: "BAD_DATA", + NullType_BAD_TYPE: "BAD_TYPE", + NullType_ERR_OVERFLOW: "ERR_OVERFLOW", + NullType_UNKNOWN_PROP: "UNKNOWN_PROP", + NullType_DIV_BY_ZERO: "DIV_BY_ZERO", + NullType_OUT_OF_RANGE: "OUT_OF_RANGE", +} + +var NullTypeToValue = map[string]NullType { + "__NULL__": NullType___NULL__, + "NaN": NullType_NaN, + "BAD_DATA": NullType_BAD_DATA, + "BAD_TYPE": NullType_BAD_TYPE, + "ERR_OVERFLOW": NullType_ERR_OVERFLOW, + "UNKNOWN_PROP": NullType_UNKNOWN_PROP, + "DIV_BY_ZERO": NullType_DIV_BY_ZERO, + "OUT_OF_RANGE": NullType_OUT_OF_RANGE, +} + +var NullTypeNames = []string { + "__NULL__", + "NaN", + "BAD_DATA", + "BAD_TYPE", + "ERR_OVERFLOW", + "UNKNOWN_PROP", + "DIV_BY_ZERO", + "OUT_OF_RANGE", +} + +var NullTypeValues = []NullType { + NullType___NULL__, + NullType_NaN, + NullType_BAD_DATA, + NullType_BAD_TYPE, + NullType_ERR_OVERFLOW, + NullType_UNKNOWN_PROP, + NullType_DIV_BY_ZERO, + NullType_OUT_OF_RANGE, +} + +func (p NullType) String() string { + if v, ok := NullTypeToName[p]; ok { + return v + } + return "" +} + +func NullTypeFromString(s string) (NullType, error) { + if v, ok := NullTypeToValue[s]; ok { + return v, nil + } + return NullType(0), fmt.Errorf("not a valid NullType string") +} + +func NullTypePtr(v NullType) *NullType { return &v } + +type ErrorCode int64 +const ( + ErrorCode_SUCCEEDED ErrorCode = 0 + ErrorCode_E_DISCONNECTED ErrorCode = -1 + ErrorCode_E_FAIL_TO_CONNECT ErrorCode = -2 + ErrorCode_E_RPC_FAILURE ErrorCode = -3 + ErrorCode_E_LEADER_CHANGED ErrorCode = -4 + ErrorCode_E_SPACE_NOT_FOUND ErrorCode = -5 + ErrorCode_E_TAG_NOT_FOUND ErrorCode = -6 + ErrorCode_E_EDGE_NOT_FOUND ErrorCode = -7 + ErrorCode_E_INDEX_NOT_FOUND ErrorCode = -8 + ErrorCode_E_EDGE_PROP_NOT_FOUND ErrorCode = -9 + ErrorCode_E_TAG_PROP_NOT_FOUND ErrorCode = -10 + ErrorCode_E_ROLE_NOT_FOUND ErrorCode = -11 + ErrorCode_E_CONFIG_NOT_FOUND ErrorCode = -12 + ErrorCode_E_GROUP_NOT_FOUND ErrorCode = -13 + ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 + ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 + ErrorCode_E_STATS_NOT_FOUND ErrorCode = -19 + ErrorCode_E_BACKUP_FAILED ErrorCode = -24 + ErrorCode_E_BACKUP_EMPTY_TABLE ErrorCode = -25 + ErrorCode_E_BACKUP_TABLE_FAILED ErrorCode = -26 + ErrorCode_E_PARTIAL_RESULT ErrorCode = -27 + ErrorCode_E_REBUILD_INDEX_FAILED ErrorCode = -28 + ErrorCode_E_INVALID_PASSWORD ErrorCode = -29 + ErrorCode_E_FAILED_GET_ABS_PATH ErrorCode = -30 + ErrorCode_E_BAD_USERNAME_PASSWORD ErrorCode = -1001 + ErrorCode_E_SESSION_INVALID ErrorCode = -1002 + ErrorCode_E_SESSION_TIMEOUT ErrorCode = -1003 + ErrorCode_E_SYNTAX_ERROR ErrorCode = -1004 + ErrorCode_E_EXECUTION_ERROR ErrorCode = -1005 + ErrorCode_E_STATEMENT_EMPTY ErrorCode = -1006 + ErrorCode_E_BAD_PERMISSION ErrorCode = -1008 + ErrorCode_E_SEMANTIC_ERROR ErrorCode = -1009 + ErrorCode_E_TOO_MANY_CONNECTIONS ErrorCode = -1010 + ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = -1011 + ErrorCode_E_NO_HOSTS ErrorCode = -2001 + ErrorCode_E_EXISTED ErrorCode = -2002 + ErrorCode_E_INVALID_HOST ErrorCode = -2003 + ErrorCode_E_UNSUPPORTED ErrorCode = -2004 + ErrorCode_E_NOT_DROP ErrorCode = -2005 + ErrorCode_E_BALANCER_RUNNING ErrorCode = -2006 + ErrorCode_E_CONFIG_IMMUTABLE ErrorCode = -2007 + ErrorCode_E_CONFLICT ErrorCode = -2008 + ErrorCode_E_INVALID_PARM ErrorCode = -2009 + ErrorCode_E_WRONGCLUSTER ErrorCode = -2010 + ErrorCode_E_STORE_FAILURE ErrorCode = -2021 + ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 + ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 + ErrorCode_E_BALANCED ErrorCode = -2024 + ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -2025 + ErrorCode_E_NO_VALID_HOST ErrorCode = -2026 + ErrorCode_E_CORRUPTTED_BALANCE_PLAN ErrorCode = -2027 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -2028 + ErrorCode_E_IMPROPER_ROLE ErrorCode = -2030 + ErrorCode_E_INVALID_PARTITION_NUM ErrorCode = -2031 + ErrorCode_E_INVALID_REPLICA_FACTOR ErrorCode = -2032 + ErrorCode_E_INVALID_CHARSET ErrorCode = -2033 + ErrorCode_E_INVALID_COLLATE ErrorCode = -2034 + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH ErrorCode = -2035 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -2040 + ErrorCode_E_BLOCK_WRITE_FAILURE ErrorCode = -2041 + ErrorCode_E_REBUILD_INDEX_FAILURE ErrorCode = -2042 + ErrorCode_E_INDEX_WITH_TTL ErrorCode = -2043 + ErrorCode_E_ADD_JOB_FAILURE ErrorCode = -2044 + ErrorCode_E_STOP_JOB_FAILURE ErrorCode = -2045 + ErrorCode_E_SAVE_JOB_FAILURE ErrorCode = -2046 + ErrorCode_E_BALANCER_FAILURE ErrorCode = -2047 + ErrorCode_E_JOB_NOT_FINISHED ErrorCode = -2048 + ErrorCode_E_TASK_REPORT_OUT_DATE ErrorCode = -2049 + ErrorCode_E_JOB_NOT_IN_SPACE ErrorCode = -2050 + ErrorCode_E_INVALID_JOB ErrorCode = -2065 + ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 + ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 + ErrorCode_E_RESTORE_FAILURE ErrorCode = -2068 + ErrorCode_E_SESSION_NOT_FOUND ErrorCode = -2069 + ErrorCode_E_LIST_CLUSTER_FAILURE ErrorCode = -2070 + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE ErrorCode = -2071 + ErrorCode_E_GET_META_DIR_FAILURE ErrorCode = -2072 + ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 + ErrorCode_E_CONSENSUS_ERROR ErrorCode = -3001 + ErrorCode_E_KEY_HAS_EXISTS ErrorCode = -3002 + ErrorCode_E_DATA_TYPE_MISMATCH ErrorCode = -3003 + ErrorCode_E_INVALID_FIELD_VALUE ErrorCode = -3004 + ErrorCode_E_INVALID_OPERATION ErrorCode = -3005 + ErrorCode_E_NOT_NULLABLE ErrorCode = -3006 + ErrorCode_E_FIELD_UNSET ErrorCode = -3007 + ErrorCode_E_OUT_OF_RANGE ErrorCode = -3008 + ErrorCode_E_ATOMIC_OP_FAILED ErrorCode = -3009 + ErrorCode_E_DATA_CONFLICT_ERROR ErrorCode = -3010 + ErrorCode_E_WRITE_STALLED ErrorCode = -3011 + ErrorCode_E_IMPROPER_DATA_TYPE ErrorCode = -3021 + ErrorCode_E_INVALID_SPACEVIDLEN ErrorCode = -3022 + ErrorCode_E_INVALID_FILTER ErrorCode = -3031 + ErrorCode_E_INVALID_UPDATER ErrorCode = -3032 + ErrorCode_E_INVALID_STORE ErrorCode = -3033 + ErrorCode_E_INVALID_PEER ErrorCode = -3034 + ErrorCode_E_RETRY_EXHAUSTED ErrorCode = -3035 + ErrorCode_E_TRANSFER_LEADER_FAILED ErrorCode = -3036 + ErrorCode_E_INVALID_STAT_TYPE ErrorCode = -3037 + ErrorCode_E_INVALID_VID ErrorCode = -3038 + ErrorCode_E_NO_TRANSFORMED ErrorCode = -3039 + ErrorCode_E_LOAD_META_FAILED ErrorCode = -3040 + ErrorCode_E_FAILED_TO_CHECKPOINT ErrorCode = -3041 + ErrorCode_E_CHECKPOINT_BLOCKED ErrorCode = -3042 + ErrorCode_E_FILTER_OUT ErrorCode = -3043 + ErrorCode_E_INVALID_DATA ErrorCode = -3044 + ErrorCode_E_MUTATE_EDGE_CONFLICT ErrorCode = -3045 + ErrorCode_E_MUTATE_TAG_CONFLICT ErrorCode = -3046 + ErrorCode_E_OUTDATED_LOCK ErrorCode = -3047 + ErrorCode_E_INVALID_TASK_PARA ErrorCode = -3051 + ErrorCode_E_USER_CANCEL ErrorCode = -3052 + ErrorCode_E_TASK_EXECUTION_FAILED ErrorCode = -3053 + ErrorCode_E_PLAN_IS_KILLED ErrorCode = -3060 + ErrorCode_E_NO_TERM ErrorCode = -3070 + ErrorCode_E_OUTDATED_TERM ErrorCode = -3071 + ErrorCode_E_OUTDATED_EDGE ErrorCode = -3072 + ErrorCode_E_WRITE_WRITE_CONFLICT ErrorCode = -3073 + ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE ErrorCode = -3061 + ErrorCode_E_UNKNOWN ErrorCode = -8000 +) + +var ErrorCodeToName = map[ErrorCode]string { + ErrorCode_SUCCEEDED: "SUCCEEDED", + ErrorCode_E_DISCONNECTED: "E_DISCONNECTED", + ErrorCode_E_FAIL_TO_CONNECT: "E_FAIL_TO_CONNECT", + ErrorCode_E_RPC_FAILURE: "E_RPC_FAILURE", + ErrorCode_E_LEADER_CHANGED: "E_LEADER_CHANGED", + ErrorCode_E_SPACE_NOT_FOUND: "E_SPACE_NOT_FOUND", + ErrorCode_E_TAG_NOT_FOUND: "E_TAG_NOT_FOUND", + ErrorCode_E_EDGE_NOT_FOUND: "E_EDGE_NOT_FOUND", + ErrorCode_E_INDEX_NOT_FOUND: "E_INDEX_NOT_FOUND", + ErrorCode_E_EDGE_PROP_NOT_FOUND: "E_EDGE_PROP_NOT_FOUND", + ErrorCode_E_TAG_PROP_NOT_FOUND: "E_TAG_PROP_NOT_FOUND", + ErrorCode_E_ROLE_NOT_FOUND: "E_ROLE_NOT_FOUND", + ErrorCode_E_CONFIG_NOT_FOUND: "E_CONFIG_NOT_FOUND", + ErrorCode_E_GROUP_NOT_FOUND: "E_GROUP_NOT_FOUND", + ErrorCode_E_ZONE_NOT_FOUND: "E_ZONE_NOT_FOUND", + ErrorCode_E_LISTENER_NOT_FOUND: "E_LISTENER_NOT_FOUND", + ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", + ErrorCode_E_KEY_NOT_FOUND: "E_KEY_NOT_FOUND", + ErrorCode_E_USER_NOT_FOUND: "E_USER_NOT_FOUND", + ErrorCode_E_STATS_NOT_FOUND: "E_STATS_NOT_FOUND", + ErrorCode_E_BACKUP_FAILED: "E_BACKUP_FAILED", + ErrorCode_E_BACKUP_EMPTY_TABLE: "E_BACKUP_EMPTY_TABLE", + ErrorCode_E_BACKUP_TABLE_FAILED: "E_BACKUP_TABLE_FAILED", + ErrorCode_E_PARTIAL_RESULT: "E_PARTIAL_RESULT", + ErrorCode_E_REBUILD_INDEX_FAILED: "E_REBUILD_INDEX_FAILED", + ErrorCode_E_INVALID_PASSWORD: "E_INVALID_PASSWORD", + ErrorCode_E_FAILED_GET_ABS_PATH: "E_FAILED_GET_ABS_PATH", + ErrorCode_E_BAD_USERNAME_PASSWORD: "E_BAD_USERNAME_PASSWORD", + ErrorCode_E_SESSION_INVALID: "E_SESSION_INVALID", + ErrorCode_E_SESSION_TIMEOUT: "E_SESSION_TIMEOUT", + ErrorCode_E_SYNTAX_ERROR: "E_SYNTAX_ERROR", + ErrorCode_E_EXECUTION_ERROR: "E_EXECUTION_ERROR", + ErrorCode_E_STATEMENT_EMPTY: "E_STATEMENT_EMPTY", + ErrorCode_E_BAD_PERMISSION: "E_BAD_PERMISSION", + ErrorCode_E_SEMANTIC_ERROR: "E_SEMANTIC_ERROR", + ErrorCode_E_TOO_MANY_CONNECTIONS: "E_TOO_MANY_CONNECTIONS", + ErrorCode_E_PARTIAL_SUCCEEDED: "E_PARTIAL_SUCCEEDED", + ErrorCode_E_NO_HOSTS: "E_NO_HOSTS", + ErrorCode_E_EXISTED: "E_EXISTED", + ErrorCode_E_INVALID_HOST: "E_INVALID_HOST", + ErrorCode_E_UNSUPPORTED: "E_UNSUPPORTED", + ErrorCode_E_NOT_DROP: "E_NOT_DROP", + ErrorCode_E_BALANCER_RUNNING: "E_BALANCER_RUNNING", + ErrorCode_E_CONFIG_IMMUTABLE: "E_CONFIG_IMMUTABLE", + ErrorCode_E_CONFLICT: "E_CONFLICT", + ErrorCode_E_INVALID_PARM: "E_INVALID_PARM", + ErrorCode_E_WRONGCLUSTER: "E_WRONGCLUSTER", + 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", + ErrorCode_E_BALANCED: "E_BALANCED", + ErrorCode_E_NO_RUNNING_BALANCE_PLAN: "E_NO_RUNNING_BALANCE_PLAN", + ErrorCode_E_NO_VALID_HOST: "E_NO_VALID_HOST", + ErrorCode_E_CORRUPTTED_BALANCE_PLAN: "E_CORRUPTTED_BALANCE_PLAN", + ErrorCode_E_NO_INVALID_BALANCE_PLAN: "E_NO_INVALID_BALANCE_PLAN", + ErrorCode_E_IMPROPER_ROLE: "E_IMPROPER_ROLE", + ErrorCode_E_INVALID_PARTITION_NUM: "E_INVALID_PARTITION_NUM", + ErrorCode_E_INVALID_REPLICA_FACTOR: "E_INVALID_REPLICA_FACTOR", + ErrorCode_E_INVALID_CHARSET: "E_INVALID_CHARSET", + ErrorCode_E_INVALID_COLLATE: "E_INVALID_COLLATE", + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH: "E_CHARSET_COLLATE_NOT_MATCH", + ErrorCode_E_SNAPSHOT_FAILURE: "E_SNAPSHOT_FAILURE", + ErrorCode_E_BLOCK_WRITE_FAILURE: "E_BLOCK_WRITE_FAILURE", + ErrorCode_E_REBUILD_INDEX_FAILURE: "E_REBUILD_INDEX_FAILURE", + ErrorCode_E_INDEX_WITH_TTL: "E_INDEX_WITH_TTL", + ErrorCode_E_ADD_JOB_FAILURE: "E_ADD_JOB_FAILURE", + ErrorCode_E_STOP_JOB_FAILURE: "E_STOP_JOB_FAILURE", + ErrorCode_E_SAVE_JOB_FAILURE: "E_SAVE_JOB_FAILURE", + ErrorCode_E_BALANCER_FAILURE: "E_BALANCER_FAILURE", + ErrorCode_E_JOB_NOT_FINISHED: "E_JOB_NOT_FINISHED", + ErrorCode_E_TASK_REPORT_OUT_DATE: "E_TASK_REPORT_OUT_DATE", + ErrorCode_E_JOB_NOT_IN_SPACE: "E_JOB_NOT_IN_SPACE", + 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", + ErrorCode_E_RESTORE_FAILURE: "E_RESTORE_FAILURE", + ErrorCode_E_SESSION_NOT_FOUND: "E_SESSION_NOT_FOUND", + ErrorCode_E_LIST_CLUSTER_FAILURE: "E_LIST_CLUSTER_FAILURE", + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE: "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + ErrorCode_E_GET_META_DIR_FAILURE: "E_GET_META_DIR_FAILURE", + ErrorCode_E_QUERY_NOT_FOUND: "E_QUERY_NOT_FOUND", + ErrorCode_E_CONSENSUS_ERROR: "E_CONSENSUS_ERROR", + ErrorCode_E_KEY_HAS_EXISTS: "E_KEY_HAS_EXISTS", + ErrorCode_E_DATA_TYPE_MISMATCH: "E_DATA_TYPE_MISMATCH", + ErrorCode_E_INVALID_FIELD_VALUE: "E_INVALID_FIELD_VALUE", + ErrorCode_E_INVALID_OPERATION: "E_INVALID_OPERATION", + ErrorCode_E_NOT_NULLABLE: "E_NOT_NULLABLE", + ErrorCode_E_FIELD_UNSET: "E_FIELD_UNSET", + ErrorCode_E_OUT_OF_RANGE: "E_OUT_OF_RANGE", + ErrorCode_E_ATOMIC_OP_FAILED: "E_ATOMIC_OP_FAILED", + ErrorCode_E_DATA_CONFLICT_ERROR: "E_DATA_CONFLICT_ERROR", + ErrorCode_E_WRITE_STALLED: "E_WRITE_STALLED", + ErrorCode_E_IMPROPER_DATA_TYPE: "E_IMPROPER_DATA_TYPE", + ErrorCode_E_INVALID_SPACEVIDLEN: "E_INVALID_SPACEVIDLEN", + ErrorCode_E_INVALID_FILTER: "E_INVALID_FILTER", + ErrorCode_E_INVALID_UPDATER: "E_INVALID_UPDATER", + ErrorCode_E_INVALID_STORE: "E_INVALID_STORE", + ErrorCode_E_INVALID_PEER: "E_INVALID_PEER", + ErrorCode_E_RETRY_EXHAUSTED: "E_RETRY_EXHAUSTED", + ErrorCode_E_TRANSFER_LEADER_FAILED: "E_TRANSFER_LEADER_FAILED", + ErrorCode_E_INVALID_STAT_TYPE: "E_INVALID_STAT_TYPE", + ErrorCode_E_INVALID_VID: "E_INVALID_VID", + ErrorCode_E_NO_TRANSFORMED: "E_NO_TRANSFORMED", + ErrorCode_E_LOAD_META_FAILED: "E_LOAD_META_FAILED", + ErrorCode_E_FAILED_TO_CHECKPOINT: "E_FAILED_TO_CHECKPOINT", + ErrorCode_E_CHECKPOINT_BLOCKED: "E_CHECKPOINT_BLOCKED", + ErrorCode_E_FILTER_OUT: "E_FILTER_OUT", + ErrorCode_E_INVALID_DATA: "E_INVALID_DATA", + ErrorCode_E_MUTATE_EDGE_CONFLICT: "E_MUTATE_EDGE_CONFLICT", + ErrorCode_E_MUTATE_TAG_CONFLICT: "E_MUTATE_TAG_CONFLICT", + ErrorCode_E_OUTDATED_LOCK: "E_OUTDATED_LOCK", + ErrorCode_E_INVALID_TASK_PARA: "E_INVALID_TASK_PARA", + ErrorCode_E_USER_CANCEL: "E_USER_CANCEL", + ErrorCode_E_TASK_EXECUTION_FAILED: "E_TASK_EXECUTION_FAILED", + ErrorCode_E_PLAN_IS_KILLED: "E_PLAN_IS_KILLED", + ErrorCode_E_NO_TERM: "E_NO_TERM", + ErrorCode_E_OUTDATED_TERM: "E_OUTDATED_TERM", + ErrorCode_E_OUTDATED_EDGE: "E_OUTDATED_EDGE", + ErrorCode_E_WRITE_WRITE_CONFLICT: "E_WRITE_WRITE_CONFLICT", + ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE: "E_CLIENT_SERVER_INCOMPATIBLE", + ErrorCode_E_UNKNOWN: "E_UNKNOWN", +} + +var ErrorCodeToValue = map[string]ErrorCode { + "SUCCEEDED": ErrorCode_SUCCEEDED, + "E_DISCONNECTED": ErrorCode_E_DISCONNECTED, + "E_FAIL_TO_CONNECT": ErrorCode_E_FAIL_TO_CONNECT, + "E_RPC_FAILURE": ErrorCode_E_RPC_FAILURE, + "E_LEADER_CHANGED": ErrorCode_E_LEADER_CHANGED, + "E_SPACE_NOT_FOUND": ErrorCode_E_SPACE_NOT_FOUND, + "E_TAG_NOT_FOUND": ErrorCode_E_TAG_NOT_FOUND, + "E_EDGE_NOT_FOUND": ErrorCode_E_EDGE_NOT_FOUND, + "E_INDEX_NOT_FOUND": ErrorCode_E_INDEX_NOT_FOUND, + "E_EDGE_PROP_NOT_FOUND": ErrorCode_E_EDGE_PROP_NOT_FOUND, + "E_TAG_PROP_NOT_FOUND": ErrorCode_E_TAG_PROP_NOT_FOUND, + "E_ROLE_NOT_FOUND": ErrorCode_E_ROLE_NOT_FOUND, + "E_CONFIG_NOT_FOUND": ErrorCode_E_CONFIG_NOT_FOUND, + "E_GROUP_NOT_FOUND": ErrorCode_E_GROUP_NOT_FOUND, + "E_ZONE_NOT_FOUND": ErrorCode_E_ZONE_NOT_FOUND, + "E_LISTENER_NOT_FOUND": ErrorCode_E_LISTENER_NOT_FOUND, + "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, + "E_KEY_NOT_FOUND": ErrorCode_E_KEY_NOT_FOUND, + "E_USER_NOT_FOUND": ErrorCode_E_USER_NOT_FOUND, + "E_STATS_NOT_FOUND": ErrorCode_E_STATS_NOT_FOUND, + "E_BACKUP_FAILED": ErrorCode_E_BACKUP_FAILED, + "E_BACKUP_EMPTY_TABLE": ErrorCode_E_BACKUP_EMPTY_TABLE, + "E_BACKUP_TABLE_FAILED": ErrorCode_E_BACKUP_TABLE_FAILED, + "E_PARTIAL_RESULT": ErrorCode_E_PARTIAL_RESULT, + "E_REBUILD_INDEX_FAILED": ErrorCode_E_REBUILD_INDEX_FAILED, + "E_INVALID_PASSWORD": ErrorCode_E_INVALID_PASSWORD, + "E_FAILED_GET_ABS_PATH": ErrorCode_E_FAILED_GET_ABS_PATH, + "E_BAD_USERNAME_PASSWORD": ErrorCode_E_BAD_USERNAME_PASSWORD, + "E_SESSION_INVALID": ErrorCode_E_SESSION_INVALID, + "E_SESSION_TIMEOUT": ErrorCode_E_SESSION_TIMEOUT, + "E_SYNTAX_ERROR": ErrorCode_E_SYNTAX_ERROR, + "E_EXECUTION_ERROR": ErrorCode_E_EXECUTION_ERROR, + "E_STATEMENT_EMPTY": ErrorCode_E_STATEMENT_EMPTY, + "E_BAD_PERMISSION": ErrorCode_E_BAD_PERMISSION, + "E_SEMANTIC_ERROR": ErrorCode_E_SEMANTIC_ERROR, + "E_TOO_MANY_CONNECTIONS": ErrorCode_E_TOO_MANY_CONNECTIONS, + "E_PARTIAL_SUCCEEDED": ErrorCode_E_PARTIAL_SUCCEEDED, + "E_NO_HOSTS": ErrorCode_E_NO_HOSTS, + "E_EXISTED": ErrorCode_E_EXISTED, + "E_INVALID_HOST": ErrorCode_E_INVALID_HOST, + "E_UNSUPPORTED": ErrorCode_E_UNSUPPORTED, + "E_NOT_DROP": ErrorCode_E_NOT_DROP, + "E_BALANCER_RUNNING": ErrorCode_E_BALANCER_RUNNING, + "E_CONFIG_IMMUTABLE": ErrorCode_E_CONFIG_IMMUTABLE, + "E_CONFLICT": ErrorCode_E_CONFLICT, + "E_INVALID_PARM": ErrorCode_E_INVALID_PARM, + "E_WRONGCLUSTER": ErrorCode_E_WRONGCLUSTER, + "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, + "E_BALANCED": ErrorCode_E_BALANCED, + "E_NO_RUNNING_BALANCE_PLAN": ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + "E_NO_VALID_HOST": ErrorCode_E_NO_VALID_HOST, + "E_CORRUPTTED_BALANCE_PLAN": ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + "E_NO_INVALID_BALANCE_PLAN": ErrorCode_E_NO_INVALID_BALANCE_PLAN, + "E_IMPROPER_ROLE": ErrorCode_E_IMPROPER_ROLE, + "E_INVALID_PARTITION_NUM": ErrorCode_E_INVALID_PARTITION_NUM, + "E_INVALID_REPLICA_FACTOR": ErrorCode_E_INVALID_REPLICA_FACTOR, + "E_INVALID_CHARSET": ErrorCode_E_INVALID_CHARSET, + "E_INVALID_COLLATE": ErrorCode_E_INVALID_COLLATE, + "E_CHARSET_COLLATE_NOT_MATCH": ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + "E_SNAPSHOT_FAILURE": ErrorCode_E_SNAPSHOT_FAILURE, + "E_BLOCK_WRITE_FAILURE": ErrorCode_E_BLOCK_WRITE_FAILURE, + "E_REBUILD_INDEX_FAILURE": ErrorCode_E_REBUILD_INDEX_FAILURE, + "E_INDEX_WITH_TTL": ErrorCode_E_INDEX_WITH_TTL, + "E_ADD_JOB_FAILURE": ErrorCode_E_ADD_JOB_FAILURE, + "E_STOP_JOB_FAILURE": ErrorCode_E_STOP_JOB_FAILURE, + "E_SAVE_JOB_FAILURE": ErrorCode_E_SAVE_JOB_FAILURE, + "E_BALANCER_FAILURE": ErrorCode_E_BALANCER_FAILURE, + "E_JOB_NOT_FINISHED": ErrorCode_E_JOB_NOT_FINISHED, + "E_TASK_REPORT_OUT_DATE": ErrorCode_E_TASK_REPORT_OUT_DATE, + "E_JOB_NOT_IN_SPACE": ErrorCode_E_JOB_NOT_IN_SPACE, + "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, + "E_RESTORE_FAILURE": ErrorCode_E_RESTORE_FAILURE, + "E_SESSION_NOT_FOUND": ErrorCode_E_SESSION_NOT_FOUND, + "E_LIST_CLUSTER_FAILURE": ErrorCode_E_LIST_CLUSTER_FAILURE, + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE": ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + "E_GET_META_DIR_FAILURE": ErrorCode_E_GET_META_DIR_FAILURE, + "E_QUERY_NOT_FOUND": ErrorCode_E_QUERY_NOT_FOUND, + "E_CONSENSUS_ERROR": ErrorCode_E_CONSENSUS_ERROR, + "E_KEY_HAS_EXISTS": ErrorCode_E_KEY_HAS_EXISTS, + "E_DATA_TYPE_MISMATCH": ErrorCode_E_DATA_TYPE_MISMATCH, + "E_INVALID_FIELD_VALUE": ErrorCode_E_INVALID_FIELD_VALUE, + "E_INVALID_OPERATION": ErrorCode_E_INVALID_OPERATION, + "E_NOT_NULLABLE": ErrorCode_E_NOT_NULLABLE, + "E_FIELD_UNSET": ErrorCode_E_FIELD_UNSET, + "E_OUT_OF_RANGE": ErrorCode_E_OUT_OF_RANGE, + "E_ATOMIC_OP_FAILED": ErrorCode_E_ATOMIC_OP_FAILED, + "E_DATA_CONFLICT_ERROR": ErrorCode_E_DATA_CONFLICT_ERROR, + "E_WRITE_STALLED": ErrorCode_E_WRITE_STALLED, + "E_IMPROPER_DATA_TYPE": ErrorCode_E_IMPROPER_DATA_TYPE, + "E_INVALID_SPACEVIDLEN": ErrorCode_E_INVALID_SPACEVIDLEN, + "E_INVALID_FILTER": ErrorCode_E_INVALID_FILTER, + "E_INVALID_UPDATER": ErrorCode_E_INVALID_UPDATER, + "E_INVALID_STORE": ErrorCode_E_INVALID_STORE, + "E_INVALID_PEER": ErrorCode_E_INVALID_PEER, + "E_RETRY_EXHAUSTED": ErrorCode_E_RETRY_EXHAUSTED, + "E_TRANSFER_LEADER_FAILED": ErrorCode_E_TRANSFER_LEADER_FAILED, + "E_INVALID_STAT_TYPE": ErrorCode_E_INVALID_STAT_TYPE, + "E_INVALID_VID": ErrorCode_E_INVALID_VID, + "E_NO_TRANSFORMED": ErrorCode_E_NO_TRANSFORMED, + "E_LOAD_META_FAILED": ErrorCode_E_LOAD_META_FAILED, + "E_FAILED_TO_CHECKPOINT": ErrorCode_E_FAILED_TO_CHECKPOINT, + "E_CHECKPOINT_BLOCKED": ErrorCode_E_CHECKPOINT_BLOCKED, + "E_FILTER_OUT": ErrorCode_E_FILTER_OUT, + "E_INVALID_DATA": ErrorCode_E_INVALID_DATA, + "E_MUTATE_EDGE_CONFLICT": ErrorCode_E_MUTATE_EDGE_CONFLICT, + "E_MUTATE_TAG_CONFLICT": ErrorCode_E_MUTATE_TAG_CONFLICT, + "E_OUTDATED_LOCK": ErrorCode_E_OUTDATED_LOCK, + "E_INVALID_TASK_PARA": ErrorCode_E_INVALID_TASK_PARA, + "E_USER_CANCEL": ErrorCode_E_USER_CANCEL, + "E_TASK_EXECUTION_FAILED": ErrorCode_E_TASK_EXECUTION_FAILED, + "E_PLAN_IS_KILLED": ErrorCode_E_PLAN_IS_KILLED, + "E_NO_TERM": ErrorCode_E_NO_TERM, + "E_OUTDATED_TERM": ErrorCode_E_OUTDATED_TERM, + "E_OUTDATED_EDGE": ErrorCode_E_OUTDATED_EDGE, + "E_WRITE_WRITE_CONFLICT": ErrorCode_E_WRITE_WRITE_CONFLICT, + "E_CLIENT_SERVER_INCOMPATIBLE": ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE, + "E_UNKNOWN": ErrorCode_E_UNKNOWN, +} + +var ErrorCodeNames = []string { + "SUCCEEDED", + "E_DISCONNECTED", + "E_FAIL_TO_CONNECT", + "E_RPC_FAILURE", + "E_LEADER_CHANGED", + "E_SPACE_NOT_FOUND", + "E_TAG_NOT_FOUND", + "E_EDGE_NOT_FOUND", + "E_INDEX_NOT_FOUND", + "E_EDGE_PROP_NOT_FOUND", + "E_TAG_PROP_NOT_FOUND", + "E_ROLE_NOT_FOUND", + "E_CONFIG_NOT_FOUND", + "E_GROUP_NOT_FOUND", + "E_ZONE_NOT_FOUND", + "E_LISTENER_NOT_FOUND", + "E_PART_NOT_FOUND", + "E_KEY_NOT_FOUND", + "E_USER_NOT_FOUND", + "E_STATS_NOT_FOUND", + "E_BACKUP_FAILED", + "E_BACKUP_EMPTY_TABLE", + "E_BACKUP_TABLE_FAILED", + "E_PARTIAL_RESULT", + "E_REBUILD_INDEX_FAILED", + "E_INVALID_PASSWORD", + "E_FAILED_GET_ABS_PATH", + "E_BAD_USERNAME_PASSWORD", + "E_SESSION_INVALID", + "E_SESSION_TIMEOUT", + "E_SYNTAX_ERROR", + "E_EXECUTION_ERROR", + "E_STATEMENT_EMPTY", + "E_BAD_PERMISSION", + "E_SEMANTIC_ERROR", + "E_TOO_MANY_CONNECTIONS", + "E_PARTIAL_SUCCEEDED", + "E_NO_HOSTS", + "E_EXISTED", + "E_INVALID_HOST", + "E_UNSUPPORTED", + "E_NOT_DROP", + "E_BALANCER_RUNNING", + "E_CONFIG_IMMUTABLE", + "E_CONFLICT", + "E_INVALID_PARM", + "E_WRONGCLUSTER", + "E_STORE_FAILURE", + "E_STORE_SEGMENT_ILLEGAL", + "E_BAD_BALANCE_PLAN", + "E_BALANCED", + "E_NO_RUNNING_BALANCE_PLAN", + "E_NO_VALID_HOST", + "E_CORRUPTTED_BALANCE_PLAN", + "E_NO_INVALID_BALANCE_PLAN", + "E_IMPROPER_ROLE", + "E_INVALID_PARTITION_NUM", + "E_INVALID_REPLICA_FACTOR", + "E_INVALID_CHARSET", + "E_INVALID_COLLATE", + "E_CHARSET_COLLATE_NOT_MATCH", + "E_SNAPSHOT_FAILURE", + "E_BLOCK_WRITE_FAILURE", + "E_REBUILD_INDEX_FAILURE", + "E_INDEX_WITH_TTL", + "E_ADD_JOB_FAILURE", + "E_STOP_JOB_FAILURE", + "E_SAVE_JOB_FAILURE", + "E_BALANCER_FAILURE", + "E_JOB_NOT_FINISHED", + "E_TASK_REPORT_OUT_DATE", + "E_JOB_NOT_IN_SPACE", + "E_INVALID_JOB", + "E_BACKUP_BUILDING_INDEX", + "E_BACKUP_SPACE_NOT_FOUND", + "E_RESTORE_FAILURE", + "E_SESSION_NOT_FOUND", + "E_LIST_CLUSTER_FAILURE", + "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", + "E_GET_META_DIR_FAILURE", + "E_QUERY_NOT_FOUND", + "E_CONSENSUS_ERROR", + "E_KEY_HAS_EXISTS", + "E_DATA_TYPE_MISMATCH", + "E_INVALID_FIELD_VALUE", + "E_INVALID_OPERATION", + "E_NOT_NULLABLE", + "E_FIELD_UNSET", + "E_OUT_OF_RANGE", + "E_ATOMIC_OP_FAILED", + "E_DATA_CONFLICT_ERROR", + "E_WRITE_STALLED", + "E_IMPROPER_DATA_TYPE", + "E_INVALID_SPACEVIDLEN", + "E_INVALID_FILTER", + "E_INVALID_UPDATER", + "E_INVALID_STORE", + "E_INVALID_PEER", + "E_RETRY_EXHAUSTED", + "E_TRANSFER_LEADER_FAILED", + "E_INVALID_STAT_TYPE", + "E_INVALID_VID", + "E_NO_TRANSFORMED", + "E_LOAD_META_FAILED", + "E_FAILED_TO_CHECKPOINT", + "E_CHECKPOINT_BLOCKED", + "E_FILTER_OUT", + "E_INVALID_DATA", + "E_MUTATE_EDGE_CONFLICT", + "E_MUTATE_TAG_CONFLICT", + "E_OUTDATED_LOCK", + "E_INVALID_TASK_PARA", + "E_USER_CANCEL", + "E_TASK_EXECUTION_FAILED", + "E_PLAN_IS_KILLED", + "E_NO_TERM", + "E_OUTDATED_TERM", + "E_OUTDATED_EDGE", + "E_WRITE_WRITE_CONFLICT", + "E_CLIENT_SERVER_INCOMPATIBLE", + "E_UNKNOWN", +} + +var ErrorCodeValues = []ErrorCode { + ErrorCode_SUCCEEDED, + ErrorCode_E_DISCONNECTED, + ErrorCode_E_FAIL_TO_CONNECT, + ErrorCode_E_RPC_FAILURE, + ErrorCode_E_LEADER_CHANGED, + ErrorCode_E_SPACE_NOT_FOUND, + ErrorCode_E_TAG_NOT_FOUND, + ErrorCode_E_EDGE_NOT_FOUND, + ErrorCode_E_INDEX_NOT_FOUND, + ErrorCode_E_EDGE_PROP_NOT_FOUND, + ErrorCode_E_TAG_PROP_NOT_FOUND, + ErrorCode_E_ROLE_NOT_FOUND, + ErrorCode_E_CONFIG_NOT_FOUND, + ErrorCode_E_GROUP_NOT_FOUND, + ErrorCode_E_ZONE_NOT_FOUND, + ErrorCode_E_LISTENER_NOT_FOUND, + ErrorCode_E_PART_NOT_FOUND, + ErrorCode_E_KEY_NOT_FOUND, + ErrorCode_E_USER_NOT_FOUND, + ErrorCode_E_STATS_NOT_FOUND, + ErrorCode_E_BACKUP_FAILED, + ErrorCode_E_BACKUP_EMPTY_TABLE, + ErrorCode_E_BACKUP_TABLE_FAILED, + ErrorCode_E_PARTIAL_RESULT, + ErrorCode_E_REBUILD_INDEX_FAILED, + ErrorCode_E_INVALID_PASSWORD, + ErrorCode_E_FAILED_GET_ABS_PATH, + ErrorCode_E_BAD_USERNAME_PASSWORD, + ErrorCode_E_SESSION_INVALID, + ErrorCode_E_SESSION_TIMEOUT, + ErrorCode_E_SYNTAX_ERROR, + ErrorCode_E_EXECUTION_ERROR, + ErrorCode_E_STATEMENT_EMPTY, + ErrorCode_E_BAD_PERMISSION, + ErrorCode_E_SEMANTIC_ERROR, + ErrorCode_E_TOO_MANY_CONNECTIONS, + ErrorCode_E_PARTIAL_SUCCEEDED, + ErrorCode_E_NO_HOSTS, + ErrorCode_E_EXISTED, + ErrorCode_E_INVALID_HOST, + ErrorCode_E_UNSUPPORTED, + ErrorCode_E_NOT_DROP, + ErrorCode_E_BALANCER_RUNNING, + ErrorCode_E_CONFIG_IMMUTABLE, + ErrorCode_E_CONFLICT, + ErrorCode_E_INVALID_PARM, + ErrorCode_E_WRONGCLUSTER, + ErrorCode_E_STORE_FAILURE, + ErrorCode_E_STORE_SEGMENT_ILLEGAL, + ErrorCode_E_BAD_BALANCE_PLAN, + ErrorCode_E_BALANCED, + ErrorCode_E_NO_RUNNING_BALANCE_PLAN, + ErrorCode_E_NO_VALID_HOST, + ErrorCode_E_CORRUPTTED_BALANCE_PLAN, + ErrorCode_E_NO_INVALID_BALANCE_PLAN, + ErrorCode_E_IMPROPER_ROLE, + ErrorCode_E_INVALID_PARTITION_NUM, + ErrorCode_E_INVALID_REPLICA_FACTOR, + ErrorCode_E_INVALID_CHARSET, + ErrorCode_E_INVALID_COLLATE, + ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, + ErrorCode_E_SNAPSHOT_FAILURE, + ErrorCode_E_BLOCK_WRITE_FAILURE, + ErrorCode_E_REBUILD_INDEX_FAILURE, + ErrorCode_E_INDEX_WITH_TTL, + ErrorCode_E_ADD_JOB_FAILURE, + ErrorCode_E_STOP_JOB_FAILURE, + ErrorCode_E_SAVE_JOB_FAILURE, + ErrorCode_E_BALANCER_FAILURE, + ErrorCode_E_JOB_NOT_FINISHED, + ErrorCode_E_TASK_REPORT_OUT_DATE, + ErrorCode_E_JOB_NOT_IN_SPACE, + ErrorCode_E_INVALID_JOB, + ErrorCode_E_BACKUP_BUILDING_INDEX, + ErrorCode_E_BACKUP_SPACE_NOT_FOUND, + ErrorCode_E_RESTORE_FAILURE, + ErrorCode_E_SESSION_NOT_FOUND, + ErrorCode_E_LIST_CLUSTER_FAILURE, + ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, + ErrorCode_E_GET_META_DIR_FAILURE, + ErrorCode_E_QUERY_NOT_FOUND, + ErrorCode_E_CONSENSUS_ERROR, + ErrorCode_E_KEY_HAS_EXISTS, + ErrorCode_E_DATA_TYPE_MISMATCH, + ErrorCode_E_INVALID_FIELD_VALUE, + ErrorCode_E_INVALID_OPERATION, + ErrorCode_E_NOT_NULLABLE, + ErrorCode_E_FIELD_UNSET, + ErrorCode_E_OUT_OF_RANGE, + ErrorCode_E_ATOMIC_OP_FAILED, + ErrorCode_E_DATA_CONFLICT_ERROR, + ErrorCode_E_WRITE_STALLED, + ErrorCode_E_IMPROPER_DATA_TYPE, + ErrorCode_E_INVALID_SPACEVIDLEN, + ErrorCode_E_INVALID_FILTER, + ErrorCode_E_INVALID_UPDATER, + ErrorCode_E_INVALID_STORE, + ErrorCode_E_INVALID_PEER, + ErrorCode_E_RETRY_EXHAUSTED, + ErrorCode_E_TRANSFER_LEADER_FAILED, + ErrorCode_E_INVALID_STAT_TYPE, + ErrorCode_E_INVALID_VID, + ErrorCode_E_NO_TRANSFORMED, + ErrorCode_E_LOAD_META_FAILED, + ErrorCode_E_FAILED_TO_CHECKPOINT, + ErrorCode_E_CHECKPOINT_BLOCKED, + ErrorCode_E_FILTER_OUT, + ErrorCode_E_INVALID_DATA, + ErrorCode_E_MUTATE_EDGE_CONFLICT, + ErrorCode_E_MUTATE_TAG_CONFLICT, + ErrorCode_E_OUTDATED_LOCK, + ErrorCode_E_INVALID_TASK_PARA, + ErrorCode_E_USER_CANCEL, + ErrorCode_E_TASK_EXECUTION_FAILED, + ErrorCode_E_PLAN_IS_KILLED, + ErrorCode_E_NO_TERM, + ErrorCode_E_OUTDATED_TERM, + ErrorCode_E_OUTDATED_EDGE, + ErrorCode_E_WRITE_WRITE_CONFLICT, + ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE, + ErrorCode_E_UNKNOWN, +} + +func (p ErrorCode) String() string { + if v, ok := ErrorCodeToName[p]; ok { + return v + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + if v, ok := ErrorCodeToValue[s]; ok { + return v, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +type GraphSpaceID = int32 + +func GraphSpaceIDPtr(v GraphSpaceID) *GraphSpaceID { return &v } + +type PartitionID = int32 + +func PartitionIDPtr(v PartitionID) *PartitionID { return &v } + +type TagID = int32 + +func TagIDPtr(v TagID) *TagID { return &v } + +type EdgeType = int32 + +func EdgeTypePtr(v EdgeType) *EdgeType { return &v } + +type EdgeRanking = int64 + +func EdgeRankingPtr(v EdgeRanking) *EdgeRanking { return &v } + +type LogID = int64 + +func LogIDPtr(v LogID) *LogID { return &v } + +type TermID = int64 + +func TermIDPtr(v TermID) *TermID { return &v } + +type Timestamp = int64 + +func TimestampPtr(v Timestamp) *Timestamp { return &v } + +type IndexID = int32 + +func IndexIDPtr(v IndexID) *IndexID { return &v } + +type Port = int32 + +func PortPtr(v Port) *Port { return &v } + +type SessionID = int64 + +func SessionIDPtr(v SessionID) *SessionID { return &v } + +type ExecutionPlanID = int64 + +func ExecutionPlanIDPtr(v ExecutionPlanID) *ExecutionPlanID { return &v } + +// Attributes: +// - TagID +// - EdgeType +type SchemaID struct { + TagID *TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type,omitempty"` +} + +func NewSchemaID() *SchemaID { + return &SchemaID{} +} + +var SchemaID_TagID_DEFAULT TagID +func (p *SchemaID) GetTagID() TagID { + if !p.IsSetTagID() { + return SchemaID_TagID_DEFAULT + } +return *p.TagID +} +var SchemaID_EdgeType_DEFAULT EdgeType +func (p *SchemaID) GetEdgeType() EdgeType { + if !p.IsSetEdgeType() { + return SchemaID_EdgeType_DEFAULT + } +return *p.EdgeType +} +func (p *SchemaID) CountSetFieldsSchemaID() int { + count := 0 + if (p.IsSetTagID()) { + count++ + } + if (p.IsSetEdgeType()) { + count++ + } + return count + +} + +func (p *SchemaID) IsSetTagID() bool { + return p != nil && p.TagID != nil +} + +func (p *SchemaID) IsSetEdgeType() bool { + return p != nil && p.EdgeType != nil +} + +func (p *SchemaID) 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 *SchemaID) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *SchemaID) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *SchemaID) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsSchemaID(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SchemaID"); 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 *SchemaID) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin("tag_id", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag_id: ", p), err) } + if err := oprot.WriteI32(int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + } + return err +} + +func (p *SchemaID) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin("edge_type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edge_type: ", p), err) } + if err := oprot.WriteI32(int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + } + return err +} + +func (p *SchemaID) String() string { + if p == nil { + return "" + } + + var tagIDVal string + if p.TagID == nil { + tagIDVal = "" + } else { + tagIDVal = fmt.Sprintf("%v", *p.TagID) + } + var edgeTypeVal string + if p.EdgeType == nil { + edgeTypeVal = "" + } else { + edgeTypeVal = fmt.Sprintf("%v", *p.EdgeType) + } + return fmt.Sprintf("SchemaID({TagID:%s EdgeType:%s})", tagIDVal, edgeTypeVal) +} + +// Attributes: +// - Year +// - Month +// - Day +type Date struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` +} + +func NewDate() *Date { + return &Date{} +} + + +func (p *Date) GetYear() int16 { + return p.Year +} + +func (p *Date) GetMonth() int8 { + return p.Month +} + +func (p *Date) GetDay() int8 { + return p.Day +} +func (p *Date) 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 *Date) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *Date) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *Date) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *Date) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Date"); 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 *Date) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *Date) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *Date) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *Date) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + return fmt.Sprintf("Date({Year:%s Month:%s Day:%s})", yearVal, monthVal, dayVal) +} + +// Attributes: +// - Hour +// - Minute +// - Sec +// - Microsec +type Time struct { + Hour int8 `thrift:"hour,1" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,2" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,3" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,4" db:"microsec" json:"microsec"` +} + +func NewTime() *Time { + return &Time{} +} + + +func (p *Time) GetHour() int8 { + return p.Hour +} + +func (p *Time) GetMinute() int8 { + return p.Minute +} + +func (p *Time) GetSec() int8 { + return p.Sec +} + +func (p *Time) GetMicrosec() int32 { + return p.Microsec +} +func (p *Time) 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 + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Time) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *Time) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *Time) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *Time) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *Time) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Time"); 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 { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Time) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hour: ", p), err) } + return err +} + +func (p *Time) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:minute: ", p), err) } + return err +} + +func (p *Time) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sec: ", p), err) } + return err +} + +func (p *Time) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:microsec: ", p), err) } + return err +} + +func (p *Time) String() string { + if p == nil { + return "" + } + + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("Time({Hour:%s Minute:%s Sec:%s Microsec:%s})", hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - Year +// - Month +// - Day +// - Hour +// - Minute +// - Sec +// - Microsec +type DateTime struct { + Year int16 `thrift:"year,1" db:"year" json:"year"` + Month int8 `thrift:"month,2" db:"month" json:"month"` + Day int8 `thrift:"day,3" db:"day" json:"day"` + Hour int8 `thrift:"hour,4" db:"hour" json:"hour"` + Minute int8 `thrift:"minute,5" db:"minute" json:"minute"` + Sec int8 `thrift:"sec,6" db:"sec" json:"sec"` + Microsec int32 `thrift:"microsec,7" db:"microsec" json:"microsec"` +} + +func NewDateTime() *DateTime { + return &DateTime{} +} + + +func (p *DateTime) GetYear() int16 { + return p.Year +} + +func (p *DateTime) GetMonth() int8 { + return p.Month +} + +func (p *DateTime) GetDay() int8 { + return p.Day +} + +func (p *DateTime) GetHour() int8 { + return p.Hour +} + +func (p *DateTime) GetMinute() int8 { + return p.Minute +} + +func (p *DateTime) GetSec() int8 { + return p.Sec +} + +func (p *DateTime) GetMicrosec() int32 { + return p.Microsec +} +func (p *DateTime) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + case 7: + if err := p.ReadField7(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DateTime) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *DateTime) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *DateTime) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *DateTime) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *DateTime) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *DateTime) ReadField6(iprot thrift.Protocol) error { + if v, err := iprot.ReadByte(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *DateTime) ReadField7(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *DateTime) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DateTime"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DateTime) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *DateTime) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(byte(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *DateTime) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(byte(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *DateTime) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("hour", thrift.BYTE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hour: ", p), err) } + if err := oprot.WriteByte(byte(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hour: ", p), err) } + return err +} + +func (p *DateTime) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("minute", thrift.BYTE, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minute: ", p), err) } + if err := oprot.WriteByte(byte(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minute: ", p), err) } + return err +} + +func (p *DateTime) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("sec", thrift.BYTE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sec: ", p), err) } + if err := oprot.WriteByte(byte(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sec: ", p), err) } + return err +} + +func (p *DateTime) writeField7(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("microsec", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:microsec: ", p), err) } + if err := oprot.WriteI32(int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:microsec: ", p), err) } + return err +} + +func (p *DateTime) String() string { + if p == nil { + return "" + } + + yearVal := fmt.Sprintf("%v", p.Year) + monthVal := fmt.Sprintf("%v", p.Month) + dayVal := fmt.Sprintf("%v", p.Day) + hourVal := fmt.Sprintf("%v", p.Hour) + minuteVal := fmt.Sprintf("%v", p.Minute) + secVal := fmt.Sprintf("%v", p.Sec) + microsecVal := fmt.Sprintf("%v", p.Microsec) + return fmt.Sprintf("DateTime({Year:%s Month:%s Day:%s Hour:%s Minute:%s Sec:%s Microsec:%s})", yearVal, monthVal, dayVal, hourVal, minuteVal, secVal, microsecVal) +} + +// Attributes: +// - NVal +// - BVal +// - IVal +// - FVal +// - SVal +// - DVal +// - TVal +// - DtVal +// - VVal +// - EVal +// - PVal +// - LVal +// - MVal +// - UVal +// - GVal +// - GgVal +type Value struct { + NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` + BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` + IVal *int64 `thrift:"iVal,3" db:"iVal" json:"iVal,omitempty"` + FVal *float64 `thrift:"fVal,4" db:"fVal" json:"fVal,omitempty"` + SVal []byte `thrift:"sVal,5" db:"sVal" json:"sVal,omitempty"` + DVal *Date `thrift:"dVal,6" db:"dVal" json:"dVal,omitempty"` + TVal *Time `thrift:"tVal,7" db:"tVal" json:"tVal,omitempty"` + DtVal *DateTime `thrift:"dtVal,8" db:"dtVal" json:"dtVal,omitempty"` + VVal *Vertex `thrift:"vVal,9" db:"vVal" json:"vVal,omitempty"` + EVal *Edge `thrift:"eVal,10" db:"eVal" json:"eVal,omitempty"` + PVal *Path `thrift:"pVal,11" db:"pVal" json:"pVal,omitempty"` + LVal *NList `thrift:"lVal,12" db:"lVal" json:"lVal,omitempty"` + MVal *NMap `thrift:"mVal,13" db:"mVal" json:"mVal,omitempty"` + UVal *NSet `thrift:"uVal,14" db:"uVal" json:"uVal,omitempty"` + GVal *DataSet `thrift:"gVal,15" db:"gVal" json:"gVal,omitempty"` + GgVal *Geography `thrift:"ggVal,16" db:"ggVal" json:"ggVal,omitempty"` +} + +func NewValue() *Value { + return &Value{} +} + +var Value_NVal_DEFAULT NullType +func (p *Value) GetNVal() NullType { + if !p.IsSetNVal() { + return Value_NVal_DEFAULT + } +return *p.NVal +} +var Value_BVal_DEFAULT bool +func (p *Value) GetBVal() bool { + if !p.IsSetBVal() { + return Value_BVal_DEFAULT + } +return *p.BVal +} +var Value_IVal_DEFAULT int64 +func (p *Value) GetIVal() int64 { + if !p.IsSetIVal() { + return Value_IVal_DEFAULT + } +return *p.IVal +} +var Value_FVal_DEFAULT float64 +func (p *Value) GetFVal() float64 { + if !p.IsSetFVal() { + return Value_FVal_DEFAULT + } +return *p.FVal +} +var Value_SVal_DEFAULT []byte + +func (p *Value) GetSVal() []byte { + return p.SVal +} +var Value_DVal_DEFAULT *Date +func (p *Value) GetDVal() *Date { + if !p.IsSetDVal() { + return Value_DVal_DEFAULT + } +return p.DVal +} +var Value_TVal_DEFAULT *Time +func (p *Value) GetTVal() *Time { + if !p.IsSetTVal() { + return Value_TVal_DEFAULT + } +return p.TVal +} +var Value_DtVal_DEFAULT *DateTime +func (p *Value) GetDtVal() *DateTime { + if !p.IsSetDtVal() { + return Value_DtVal_DEFAULT + } +return p.DtVal +} +var Value_VVal_DEFAULT *Vertex +func (p *Value) GetVVal() *Vertex { + if !p.IsSetVVal() { + return Value_VVal_DEFAULT + } +return p.VVal +} +var Value_EVal_DEFAULT *Edge +func (p *Value) GetEVal() *Edge { + if !p.IsSetEVal() { + return Value_EVal_DEFAULT + } +return p.EVal +} +var Value_PVal_DEFAULT *Path +func (p *Value) GetPVal() *Path { + if !p.IsSetPVal() { + return Value_PVal_DEFAULT + } +return p.PVal +} +var Value_LVal_DEFAULT *NList +func (p *Value) GetLVal() *NList { + if !p.IsSetLVal() { + return Value_LVal_DEFAULT + } +return p.LVal +} +var Value_MVal_DEFAULT *NMap +func (p *Value) GetMVal() *NMap { + if !p.IsSetMVal() { + return Value_MVal_DEFAULT + } +return p.MVal +} +var Value_UVal_DEFAULT *NSet +func (p *Value) GetUVal() *NSet { + if !p.IsSetUVal() { + return Value_UVal_DEFAULT + } +return p.UVal +} +var Value_GVal_DEFAULT *DataSet +func (p *Value) GetGVal() *DataSet { + if !p.IsSetGVal() { + return Value_GVal_DEFAULT + } +return p.GVal +} +var Value_GgVal_DEFAULT *Geography +func (p *Value) GetGgVal() *Geography { + if !p.IsSetGgVal() { + return Value_GgVal_DEFAULT + } +return p.GgVal +} +func (p *Value) CountSetFieldsValue() int { + count := 0 + if (p.IsSetNVal()) { + count++ + } + if (p.IsSetBVal()) { + count++ + } + if (p.IsSetIVal()) { + count++ + } + if (p.IsSetFVal()) { + count++ + } + if (p.IsSetSVal()) { + count++ + } + if (p.IsSetDVal()) { + count++ + } + if (p.IsSetTVal()) { + count++ + } + if (p.IsSetDtVal()) { + count++ + } + if (p.IsSetVVal()) { + count++ + } + if (p.IsSetEVal()) { + count++ + } + if (p.IsSetPVal()) { + count++ + } + if (p.IsSetLVal()) { + count++ + } + if (p.IsSetMVal()) { + count++ + } + if (p.IsSetUVal()) { + count++ + } + if (p.IsSetGVal()) { + count++ + } + if (p.IsSetGgVal()) { + count++ + } + return count + +} + +func (p *Value) IsSetNVal() bool { + return p != nil && p.NVal != nil +} + +func (p *Value) IsSetBVal() bool { + return p != nil && p.BVal != nil +} + +func (p *Value) IsSetIVal() bool { + return p != nil && p.IVal != nil +} + +func (p *Value) IsSetFVal() bool { + return p != nil && p.FVal != nil +} + +func (p *Value) IsSetSVal() bool { + return p != nil && p.SVal != nil +} + +func (p *Value) IsSetDVal() bool { + return p != nil && p.DVal != nil +} + +func (p *Value) IsSetTVal() bool { + return p != nil && p.TVal != nil +} + +func (p *Value) IsSetDtVal() bool { + return p != nil && p.DtVal != nil +} + +func (p *Value) IsSetVVal() bool { + return p != nil && p.VVal != nil +} + +func (p *Value) IsSetEVal() bool { + return p != nil && p.EVal != nil +} + +func (p *Value) IsSetPVal() bool { + return p != nil && p.PVal != nil +} + +func (p *Value) IsSetLVal() bool { + return p != nil && p.LVal != nil +} + +func (p *Value) IsSetMVal() bool { + return p != nil && p.MVal != nil +} + +func (p *Value) IsSetUVal() bool { + return p != nil && p.UVal != nil +} + +func (p *Value) IsSetGVal() bool { + return p != nil && p.GVal != nil +} + +func (p *Value) IsSetGgVal() bool { + return p != nil && p.GgVal != nil +} + +func (p *Value) Read(iprot thrift.Protocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + 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 + } + case 10: + if err := p.ReadField10(iprot); err != nil { + return err + } + case 11: + if err := p.ReadField11(iprot); err != nil { + return err + } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } + case 14: + if err := p.ReadField14(iprot); err != nil { + return err + } + case 15: + if err := p.ReadField15(iprot); err != nil { + return err + } + case 16: + if err := p.ReadField16(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 *Value) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := NullType(v) + p.NVal = &temp +} + return nil +} + +func (p *Value) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BVal = &v +} + return nil +} + +func (p *Value) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IVal = &v +} + return nil +} + +func (p *Value) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FVal = &v +} + return nil +} + +func (p *Value) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SVal = v +} + return nil +} + +func (p *Value) ReadField6(iprot thrift.Protocol) error { + p.DVal = NewDate() + if err := p.DVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DVal), err) + } + return nil +} + +func (p *Value) ReadField7(iprot thrift.Protocol) error { + p.TVal = NewTime() + if err := p.TVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TVal), err) + } + return nil +} + +func (p *Value) ReadField8(iprot thrift.Protocol) error { + p.DtVal = NewDateTime() + if err := p.DtVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DtVal), err) + } + return nil +} + +func (p *Value) ReadField9(iprot thrift.Protocol) error { + p.VVal = NewVertex() + if err := p.VVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VVal), err) + } + return nil +} + +func (p *Value) ReadField10(iprot thrift.Protocol) error { + p.EVal = NewEdge() + if err := p.EVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EVal), err) + } + return nil +} + +func (p *Value) ReadField11(iprot thrift.Protocol) error { + p.PVal = NewPath() + if err := p.PVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PVal), err) + } + return nil +} + +func (p *Value) ReadField12(iprot thrift.Protocol) error { + p.LVal = NewNList() + if err := p.LVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LVal), err) + } + return nil +} + +func (p *Value) ReadField13(iprot thrift.Protocol) error { + p.MVal = NewNMap() + if err := p.MVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MVal), err) + } + return nil +} + +func (p *Value) ReadField14(iprot thrift.Protocol) error { + p.UVal = NewNSet() + if err := p.UVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UVal), err) + } + return nil +} + +func (p *Value) ReadField15(iprot thrift.Protocol) error { + p.GVal = NewDataSet() + if err := p.GVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GVal), err) + } + return nil +} + +func (p *Value) ReadField16(iprot thrift.Protocol) error { + p.GgVal = NewGeography() + if err := p.GgVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GgVal), err) + } + return nil +} + +func (p *Value) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsValue(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("Value"); 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 := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { return err } + if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } + if err := p.writeField14(oprot); err != nil { return err } + if err := p.writeField15(oprot); err != nil { return err } + if err := p.writeField16(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Value) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetNVal() { + if err := oprot.WriteFieldBegin("nVal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nVal: ", p), err) } + if err := oprot.WriteI32(int32(*p.NVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nVal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nVal: ", p), err) } + } + return err +} + +func (p *Value) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetBVal() { + if err := oprot.WriteFieldBegin("bVal", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bVal: ", p), err) } + if err := oprot.WriteBool(bool(*p.BVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bVal (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bVal: ", p), err) } + } + return err +} + +func (p *Value) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetIVal() { + if err := oprot.WriteFieldBegin("iVal", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:iVal: ", p), err) } + if err := oprot.WriteI64(int64(*p.IVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.iVal (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:iVal: ", p), err) } + } + return err +} + +func (p *Value) writeField4(oprot thrift.Protocol) (err error) { + if p.IsSetFVal() { + if err := oprot.WriteFieldBegin("fVal", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fVal: ", p), err) } + if err := oprot.WriteDouble(float64(*p.FVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fVal (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fVal: ", p), err) } + } + return err +} + +func (p *Value) writeField5(oprot thrift.Protocol) (err error) { + if p.IsSetSVal() { + if err := oprot.WriteFieldBegin("sVal", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sVal: ", p), err) } + if err := oprot.WriteBinary(p.SVal); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sVal (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sVal: ", p), err) } + } + return err +} + +func (p *Value) writeField6(oprot thrift.Protocol) (err error) { + if p.IsSetDVal() { + if err := oprot.WriteFieldBegin("dVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dVal: ", p), err) } + if err := p.DVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dVal: ", p), err) } + } + return err +} + +func (p *Value) writeField7(oprot thrift.Protocol) (err error) { + if p.IsSetTVal() { + if err := oprot.WriteFieldBegin("tVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:tVal: ", p), err) } + if err := p.TVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tVal: ", p), err) } + } + return err +} + +func (p *Value) writeField8(oprot thrift.Protocol) (err error) { + if p.IsSetDtVal() { + if err := oprot.WriteFieldBegin("dtVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:dtVal: ", p), err) } + if err := p.DtVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DtVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:dtVal: ", p), err) } + } + return err +} + +func (p *Value) writeField9(oprot thrift.Protocol) (err error) { + if p.IsSetVVal() { + if err := oprot.WriteFieldBegin("vVal", thrift.STRUCT, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:vVal: ", p), err) } + if err := p.VVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:vVal: ", p), err) } + } + return err +} + +func (p *Value) writeField10(oprot thrift.Protocol) (err error) { + if p.IsSetEVal() { + if err := oprot.WriteFieldBegin("eVal", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:eVal: ", p), err) } + if err := p.EVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:eVal: ", p), err) } + } + return err +} + +func (p *Value) writeField11(oprot thrift.Protocol) (err error) { + if p.IsSetPVal() { + if err := oprot.WriteFieldBegin("pVal", thrift.STRUCT, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:pVal: ", p), err) } + if err := p.PVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:pVal: ", p), err) } + } + return err +} + +func (p *Value) writeField12(oprot thrift.Protocol) (err error) { + if p.IsSetLVal() { + if err := oprot.WriteFieldBegin("lVal", thrift.STRUCT, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:lVal: ", p), err) } + if err := p.LVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:lVal: ", p), err) } + } + return err +} + +func (p *Value) writeField13(oprot thrift.Protocol) (err error) { + if p.IsSetMVal() { + if err := oprot.WriteFieldBegin("mVal", thrift.STRUCT, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:mVal: ", p), err) } + if err := p.MVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:mVal: ", p), err) } + } + return err +} + +func (p *Value) writeField14(oprot thrift.Protocol) (err error) { + if p.IsSetUVal() { + if err := oprot.WriteFieldBegin("uVal", thrift.STRUCT, 14); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:uVal: ", p), err) } + if err := p.UVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:uVal: ", p), err) } + } + return err +} + +func (p *Value) writeField15(oprot thrift.Protocol) (err error) { + if p.IsSetGVal() { + if err := oprot.WriteFieldBegin("gVal", thrift.STRUCT, 15); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:gVal: ", p), err) } + if err := p.GVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:gVal: ", p), err) } + } + return err +} + +func (p *Value) writeField16(oprot thrift.Protocol) (err error) { + if p.IsSetGgVal() { + if err := oprot.WriteFieldBegin("ggVal", thrift.STRUCT, 16); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 16:ggVal: ", p), err) } + if err := p.GgVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GgVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 16:ggVal: ", p), err) } + } + return err +} + +func (p *Value) String() string { + if p == nil { + return "" + } + + var nValVal string + if p.NVal == nil { + nValVal = "" + } else { + nValVal = fmt.Sprintf("%v", *p.NVal) + } + var bValVal string + if p.BVal == nil { + bValVal = "" + } else { + bValVal = fmt.Sprintf("%v", *p.BVal) + } + var iValVal string + if p.IVal == nil { + iValVal = "" + } else { + iValVal = fmt.Sprintf("%v", *p.IVal) + } + var fValVal string + if p.FVal == nil { + fValVal = "" + } else { + fValVal = fmt.Sprintf("%v", *p.FVal) + } + sValVal := fmt.Sprintf("%v", p.SVal) + var dValVal string + if p.DVal == nil { + dValVal = "" + } else { + dValVal = fmt.Sprintf("%v", p.DVal) + } + var tValVal string + if p.TVal == nil { + tValVal = "" + } else { + tValVal = fmt.Sprintf("%v", p.TVal) + } + var dtValVal string + if p.DtVal == nil { + dtValVal = "" + } else { + dtValVal = fmt.Sprintf("%v", p.DtVal) + } + var vValVal string + if p.VVal == nil { + vValVal = "" + } else { + vValVal = fmt.Sprintf("%v", p.VVal) + } + var eValVal string + if p.EVal == nil { + eValVal = "" + } else { + eValVal = fmt.Sprintf("%v", p.EVal) + } + var pValVal string + if p.PVal == nil { + pValVal = "" + } else { + pValVal = fmt.Sprintf("%v", p.PVal) + } + var lValVal string + if p.LVal == nil { + lValVal = "" + } else { + lValVal = fmt.Sprintf("%v", p.LVal) + } + var mValVal string + if p.MVal == nil { + mValVal = "" + } else { + mValVal = fmt.Sprintf("%v", p.MVal) + } + var uValVal string + if p.UVal == nil { + uValVal = "" + } else { + uValVal = fmt.Sprintf("%v", p.UVal) + } + var gValVal string + if p.GVal == nil { + gValVal = "" + } else { + gValVal = fmt.Sprintf("%v", p.GVal) + } + var ggValVal string + if p.GgVal == nil { + ggValVal = "" + } else { + ggValVal = fmt.Sprintf("%v", p.GgVal) + } + return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s GgVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal, ggValVal) +} + +// Attributes: +// - Values +type NList struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNList() *NList { + return &NList{} +} + + +func (p *NList) GetValues() []*Value { + return p.Values +} +func (p *NList) 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 *NList) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem0 := NewValue() + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Values = append(p.Values, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NList) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NList"); 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 *NList) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NList) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NList({Values:%s})", valuesVal) +} + +// Attributes: +// - Kvs +type NMap struct { + Kvs map[string]*Value `thrift:"kvs,1" db:"kvs" json:"kvs"` +} + +func NewNMap() *NMap { + return &NMap{} +} + + +func (p *NMap) GetKvs() map[string]*Value { + return p.Kvs +} +func (p *NMap) 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 *NMap) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Kvs = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} + _val2 := NewValue() + if err := _val2.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val2), err) + } + p.Kvs[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *NMap) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NMap"); 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 *NMap) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("kvs", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kvs: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Kvs)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Kvs { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kvs: ", p), err) } + return err +} + +func (p *NMap) String() string { + if p == nil { + return "" + } + + kvsVal := fmt.Sprintf("%v", p.Kvs) + return fmt.Sprintf("NMap({Kvs:%s})", kvsVal) +} + +// Attributes: +// - Values +type NSet struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewNSet() *NSet { + return &NSet{} +} + + +func (p *NSet) GetValues() []*Value { + return p.Values +} +func (p *NSet) 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 *NSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*Value, 0, size) + p.Values = tSet + for i := 0; i < size; i ++ { + _elem3 := NewValue() + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Values = append(p.Values, _elem3) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *NSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NSet"); 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 *NSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.SET, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + set := make(map[*Value]bool, len(p.Values)) + for _, v := range p.Values { + if ok := set[v]; ok { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v)) + } + set[v] = true + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteSetEnd(); err != nil { + return thrift.PrependError("error writing set end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NSet) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("NSet({Values:%s})", valuesVal) +} + +// Attributes: +// - Values +type Row struct { + Values []*Value `thrift:"values,1" db:"values" json:"values"` +} + +func NewRow() *Row { + return &Row{} +} + + +func (p *Row) GetValues() []*Value { + return p.Values +} +func (p *Row) 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 *Row) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Value, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { + _elem4 := NewValue() + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Values = append(p.Values, _elem4) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Row) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Row"); 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 *Row) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *Row) String() string { + if p == nil { + return "" + } + + valuesVal := fmt.Sprintf("%v", p.Values) + return fmt.Sprintf("Row({Values:%s})", valuesVal) +} + +// Attributes: +// - ColumnNames +// - Rows +type DataSet struct { + ColumnNames [][]byte `thrift:"column_names,1" db:"column_names" json:"column_names"` + Rows []*Row `thrift:"rows,2" db:"rows" json:"rows"` +} + +func NewDataSet() *DataSet { + return &DataSet{} +} + + +func (p *DataSet) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *DataSet) GetRows() []*Row { + return p.Rows +} +func (p *DataSet) 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 *DataSet) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ColumnNames = tSlice + for i := 0; i < size; i ++ { +var _elem5 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.ColumnNames = append(p.ColumnNames, _elem5) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Row, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _elem6 := NewRow() + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + } + p.Rows = append(p.Rows, _elem6) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DataSet"); 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 *DataSet) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:column_names: ", p), err) } + return err +} + +func (p *DataSet) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + 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:rows: ", p), err) } + return err +} + +func (p *DataSet) String() string { + if p == nil { + return "" + } + + columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) + rowsVal := fmt.Sprintf("%v", p.Rows) + return fmt.Sprintf("DataSet({ColumnNames:%s Rows:%s})", columnNamesVal, rowsVal) +} + +// Attributes: +// - X +// - Y +type Coordinate struct { + X float64 `thrift:"x,1" db:"x" json:"x"` + Y float64 `thrift:"y,2" db:"y" json:"y"` +} + +func NewCoordinate() *Coordinate { + return &Coordinate{} +} + + +func (p *Coordinate) GetX() float64 { + return p.X +} + +func (p *Coordinate) GetY() float64 { + return p.Y +} +func (p *Coordinate) 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 *Coordinate) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.X = v +} + return nil +} + +func (p *Coordinate) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Y = v +} + return nil +} + +func (p *Coordinate) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Coordinate"); 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 *Coordinate) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("x", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:x: ", p), err) } + if err := oprot.WriteDouble(float64(p.X)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.x (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:x: ", p), err) } + return err +} + +func (p *Coordinate) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("y", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:y: ", p), err) } + if err := oprot.WriteDouble(float64(p.Y)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.y (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:y: ", p), err) } + return err +} + +func (p *Coordinate) String() string { + if p == nil { + return "" + } + + xVal := fmt.Sprintf("%v", p.X) + yVal := fmt.Sprintf("%v", p.Y) + return fmt.Sprintf("Coordinate({X:%s Y:%s})", xVal, yVal) +} + +// Attributes: +// - Coord +type Point struct { + Coord *Coordinate `thrift:"coord,1" db:"coord" json:"coord"` +} + +func NewPoint() *Point { + return &Point{ + Coord: NewCoordinate(), + } +} + +var Point_Coord_DEFAULT *Coordinate +func (p *Point) GetCoord() *Coordinate { + if !p.IsSetCoord() { + return Point_Coord_DEFAULT + } +return p.Coord +} +func (p *Point) IsSetCoord() bool { + return p != nil && p.Coord != nil +} + +func (p *Point) 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 *Point) ReadField1(iprot thrift.Protocol) error { + p.Coord = NewCoordinate() + if err := p.Coord.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Coord), err) + } + return nil +} + +func (p *Point) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Point"); 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 *Point) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("coord", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coord: ", p), err) } + if err := p.Coord.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Coord), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coord: ", p), err) } + return err +} + +func (p *Point) String() string { + if p == nil { + return "" + } + + var coordVal string + if p.Coord == nil { + coordVal = "" + } else { + coordVal = fmt.Sprintf("%v", p.Coord) + } + return fmt.Sprintf("Point({Coord:%s})", coordVal) +} + +// Attributes: +// - CoordList +type LineString struct { + CoordList []*Coordinate `thrift:"coordList,1" db:"coordList" json:"coordList"` +} + +func NewLineString() *LineString { + return &LineString{} +} + + +func (p *LineString) GetCoordList() []*Coordinate { + return p.CoordList +} +func (p *LineString) 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 *LineString) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Coordinate, 0, size) + p.CoordList = tSlice + for i := 0; i < size; i ++ { + _elem7 := NewCoordinate() + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.CoordList = append(p.CoordList, _elem7) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LineString) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("LineString"); 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 *LineString) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("coordList", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordList: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CoordList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.CoordList { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordList: ", p), err) } + return err +} + +func (p *LineString) String() string { + if p == nil { + return "" + } + + coordListVal := fmt.Sprintf("%v", p.CoordList) + return fmt.Sprintf("LineString({CoordList:%s})", coordListVal) +} + +// Attributes: +// - CoordListList +type Polygon struct { + CoordListList [][]*Coordinate `thrift:"coordListList,1" db:"coordListList" json:"coordListList"` +} + +func NewPolygon() *Polygon { + return &Polygon{} +} + + +func (p *Polygon) GetCoordListList() [][]*Coordinate { + return p.CoordListList +} +func (p *Polygon) 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 *Polygon) ReadField1(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]*Coordinate, 0, size) + p.CoordListList = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Coordinate, 0, size) + _elem8 := tSlice + for i := 0; i < size; i ++ { + _elem9 := NewCoordinate() + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + _elem8 = append(_elem8, _elem9) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.CoordListList = append(p.CoordListList, _elem8) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Polygon) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Polygon"); 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 *Polygon) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("coordListList", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordListList: ", p), err) } + if err := oprot.WriteListBegin(thrift.LIST, len(p.CoordListList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.CoordListList { + if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordListList: ", p), err) } + return err +} + +func (p *Polygon) String() string { + if p == nil { + return "" + } + + coordListListVal := fmt.Sprintf("%v", p.CoordListList) + return fmt.Sprintf("Polygon({CoordListList:%s})", coordListListVal) +} + +// Attributes: +// - PtVal +// - LsVal +// - PgVal +type Geography struct { + PtVal *Point `thrift:"ptVal,1" db:"ptVal" json:"ptVal,omitempty"` + LsVal *LineString `thrift:"lsVal,2" db:"lsVal" json:"lsVal,omitempty"` + PgVal *Polygon `thrift:"pgVal,3" db:"pgVal" json:"pgVal,omitempty"` +} + +func NewGeography() *Geography { + return &Geography{} +} + +var Geography_PtVal_DEFAULT *Point +func (p *Geography) GetPtVal() *Point { + if !p.IsSetPtVal() { + return Geography_PtVal_DEFAULT + } +return p.PtVal +} +var Geography_LsVal_DEFAULT *LineString +func (p *Geography) GetLsVal() *LineString { + if !p.IsSetLsVal() { + return Geography_LsVal_DEFAULT + } +return p.LsVal +} +var Geography_PgVal_DEFAULT *Polygon +func (p *Geography) GetPgVal() *Polygon { + if !p.IsSetPgVal() { + return Geography_PgVal_DEFAULT + } +return p.PgVal +} +func (p *Geography) CountSetFieldsGeography() int { + count := 0 + if (p.IsSetPtVal()) { + count++ + } + if (p.IsSetLsVal()) { + count++ + } + if (p.IsSetPgVal()) { + count++ + } + return count + +} + +func (p *Geography) IsSetPtVal() bool { + return p != nil && p.PtVal != nil +} + +func (p *Geography) IsSetLsVal() bool { + return p != nil && p.LsVal != nil +} + +func (p *Geography) IsSetPgVal() bool { + return p != nil && p.PgVal != nil +} + +func (p *Geography) 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 *Geography) ReadField1(iprot thrift.Protocol) error { + p.PtVal = NewPoint() + if err := p.PtVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PtVal), err) + } + return nil +} + +func (p *Geography) ReadField2(iprot thrift.Protocol) error { + p.LsVal = NewLineString() + if err := p.LsVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LsVal), err) + } + return nil +} + +func (p *Geography) ReadField3(iprot thrift.Protocol) error { + p.PgVal = NewPolygon() + if err := p.PgVal.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PgVal), err) + } + return nil +} + +func (p *Geography) Write(oprot thrift.Protocol) error { + if c := p.CountSetFieldsGeography(); c > 1 { + return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("Geography"); 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 *Geography) writeField1(oprot thrift.Protocol) (err error) { + if p.IsSetPtVal() { + if err := oprot.WriteFieldBegin("ptVal", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ptVal: ", p), err) } + if err := p.PtVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PtVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ptVal: ", p), err) } + } + return err +} + +func (p *Geography) writeField2(oprot thrift.Protocol) (err error) { + if p.IsSetLsVal() { + if err := oprot.WriteFieldBegin("lsVal", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:lsVal: ", p), err) } + if err := p.LsVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LsVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:lsVal: ", p), err) } + } + return err +} + +func (p *Geography) writeField3(oprot thrift.Protocol) (err error) { + if p.IsSetPgVal() { + if err := oprot.WriteFieldBegin("pgVal", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pgVal: ", p), err) } + if err := p.PgVal.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PgVal), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pgVal: ", p), err) } + } + return err +} + +func (p *Geography) String() string { + if p == nil { + return "" + } + + var ptValVal string + if p.PtVal == nil { + ptValVal = "" + } else { + ptValVal = fmt.Sprintf("%v", p.PtVal) + } + var lsValVal string + if p.LsVal == nil { + lsValVal = "" + } else { + lsValVal = fmt.Sprintf("%v", p.LsVal) + } + var pgValVal string + if p.PgVal == nil { + pgValVal = "" + } else { + pgValVal = fmt.Sprintf("%v", p.PgVal) + } + return fmt.Sprintf("Geography({PtVal:%s LsVal:%s PgVal:%s})", ptValVal, lsValVal, pgValVal) +} + +// Attributes: +// - Name +// - Props +type Tag struct { + Name []byte `thrift:"name,1" db:"name" json:"name"` + Props map[string]*Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewTag() *Tag { + return &Tag{} +} + + +func (p *Tag) GetName() []byte { + return p.Name +} + +func (p *Tag) GetProps() map[string]*Value { + return p.Props +} +func (p *Tag) 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 *Tag) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Tag) ReadField2(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} + _val11 := NewValue() + if err := _val11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val11), err) + } + p.Props[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Tag) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Tag"); 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 *Tag) 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.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Tag) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + + nameVal := fmt.Sprintf("%v", p.Name) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Tag({Name:%s Props:%s})", nameVal, propsVal) +} + +// Attributes: +// - Vid +// - Tags +type Vertex struct { + Vid *Value `thrift:"vid,1" db:"vid" json:"vid"` + Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewVertex() *Vertex { + return &Vertex{} +} + +var Vertex_Vid_DEFAULT *Value +func (p *Vertex) GetVid() *Value { + if !p.IsSetVid() { + return Vertex_Vid_DEFAULT + } +return p.Vid +} + +func (p *Vertex) GetTags() []*Tag { + return p.Tags +} +func (p *Vertex) IsSetVid() bool { + return p != nil && p.Vid != nil +} + +func (p *Vertex) 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 *Vertex) ReadField1(iprot thrift.Protocol) error { + p.Vid = NewValue() + if err := p.Vid.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vid), err) + } + return nil +} + +func (p *Vertex) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { + _elem12 := NewTag() + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.Tags = append(p.Tags, _elem12) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Vertex) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Vertex"); 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 *Vertex) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("vid", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:vid: ", p), err) } + if err := p.Vid.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vid), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:vid: ", p), err) } + return err +} + +func (p *Vertex) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + 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:tags: ", p), err) } + return err +} + +func (p *Vertex) String() string { + if p == nil { + return "" + } + + var vidVal string + if p.Vid == nil { + vidVal = "" + } else { + vidVal = fmt.Sprintf("%v", p.Vid) + } + tagsVal := fmt.Sprintf("%v", p.Tags) + return fmt.Sprintf("Vertex({Vid:%s Tags:%s})", vidVal, tagsVal) +} + +// Attributes: +// - Src +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Edge struct { + Src *Value `thrift:"src,1" db:"src" json:"src"` + Dst *Value `thrift:"dst,2" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,3" db:"type" json:"type"` + Name []byte `thrift:"name,4" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,5" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,6" db:"props" json:"props"` +} + +func NewEdge() *Edge { + return &Edge{} +} + +var Edge_Src_DEFAULT *Value +func (p *Edge) GetSrc() *Value { + if !p.IsSetSrc() { + return Edge_Src_DEFAULT + } +return p.Src +} +var Edge_Dst_DEFAULT *Value +func (p *Edge) GetDst() *Value { + if !p.IsSetDst() { + return Edge_Dst_DEFAULT + } +return p.Dst +} + +func (p *Edge) GetType() EdgeType { + return p.Type +} + +func (p *Edge) GetName() []byte { + return p.Name +} + +func (p *Edge) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Edge) GetProps() map[string]*Value { + return p.Props +} +func (p *Edge) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Edge) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Edge) 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 + } + case 5: + if err := p.ReadField5(iprot); err != nil { + return err + } + case 6: + if err := p.ReadField6(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Edge) ReadField1(iprot thrift.Protocol) error { + p.Src = NewValue() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Edge) ReadField2(iprot thrift.Protocol) error { + p.Dst = NewValue() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Edge) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Edge) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Edge) ReadField5(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Edge) ReadField6(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key13 = v +} + _val14 := NewValue() + if err := _val14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val14), err) + } + p.Props[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Edge) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Edge"); 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 := p.writeField6(oprot); err != nil { return err } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Edge) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Edge) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dst: ", p), err) } + return err +} + +func (p *Edge) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *Edge) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:name: ", p), err) } + return err +} + +func (p *Edge) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ranking: ", p), err) } + return err +} + +func (p *Edge) writeField6(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) } + return err +} + +func (p *Edge) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Edge({Src:%s Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", srcVal, dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Dst +// - Type +// - Name +// - Ranking +// - Props +type Step struct { + Dst *Vertex `thrift:"dst,1" db:"dst" json:"dst"` + Type EdgeType `thrift:"type,2" db:"type" json:"type"` + Name []byte `thrift:"name,3" db:"name" json:"name"` + Ranking EdgeRanking `thrift:"ranking,4" db:"ranking" json:"ranking"` + Props map[string]*Value `thrift:"props,5" db:"props" json:"props"` +} + +func NewStep() *Step { + return &Step{ + Dst: NewVertex(), + } +} + +var Step_Dst_DEFAULT *Vertex +func (p *Step) GetDst() *Vertex { + if !p.IsSetDst() { + return Step_Dst_DEFAULT + } +return p.Dst +} + +func (p *Step) GetType() EdgeType { + return p.Type +} + +func (p *Step) GetName() []byte { + return p.Name +} + +func (p *Step) GetRanking() EdgeRanking { + return p.Ranking +} + +func (p *Step) GetProps() map[string]*Value { + return p.Props +} +func (p *Step) IsSetDst() bool { + return p != nil && p.Dst != nil +} + +func (p *Step) 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 + } + 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 *Step) ReadField1(iprot thrift.Protocol) error { + p.Dst = NewVertex() + if err := p.Dst.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Step) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Step) ReadField3(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Step) ReadField4(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Step) ReadField5(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*Value, size) + p.Props = tMap + for i := 0; i < size; i ++ { +var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key15 = v +} + _val16 := NewValue() + if err := _val16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val16), err) + } + p.Props[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Step) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Step"); 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 *Step) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dst", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dst: ", p), err) } + if err := p.Dst.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dst: ", p), err) } + return err +} + +func (p *Step) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *Step) writeField3(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *Step) writeField4(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("ranking", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ranking: ", p), err) } + if err := oprot.WriteI64(int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ranking: ", p), err) } + return err +} + +func (p *Step) writeField5(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("props", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:props: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Props { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:props: ", p), err) } + return err +} + +func (p *Step) String() string { + if p == nil { + return "" + } + + var dstVal string + if p.Dst == nil { + dstVal = "" + } else { + dstVal = fmt.Sprintf("%v", p.Dst) + } + typeVal := fmt.Sprintf("%v", p.Type) + nameVal := fmt.Sprintf("%v", p.Name) + rankingVal := fmt.Sprintf("%v", p.Ranking) + propsVal := fmt.Sprintf("%v", p.Props) + return fmt.Sprintf("Step({Dst:%s Type:%s Name:%s Ranking:%s Props:%s})", dstVal, typeVal, nameVal, rankingVal, propsVal) +} + +// Attributes: +// - Src +// - Steps +type Path struct { + Src *Vertex `thrift:"src,1" db:"src" json:"src"` + Steps []*Step `thrift:"steps,2" db:"steps" json:"steps"` +} + +func NewPath() *Path { + return &Path{ + Src: NewVertex(), + } +} + +var Path_Src_DEFAULT *Vertex +func (p *Path) GetSrc() *Vertex { + if !p.IsSetSrc() { + return Path_Src_DEFAULT + } +return p.Src +} + +func (p *Path) GetSteps() []*Step { + return p.Steps +} +func (p *Path) IsSetSrc() bool { + return p != nil && p.Src != nil +} + +func (p *Path) 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 *Path) ReadField1(iprot thrift.Protocol) error { + p.Src = NewVertex() + if err := p.Src.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Path) ReadField2(iprot thrift.Protocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Step, 0, size) + p.Steps = tSlice + for i := 0; i < size; i ++ { + _elem17 := NewStep() + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + p.Steps = append(p.Steps, _elem17) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Path) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("Path"); 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 *Path) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("src", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:src: ", p), err) } + if err := p.Src.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Path) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("steps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:steps: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Steps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Steps { + 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:steps: ", p), err) } + return err +} + +func (p *Path) String() string { + if p == nil { + return "" + } + + var srcVal string + if p.Src == nil { + srcVal = "" + } else { + srcVal = fmt.Sprintf("%v", p.Src) + } + stepsVal := fmt.Sprintf("%v", p.Steps) + return fmt.Sprintf("Path({Src:%s Steps:%s})", srcVal, stepsVal) +} + +// Attributes: +// - Host +// - Port +type HostAddr struct { + Host string `thrift:"host,1" db:"host" json:"host"` + Port Port `thrift:"port,2" db:"port" json:"port"` +} + +func NewHostAddr() *HostAddr { + return &HostAddr{} +} + + +func (p *HostAddr) GetHost() string { + return p.Host +} + +func (p *HostAddr) GetPort() Port { + return p.Port +} +func (p *HostAddr) 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 *HostAddr) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *HostAddr) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := Port(v) + p.Port = temp +} + return nil +} + +func (p *HostAddr) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("HostAddr"); 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 *HostAddr) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteString(string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostAddr) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } + if err := oprot.WriteI32(int32(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } + return err +} + +func (p *HostAddr) String() string { + if p == nil { + return "" + } + + hostVal := fmt.Sprintf("%v", p.Host) + portVal := fmt.Sprintf("%v", p.Port) + return fmt.Sprintf("HostAddr({Host:%s Port:%s})", hostVal, portVal) +} + +// Attributes: +// - Key +// - Value +type KeyValue struct { + Key []byte `thrift:"key,1" db:"key" json:"key"` + Value []byte `thrift:"value,2" db:"value" json:"value"` +} + +func NewKeyValue() *KeyValue { + return &KeyValue{} +} + + +func (p *KeyValue) GetKey() []byte { + return p.Key +} + +func (p *KeyValue) GetValue() []byte { + return p.Value +} +func (p *KeyValue) 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 *KeyValue) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *KeyValue) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *KeyValue) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("KeyValue"); 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 *KeyValue) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *KeyValue) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + + keyVal := fmt.Sprintf("%v", p.Key) + valueVal := fmt.Sprintf("%v", p.Value) + return fmt.Sprintf("KeyValue({Key:%s Value:%s})", keyVal, valueVal) +} + +// Attributes: +// - LogID +// - TermID +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"` +} + +func NewLogInfo() *LogInfo { + return &LogInfo{} +} + + +func (p *LogInfo) GetLogID() LogID { + return p.LogID +} + +func (p *LogInfo) GetTermID() TermID { + return p.TermID +} +func (p *LogInfo) 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 *LogInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := LogID(v) + p.LogID = temp +} + return nil +} + +func (p *LogInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TermID(v) + p.TermID = temp +} + 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 := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("log_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:log_id: ", p), err) } + if err := oprot.WriteI64(int64(p.LogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("term_id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term_id: ", p), err) } + if err := oprot.WriteI64(int64(p.TermID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_id: ", p), err) } + return err +} + +func (p *LogInfo) String() string { + if p == nil { + return "" + } + + logIDVal := fmt.Sprintf("%v", p.LogID) + termIDVal := fmt.Sprintf("%v", p.TermID) + return fmt.Sprintf("LogInfo({LogID:%s TermID:%s})", logIDVal, termIDVal) +} + +// Attributes: +// - Root +// - Data +type DirInfo struct { + Root []byte `thrift:"root,1" db:"root" json:"root"` + Data [][]byte `thrift:"data,2" db:"data" json:"data"` +} + +func NewDirInfo() *DirInfo { + return &DirInfo{} +} + + +func (p *DirInfo) GetRoot() []byte { + return p.Root +} + +func (p *DirInfo) GetData() [][]byte { + return p.Data +} +func (p *DirInfo) 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 *DirInfo) ReadField1(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Root = v +} + return nil +} + +func (p *DirInfo) 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.Data = tSlice + for i := 0; i < size; i ++ { +var _elem18 []byte + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem18 = v +} + p.Data = append(p.Data, _elem18) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DirInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("DirInfo"); 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 *DirInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("root", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:root: ", p), err) } + if err := oprot.WriteBinary(p.Root); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.root (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:root: ", p), err) } + return err +} + +func (p *DirInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + 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:data: ", p), err) } + return err +} + +func (p *DirInfo) String() string { + if p == nil { + return "" + } + + rootVal := fmt.Sprintf("%v", p.Root) + dataVal := fmt.Sprintf("%v", p.Data) + return fmt.Sprintf("DirInfo({Root:%s Data:%s})", rootVal, dataVal) +} + +// Attributes: +// - Host +// - Dir +type NodeInfo struct { + Host *HostAddr `thrift:"host,1" db:"host" json:"host"` + Dir *DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewNodeInfo() *NodeInfo { + return &NodeInfo{ + Host: NewHostAddr(), + Dir: NewDirInfo(), + } +} + +var NodeInfo_Host_DEFAULT *HostAddr +func (p *NodeInfo) GetHost() *HostAddr { + if !p.IsSetHost() { + return NodeInfo_Host_DEFAULT + } +return p.Host +} +var NodeInfo_Dir_DEFAULT *DirInfo +func (p *NodeInfo) GetDir() *DirInfo { + if !p.IsSetDir() { + return NodeInfo_Dir_DEFAULT + } +return p.Dir +} +func (p *NodeInfo) IsSetHost() bool { + return p != nil && p.Host != nil +} + +func (p *NodeInfo) IsSetDir() bool { + return p != nil && p.Dir != nil +} + +func (p *NodeInfo) 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 *NodeInfo) ReadField1(iprot thrift.Protocol) error { + p.Host = NewHostAddr() + if err := p.Host.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *NodeInfo) ReadField2(iprot thrift.Protocol) error { + p.Dir = NewDirInfo() + if err := p.Dir.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *NodeInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("NodeInfo"); 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 *NodeInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := p.Host.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *NodeInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dir: ", p), err) } + if err := p.Dir.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *NodeInfo) String() string { + if p == nil { + return "" + } + + var hostVal string + if p.Host == nil { + hostVal = "" + } else { + hostVal = fmt.Sprintf("%v", p.Host) + } + var dirVal string + if p.Dir == nil { + dirVal = "" + } else { + dirVal = fmt.Sprintf("%v", p.Dir) + } + return fmt.Sprintf("NodeInfo({Host:%s Dir:%s})", hostVal, dirVal) +} + +// Attributes: +// - Info +type PartitionBackupInfo struct { + Info map[PartitionID]*LogInfo `thrift:"info,1" db:"info" json:"info"` +} + +func NewPartitionBackupInfo() *PartitionBackupInfo { + return &PartitionBackupInfo{} +} + + +func (p *PartitionBackupInfo) GetInfo() map[PartitionID]*LogInfo { + return p.Info +} +func (p *PartitionBackupInfo) 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 *PartitionBackupInfo) ReadField1(iprot thrift.Protocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[PartitionID]*LogInfo, size) + p.Info = tMap + for i := 0; i < size; i ++ { +var _key19 PartitionID + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := PartitionID(v) + _key19 = temp +} + _val20 := NewLogInfo() + if err := _val20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val20), err) + } + p.Info[_key19] = _val20 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PartitionBackupInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("PartitionBackupInfo"); 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 *PartitionBackupInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("info", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) } + if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Info { + if err := oprot.WriteI32(int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) } + return err +} + +func (p *PartitionBackupInfo) String() string { + if p == nil { + return "" + } + + infoVal := fmt.Sprintf("%v", p.Info) + return fmt.Sprintf("PartitionBackupInfo({Info:%s})", infoVal) +} + +// Attributes: +// - PartitionInfo +// - Path +type CheckpointInfo struct { + PartitionInfo *PartitionBackupInfo `thrift:"partition_info,1" db:"partition_info" json:"partition_info"` + Path []byte `thrift:"path,2" db:"path" json:"path"` +} + +func NewCheckpointInfo() *CheckpointInfo { + return &CheckpointInfo{ + PartitionInfo: NewPartitionBackupInfo(), + } +} + +var CheckpointInfo_PartitionInfo_DEFAULT *PartitionBackupInfo +func (p *CheckpointInfo) GetPartitionInfo() *PartitionBackupInfo { + if !p.IsSetPartitionInfo() { + return CheckpointInfo_PartitionInfo_DEFAULT + } +return p.PartitionInfo +} + +func (p *CheckpointInfo) GetPath() []byte { + return p.Path +} +func (p *CheckpointInfo) IsSetPartitionInfo() bool { + return p != nil && p.PartitionInfo != nil +} + +func (p *CheckpointInfo) 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 *CheckpointInfo) ReadField1(iprot thrift.Protocol) error { + p.PartitionInfo = NewPartitionBackupInfo() + if err := p.PartitionInfo.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionInfo), err) + } + return nil +} + +func (p *CheckpointInfo) ReadField2(iprot thrift.Protocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Path = v +} + return nil +} + +func (p *CheckpointInfo) Write(oprot thrift.Protocol) error { + if err := oprot.WriteStructBegin("CheckpointInfo"); 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 *CheckpointInfo) writeField1(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("partition_info", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:partition_info: ", p), err) } + if err := p.PartitionInfo.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionInfo), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:partition_info: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField2(oprot thrift.Protocol) (err error) { + if err := oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:path: ", p), err) } + if err := oprot.WriteBinary(p.Path); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.path (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:path: ", p), err) } + return err +} + +func (p *CheckpointInfo) String() string { + if p == nil { + return "" + } + + var partitionInfoVal string + if p.PartitionInfo == nil { + partitionInfoVal = "" + } else { + partitionInfoVal = fmt.Sprintf("%v", p.PartitionInfo) + } + pathVal := fmt.Sprintf("%v", p.Path) + return fmt.Sprintf("CheckpointInfo({PartitionInfo:%s Path:%s})", partitionInfoVal, pathVal) +} + diff --git a/ccore/nebula/logger.go b/ccore/nebula/logger.go new file mode 100644 index 0000000..76c9896 --- /dev/null +++ b/ccore/nebula/logger.go @@ -0,0 +1,30 @@ +package nebula + +var ( + _ Logger = noOpLogger{} +) + +type ( + Logger interface { + Info(...interface{}) + Infof(string, ...interface{}) + Warn(...interface{}) + Warnf(string, ...interface{}) + Error(...interface{}) + Errorf(string, ...interface{}) + Fatal(...interface{}) + Fatalf(string, ...interface{}) + } +) + +// noOpLogger is used as a placeholder for the default logger +type noOpLogger struct{} + +func (noOpLogger) Info(...interface{}) {} +func (noOpLogger) Infof(string, ...interface{}) {} +func (noOpLogger) Warn(...interface{}) {} +func (noOpLogger) Warnf(string, ...interface{}) {} +func (noOpLogger) Error(...interface{}) {} +func (noOpLogger) Errorf(string, ...interface{}) {} +func (noOpLogger) Fatal(...interface{}) {} +func (noOpLogger) Fatalf(string, ...interface{}) {} diff --git a/ccore/nebula/options.go b/ccore/nebula/options.go new file mode 100644 index 0000000..f95210d --- /dev/null +++ b/ccore/nebula/options.go @@ -0,0 +1,194 @@ +package nebula + +import ( + "crypto/tls" + "math" + "time" +) + +const ( + DefaultTimeout = time.Duration(0) + DefaultBufferSize = 128 << 10 + DefaultFrameMaxLength = math.MaxUint32 +) + +type ( + Options struct { + version Version + log Logger + graph socketOptions + meta socketOptions + storageAdmin socketOptions + } + + socketOptions struct { + timeout time.Duration + bufferSize int + frameMaxLength uint32 + tlsConfig *tls.Config + } + + Option func(o *Options) +) + +func WithVersion(version Version) Option { + return func(o *Options) { + o.version = version + } +} + +func WithLogger(log Logger) Option { + return func(o *Options) { + o.log = log + } +} + +func WithTimeout(timeout time.Duration) Option { + return func(o *Options) { + WithGraphTimeout(timeout) + WithMetaTimeout(timeout) + WithStorageTimeout(timeout) + } +} + +func WithGraphTimeout(timeout time.Duration) Option { + return func(o *Options) { + o.graph.timeout = timeout + } +} + +func WithMetaTimeout(timeout time.Duration) Option { + return func(o *Options) { + o.meta.timeout = timeout + } +} + +func WithStorageTimeout(timeout time.Duration) Option { + return func(o *Options) { + o.storageAdmin.timeout = timeout + } +} + +func WithBufferSize(bufferSize int) Option { + return func(o *Options) { + WithMetaBufferSize(bufferSize) + WithGraphBufferSize(bufferSize) + WithStorageBufferSize(bufferSize) + } +} + +func WithGraphBufferSize(bufferSize int) Option { + return func(o *Options) { + o.graph.bufferSize = bufferSize + } +} + +func WithMetaBufferSize(bufferSize int) Option { + return func(o *Options) { + o.meta.bufferSize = bufferSize + } +} + +func WithStorageBufferSize(bufferSize int) Option { + return func(o *Options) { + o.storageAdmin.bufferSize = bufferSize + } +} + +func WithFrameMaxLength(frameMaxLength uint32) Option { + return func(o *Options) { + WithGraphFrameMaxLength(frameMaxLength) + WithMetaFrameMaxLength(frameMaxLength) + WithStorageFrameMaxLength(frameMaxLength) + } +} + +func WithGraphFrameMaxLength(frameMaxLength uint32) Option { + return func(o *Options) { + o.graph.frameMaxLength = frameMaxLength + } +} + +func WithMetaFrameMaxLength(frameMaxLength uint32) Option { + return func(o *Options) { + o.meta.frameMaxLength = frameMaxLength + } +} + +func WithStorageFrameMaxLength(frameMaxLength uint32) Option { + return func(o *Options) { + o.storageAdmin.frameMaxLength = frameMaxLength + } +} + +func WithTLS(tlsConfig *tls.Config) Option { + return func(o *Options) { + WithGraphTLS(tlsConfig) + WithMetaTLS(tlsConfig) + WithStorageTLS(tlsConfig) + } +} + +func WithGraphTLS(tlsConfig *tls.Config) Option { + return func(o *Options) { + o.graph.tlsConfig = tlsConfig + } +} + +func WithMetaTLS(tlsConfig *tls.Config) Option { + return func(o *Options) { + o.meta.tlsConfig = tlsConfig + } +} + +func WithStorageTLS(tlsConfig *tls.Config) Option { + return func(o *Options) { + o.storageAdmin.tlsConfig = tlsConfig + } +} + +func (o *Options) complete() { + defaultOpts := defaultOptions() + + if o.log == nil { + o.log = defaultOpts.log + } + o.graph.complete() + o.meta.complete() + o.storageAdmin.complete() +} + +func (o *Options) validate() error { + return nil +} + +func (o *socketOptions) complete() { + defaultOpts := defaultSocketOptions() + if o.timeout < 0 { + o.timeout = defaultOpts.timeout + } + if o.bufferSize <= 0 { + o.bufferSize = defaultOpts.bufferSize + } + if o.frameMaxLength <= 0 { + o.frameMaxLength = defaultOpts.frameMaxLength + } +} + +func defaultOptions() Options { + return Options{ + log: noOpLogger{}, + graph: defaultSocketOptions(), + meta: defaultSocketOptions(), + storageAdmin: defaultSocketOptions(), + } +} + +func defaultSocketOptions() socketOptions { + return socketOptions{ + timeout: DefaultTimeout, + bufferSize: DefaultBufferSize, + frameMaxLength: DefaultFrameMaxLength, + tlsConfig: nil, + } +} diff --git a/ccore/nebula/types/driver.go b/ccore/nebula/types/driver.go new file mode 100644 index 0000000..14c8b4e --- /dev/null +++ b/ccore/nebula/types/driver.go @@ -0,0 +1,82 @@ +package types + +import ( + "sync" + + "github.com/facebook/fbthrift/thrift/lib/go/thrift" + nerrors "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/errors" +) + +var ( + driversMu sync.RWMutex + drivers = make(map[Version]Driver) +) + +type ( + Driver interface { + NewGraphClientDriver(thrift.Transport, thrift.ProtocolFactory) GraphClientDriver + NewMetaClientDriver(thrift.Transport, thrift.ProtocolFactory) MetaClientDriver + NewStorageClientDriver(thrift.Transport, thrift.ProtocolFactory) StorageAdminClientDriver + } + + GraphClientDriver interface { + Open() error + Authenticate(username, password string) (AuthResponse, error) + Signout(sessionId int64) (err error) + Execute(sessionId int64, stmt []byte) (ExecutionResponse, error) + ExecuteJson(sessionId int64, stmt []byte) ([]byte, error) + Close() error + } + + MetaClientDriver interface { + Open() error + Close() error + } + + StorageAdminClientDriver interface { + Open() error + Close() error + } + + AuthResponse interface { + ErrorCode() nerrors.ErrorCode + ErrorMsg() string + SessionID() *int64 + } + + ExecutionResponse interface { + TODO() // TODO: add more function to handle response + } +) + +func Register(version Version, driver Driver) { + driversMu.Lock() + defer driversMu.Unlock() + if driver == nil { + panic("nebula: Register driver is nil") + } + if _, dup := drivers[version]; dup { + panic("nebula: Register called twice for driver " + version) + } + drivers[version] = driver +} + +func Drivers() []Version { + driversMu.RLock() + defer driversMu.RUnlock() + list := make([]Version, 0, len(drivers)) + for version := range drivers { + list = append(list, version) + } + return list +} + +func GetDriver(version Version) (Driver, error) { + driversMu.RLock() + driver, ok := drivers[version] + driversMu.RUnlock() + if !ok { + return nil, nerrors.ErrUnsupportedVersion + } + return driver, nil +} diff --git a/ccore/nebula/types/types.go b/ccore/nebula/types/types.go new file mode 100644 index 0000000..ab1254f --- /dev/null +++ b/ccore/nebula/types/types.go @@ -0,0 +1 @@ +package types diff --git a/ccore/nebula/types/version.go b/ccore/nebula/types/version.go new file mode 100644 index 0000000..3ee55f8 --- /dev/null +++ b/ccore/nebula/types/version.go @@ -0,0 +1,10 @@ +package types + +type Version string + +const ( + V2_0_0 = Version("v2.0.0") + V2_5_0 = Version("v2.5.0") + V2_5_1 = Version("v2.5.1") + V2_6_0 = Version("v2.6.0") +)